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 kustomize migration path #54

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michaellzc
Copy link
Member

@michaellzc michaellzc commented Mar 1, 2022

This migration guide is nowhere near ready

Known Limitation

All deploy and sts has to be recreated.

In helm, we introduced two new labels to all deploy and sts at .spec.selector.matchLabels and .spec.template.metadata.labels

selector:
matchLabels:
{{- include "sourcegraph.selectorLabels" . | nindent 6 }}
app: sourcegraph-frontend

https://github.com/sourcegraph/deploy-sourcegraph/blob/f629296cddc1ec84cb31b95e7c874160d05b6bc5/base/frontend/sourcegraph-frontend.Deployment.yaml#L16-L18

app.kubernetes.io/name: {{ include "sourcegraph.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

Pod annotations are mutable but deploy's label selector is immutable

Unable to use kubeclt diff to easily "diff" renderer manifest and cluster state

The same deal. It just errored out and complained label selector is immutable.

helm template -n sourcegraph -f override.yaml sourcegraph charts/sourcegraph/ | kubectl diff -f -

Alternative

  • Deploy a fresh deployment with helm and attach previously deployed PV? (still, it'll cause some downtime)
  • Remove the added label? I know they're good conventions and can be used to run multiple releases of the same chart under the same namespace. However, we're not namespacing (not k8s namespace, but prefixing resources name with the helm release name) resources in the chart.
  • We should also take into consideration that not all users (or maybe most?) won't be using helm to managed deployment lifecycle, instead they will just take the rendered manifest and plug back into their own pipeline.

close https://github.com/sourcegraph/sourcegraph/issues/31967

@michaellzc
Copy link
Member Author

michaellzc commented Mar 1, 2022

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@michaellzc michaellzc force-pushed the 02-28-Add_kustomize_migration_path branch from f968baf to 050da99 Compare March 1, 2022 02:58
@michaellzc michaellzc force-pushed the 02-25-Revamp_config_docs_with_helm-docs branch from 3929944 to bdddee6 Compare March 1, 2022 05:38
@michaellzc michaellzc force-pushed the 02-28-Add_kustomize_migration_path branch from 050da99 to 3382905 Compare March 1, 2022 05:38
@michaellzc michaellzc force-pushed the 02-25-Revamp_config_docs_with_helm-docs branch from bdddee6 to 26210d7 Compare March 1, 2022 21:32
@michaellzc michaellzc force-pushed the 02-28-Add_kustomize_migration_path branch from 3382905 to b511baf Compare March 1, 2022 21:32
@michaellzc michaellzc force-pushed the 02-25-Revamp_config_docs_with_helm-docs branch from 26210d7 to 1366f4b Compare March 1, 2022 21:55
@michaellzc michaellzc force-pushed the 02-28-Add_kustomize_migration_path branch from b511baf to e1fc8f6 Compare March 1, 2022 21:55
@michaellzc michaellzc force-pushed the 02-25-Revamp_config_docs_with_helm-docs branch from 1366f4b to 09f629a Compare March 1, 2022 22:05
@michaellzc michaellzc force-pushed the 02-28-Add_kustomize_migration_path branch from e1fc8f6 to 7cfe18c Compare March 1, 2022 22:05
Base automatically changed from 02-25-Revamp_config_docs_with_helm-docs to main March 2, 2022 20:30
@michaellzc michaellzc force-pushed the 02-28-Add_kustomize_migration_path branch from 7cfe18c to a427709 Compare March 3, 2022 23:26
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.

Kubernetes to Helm migration path
1 participant