Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a patch operation to the Kubeops function #2756

Open
michaelcourcy opened this issue Mar 18, 2024 · 2 comments
Open

Add a patch operation to the Kubeops function #2756

michaelcourcy opened this issue Mar 18, 2024 · 2 comments

Comments

@michaelcourcy
Copy link
Contributor

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.

Copy link

Thanks for opening this issue 👍. 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.

@infraq infraq added this to To Be Triaged in Kanister Mar 18, 2024
@hairyhum hairyhum removed the triage label Mar 28, 2024
@hairyhum
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Kanister
To Be Triaged
Development

No branches or pull requests

2 participants