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

fix(kube): cleanup config manifests #401

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

nourspace
Copy link
Member

@nourspace nourspace commented Dec 15, 2023

  • Use patches instead of deprecated patchesStrategicMerge
  • Remove hardcoded namespace from resources This is automatically added by the config kustomization. Having it requires overlays to specify namespace: system or others in their patches: target which is confusing.

Tests

Created a dummy config kustomization and tested that allow following scenarios result in the same kustomize build

  • Specifying the namespace: example-ns
  • Removing the namespace (results in exactly the same manifests, but with cosmos-operator-system as namespace ofc)
  • Removing the target from the patch
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: example-ns

resources:
  - /path/to/cosmos-operator/config/default

patches:
  - target:
     kind: Deployment
     name: controller-manager
    patch: |-
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: controller-manager
      spec:
        template:
          spec:
            containers:
            - name: manager
              resources:
                limits:
                  memory: 128Mi

- Use patches instead of deprecated patchesStrategicMerge
- Remove hardcoded namespace from resources
  This is automatically added by the config kustomization. Having it requires overlays to specify `namespace: system` or others in their `patches: target` which is confusing.
@nourspace nourspace self-assigned this Dec 15, 2023
@nourspace nourspace merged commit b6c4970 into main Dec 15, 2023
4 checks passed
@nourspace nourspace deleted the nour/fix/config-manifests-cleanup branch December 15, 2023 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants