kanisterio / kanister

An extensible framework for application-level data management on Kubernetes
https://kanister.io
Apache License 2.0
755 stars 154 forks source link

Add a patch operation to the Kubeops function #2756

Open michaelcourcy opened 7 months ago

michaelcourcy commented 7 months ago

Is your feature request related to a problem? Please describe. Kubeops is great for creating or deleting resource, but sometime you just need to patch a resource, that goes from adding annotations to adding a complete spec tree.

Describe the solution you'd like Here is an example of a kubeops patch operation adding a backup section to a CNPG cluster

- func: KubeOps
  name: addBackupSection
  object: 
  args:
    operation: patch
    objectReference:
      apiVersion: v1
      group: postgresql.cnpg.io
      resource: clusters
      name: "{{ .Object.metatada.name }}"
      namespace: "{{ .Object.metatada.namespace }}"    
    spec: |-
      spec:
          backup:
            barmanObjectStore:
              wal:
                compression: gzip
                encryption: AES256
              destinationPath: s3://{{ .Profile.Location.Bucket }}/{{ .Profile.Location.Prefix  }}/cnpg"
              s3Credentials:
                accessKeyId:
                  name: {{ .Profile.Credential.Secret.Name }}
                  key: aws_access_key_id
                secretAccessKey:
                  name: {{ .Profile.Credential.Secret.Name }}
                  key: aws_secret_access_key

Describe alternatives you've considered Doing that wit a kubetask bash script that embed kubectl

Environment Kubernetes Version/Provider: ... Storage Provider: ... Cluster Size (#nodes): ... Data Size: ...

Additional context Add any other context or screenshots about the feature request here.

github-actions[bot] commented 7 months ago

Thanks for opening this issue :+1:. The team will review it shortly.

If this is a bug report, make sure to include clear instructions how on to reproduce the problem with minimal reproducible examples, where possible. If this is a security report, please review our security policy as outlined in SECURITY.md.

If you haven't already, please take a moment to review our project's Code of Conduct document.

hairyhum commented 6 months ago

@michaelcourcy the request makes sense, please join the next community meeting to discuss.

github-actions[bot] commented 1 week ago

This issue is marked as stale due to inactivity. Add a new comment to reactivate it. CC @kanisterio/maintainers