Skip to content

cmd/k8s-operator: add Connector CRD to Helm chart and static manifests - #10775

Merged
irbekrm merged 2 commits into
mainfrom
irbekrm/chart_crd
Jan 10, 2024
Merged

irbekrm merged 2 commits into
mainfrom
irbekrm/chart_crd

Conversation

@irbekrm

@irbekrm irbekrm commented Jan 8, 2024 •

Copy link
Copy Markdown
Contributor

See #10641 for context.

This PR is the first part of the work of to ensure that users can install the Kubernetes operator and the CRD with a single command (either if using Helm or static manifests).

Changes:

  • adds functionality to allow inserting CRD into Helm templates at build time
  • adds a new Helm chart value .installCRDs to allow users to optionally not install the CRD
helm install operator tailscale/tailscale-operator ... // install with CRD
helm install operator tailscale/tailscale-operator --set installCRDs=false // install without CRD
  • ensures that static manifest generator that currently generates static manifest from chart templates uses chart templates that include the CRD

Notes

Having the CRD duplicated in ./cmd/k8s-operator/deploy/crds and ./cmd/k8s-operator/deploy/manifests/operator.yaml is suboptimal. Long term we should look at deprecating ./cmd/k8s-operator/deploy/manifests/operator.yaml and instead publishing a versioned static manifest either to Github releases of this repo or packages server.

Next steps after this PR merges:

  • update our build infra to run this functionality at chart build time, see tailscale/corp#16652 (private link)
  • remove the configuration knob for Connector functionality and have it on by default

@irbekrm
irbekrm marked this pull request as draft January 8, 2024 10:55
@irbekrm
irbekrm force-pushed the irbekrm/chart_crd branch 4 times, most recently from 5b4629b to 4193cde Compare January 9, 2024 12:13
@irbekrm
irbekrm marked this pull request as ready for review January 9, 2024 12:22
@irbekrm
irbekrm requested a review from knyar January 9, 2024 12:22
@irbekrm
irbekrm force-pushed the irbekrm/chart_crd branch 2 times, most recently from 41e1f5f to 6c108de Compare January 9, 2024 17:25

//go:build !plan9 && !windows

package crdsforhelm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd probably still need a main to call this from corp, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knyar this was getting too complicated for the simple task. I have restructured the whole of this to both add the CRD to the chart and add the CRD to the static manifest by adding a bit more to the existing ./cmd/k8s-operator/generate which we can then also call from build infra.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you want to give it another approve since this is now very different contents. I've closed the other PR.

Add functionality to insert CRD to chart at package time.
Insert CRD to static manifests as this is where they are currently consumed from.

Updates #10641

Signed-off-by: Irbe Krumina <[email protected]>
@irbekrm
irbekrm force-pushed the irbekrm/chart_crd branch 2 times, most recently from 3b352e9 to 0e4581a Compare January 9, 2024 18:13
@irbekrm
irbekrm force-pushed the irbekrm/chart_crd branch from 0e4581a to d5a114c Compare January 9, 2024 18:45
@irbekrm irbekrm changed the title cmd/k8s-operator/crdsforhelm,cmd/k8s-operator/values.yaml: allow adding CRD to Helm templates cmd/k8s-operator/crdsforhelm,cmd/k8s-operator/values.yaml: add CRD to Helm chart and static manifests Jan 9, 2024
@irbekrm irbekrm changed the title cmd/k8s-operator/crdsforhelm,cmd/k8s-operator/values.yaml: add CRD to Helm chart and static manifests cmd/k8s-operator: add Connector CRD to Helm chart and static manifests Jan 9, 2024
@irbekrm
irbekrm merged commit 35f49ac into main Jan 10, 2024
@irbekrm
irbekrm deleted the irbekrm/chart_crd branch January 10, 2024 14:20
kari-ts pushed a commit that referenced this pull request Jan 12, 2024
#10775)

cmd/k8s-operator: add CRD to chart and static manifest

Add functionality to insert CRD to chart at package time.
Insert CRD to static manifests as this is where they are currently consumed from.

Signed-off-by: Irbe Krumina <[email protected]>
Asutorufa pushed a commit to Asutorufa/tailscale that referenced this pull request Jan 19, 2024
tailscale#10775)

cmd/k8s-operator: add CRD to chart and static manifest

Add functionality to insert CRD to chart at package time.
Insert CRD to static manifests as this is where they are currently consumed from.

Signed-off-by: Irbe Krumina <[email protected]>
chen8945 pushed a commit to Ckid-Home/tailscale that referenced this pull request Jul 31, 2024
tailscale#10775)

cmd/k8s-operator: add CRD to chart and static manifest

Add functionality to insert CRD to chart at package time.
Insert CRD to static manifests as this is where they are currently consumed from.

Signed-off-by: Irbe Krumina <[email protected]>
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