Skip to content

Fix teleport-cluster chart service account logic causing ArgoCD deployments to fail#49066

Merged
hugoShaka merged 2 commits intomasterfrom
hugo/fix-helm-chart-argo
Nov 15, 2024
Merged

Fix teleport-cluster chart service account logic causing ArgoCD deployments to fail#49066
hugoShaka merged 2 commits intomasterfrom
hugo/fix-helm-chart-argo

Conversation

@hugoShaka
Copy link
Copy Markdown
Contributor

Fixes: #48976

This PR's logic is a bit tricky because:

  • we want to not break users who are using serviceAccount.create: false (so we can't introduce new SAs for them)
  • we must introduce new SAs for users with serviceAccount.create: true because Argo's hook implementation differs from the Helm one and we can't have nice things.

This PR also ensure the hook SAs are not created when the user sets validateConfigOnDeploy: false.

Changelog: Fix a bug in the teleport-cluster Helm chart that can cause token mount to fail when using ArgoCD.
Changelog: Fix a bug in the teleport-cluster Helm chart that caused hook service accounts to get deployed even when validateConfigOnDeploy was false.

@aws-amplify-us-west-2
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-49066.d3pp5qlev8mo18.amplifyapp.com

@hugoShaka hugoShaka changed the title Hugo/fix helm chart argo Fix teleport-cluster chart service account logic causing ArgoCD deployments to fail Nov 15, 2024
@hugoShaka hugoShaka requested a review from r0mant November 15, 2024 16:37
@hugoShaka hugoShaka enabled auto-merge November 15, 2024 16:43
Copy link
Copy Markdown
Contributor

@webvictim webvictim left a comment

Choose a reason for hiding this comment

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

LGTM

Create the name of the service account to use in the auth config check hook.

If the chart is creating service accounts, we know we can create new arbitrary service accounts.
We cannot reuse the same name as the deployment SA because the non-hook sevrice account might
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.

Suggested change
We cannot reuse the same name as the deployment SA because the non-hook sevrice account might
We cannot reuse the same name as the deployment SA because the non-hook service account might

Create the name of the service account to use in the proxy config check hook.

If the chart is creating service accounts, we know we can create new arbitrary service accounts.
We cannot reuse the same name as the deployment SA because the non-hook sevrice account might
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.

Suggested change
We cannot reuse the same name as the deployment SA because the non-hook sevrice account might
We cannot reuse the same name as the deployment SA because the non-hook service account might

value: helm-test-sa-hook

- it: should use serviceAccount.name for auth predeploy job SA when set in values
- it: should use serviceAccount.name for auth predeploy job SA when set in values and we're not cretaing SAs
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.

Suggested change
- it: should use serviceAccount.name for auth predeploy job SA when set in values and we're not cretaing SAs
- it: should use serviceAccount.name for auth predeploy job SA when set in values and we're not creating SAs

value: helm-test-sa-proxy-hook

- it: should use serviceAccount.name for proxy predeploy job SA when set in values
- it: should use serviceAccount.name for proxy predeploy job SA when set in values and we're not cretaing SAs
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.

Suggested change
- it: should use serviceAccount.name for proxy predeploy job SA when set in values and we're not cretaing SAs
- it: should use serviceAccount.name for proxy predeploy job SA when set in values and we're not creating SAs

{{- include "teleport-cluster.auth.serviceAccountName" . -}}
{{- if .Values.serviceAccount.create -}}
-hook
{{- end}}
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.

Suggested change
{{- end}}
{{- end }}

Just for consistency with all other usage.

{{- include "teleport-cluster.proxy.serviceAccountName" . -}}
{{- if .Values.serviceAccount.create -}}
-hook
{{- end}}
Copy link
Copy Markdown
Contributor

@webvictim webvictim Nov 15, 2024

Choose a reason for hiding this comment

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

Suggested change
{{- end}}
{{- end }}

Just for consistency with all other usage.

@hugoShaka hugoShaka added this pull request to the merge queue Nov 15, 2024
Merged via the queue into master with commit da30765 Nov 15, 2024
@hugoShaka hugoShaka deleted the hugo/fix-helm-chart-argo branch November 15, 2024 17:02
@public-teleport-github-review-bot
Copy link
Copy Markdown

@hugoShaka See the table below for backport results.

Branch Result
branch/v14 Create PR
branch/v15 Create PR
branch/v16 Create PR
branch/v17 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

teleport-cluster Helm chart fails to mount proxy tokens when deployed with ArgoCD

3 participants