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

Support kustomize spec mixins from annotation #942

Closed
yujunz opened this issue Apr 4, 2019 · 2 comments
Closed

Support kustomize spec mixins from annotation #942

yujunz opened this issue Apr 4, 2019 · 2 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@yujunz
Copy link
Member

yujunz commented Apr 4, 2019

The requirement originates from a use case to make variable substitution in custom fields.

For example, to substitute namespace in ambassador configuration which is stored in metadata/annotations/getambassador.io\/config, we need to make changes as below:

  • create var in kustomization.yaml
  • add field spec to kustomizeconfig.yaml and included it

It ends up in lots of code fragment when you have to handle lots of different fields and make it hard to refactoring the overlays (you shall have to cut and paste the code fragment from one overlay to another).

It would be nice to declare such changes close to where it is used, e.g. the annotation of related resource.

For example, given the manifest below.

apiVersion: v1
kind: Service
metadata:
  name: argocd-server
  annotations:
    sigs.k8s.io/kustomize/mixin: |
      ---
      #! kustomization.yaml
      vars:
      - name: ARGOCD_NAMESPACE
        objref:
          apiVersion: v1
          kind: Namespace
          name: argocd
      ---
      #! kustomizeconfig.yaml
      varReference:
      - kind: Service
        path: metadata/annotations/getambassador.io\/config
    getambassador.io/config: |
      ---
      apiVersion: ambassador/v1
      kind:  Mapping
      name:  argocd_server_mapping
      grpc: True
      prefix: /argocd/
      rewrite: /argocd/
      service: argocd-server.$(ARGOCD_NAMESPACE)
      timeout_ms: 60000

The content of annotation sigs.k8s.io/kustomize/mixin shall be parsed and mixed into kustomization.yaml on the fly.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 3, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 2, 2019
@yujunz yujunz closed this as completed Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

3 participants