-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Deploy split proxy/auth with helm chart #18857
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e3eb1ca
helm: split auth and proxy, templates
hugoShaka 95c4da0
helm: split auth and proxy, lint files
hugoShaka e54d2ad
helm: split auth and proxy, tests
hugoShaka 0e848f5
Apply suggestions from code review
hugoShaka 9c67245
Allow standalone auth to run with multiple auth pods. Suport AWs lb c…
hugoShaka 8f847bf
Treat gus' feedback + avoid auth servicename overflow
hugoShaka 5e49dd6
Fix webauthn templating, scratch proxy config + marco's feedback
hugoShaka ec07530
helm: add PodMonitor support (#19291)
hugoShaka 3ec9f8f
helm: add job validating configuration on deploy (#19333)
hugoShaka b2962e3
helm: use a deployment instead of a statefulset for auth + fix podmon…
hugoShaka 4edfcdd
helm: warn that multiplexing requires TLS termination
hugoShaka dfe4a53
helm: fix regression with predeploy job and gcp credentials
hugoShaka 49157b0
fixup! helm: use a deployment instead of a statefulset for auth + fix…
hugoShaka 1f3ef01
helm: explicit update strategy + add documentation links
hugoShaka db5aa60
Merge branch 'master' into hugo/chart-split-proxy-auth
hugoShaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
examples/chart/teleport-cluster/.lint/custom-existingpvc.yaml
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
examples/chart/teleport-cluster/.lint/example-minimal-standalone.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # This setup is not safe for production because the proxy will self-sign its certificate. | ||
| # Use those values for testing only | ||
|
|
||
| # The chart should deploy and work only with a clusterName. | ||
| # This setup can also cause redirection issues if the proxy is contacted with a hostName instead of an IP address | ||
| # as it is not aware of its external hostname and will attempt to perform a redirection. | ||
| clusterName: helm-lint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
examples/chart/teleport-cluster/.lint/proxy-listener-mode-separate.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| clusterName: test-proxy-listener-mode | ||
| proxyListenerMode: separate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
examples/chart/teleport-cluster/templates/auth/_config.aws.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| {{- define "teleport-cluster.auth.config.aws" -}} | ||
| {{ include "teleport-cluster.auth.config.common" . }} | ||
| storage: | ||
| type: dynamodb | ||
| region: {{ required "aws.region is required in chart values" .Values.aws.region }} | ||
| table_name: {{ required "aws.backendTable is required in chart values" .Values.aws.backendTable }} | ||
| {{- if .Values.aws.auditLogMirrorOnStdout }} | ||
| audit_events_uri: ['dynamodb://{{ required "aws.auditLogTable is required in chart values" .Values.aws.auditLogTable }}', 'stdout://'] | ||
| {{- else }} | ||
| audit_events_uri: ['dynamodb://{{ required "aws.auditLogTable is required in chart values" .Values.aws.auditLogTable }}'] | ||
| {{- end }} | ||
| audit_sessions_uri: s3://{{ required "aws.sessionRecordingBucket is required in chart values" .Values.aws.sessionRecordingBucket }} | ||
| continuous_backups: {{ required "aws.backups is required in chart values" .Values.aws.backups }} | ||
| {{- if .Values.aws.dynamoAutoScaling }} | ||
| auto_scaling: true | ||
| read_min_capacity: {{ required "aws.readMinCapacity is required when aws.dynamoAutoScaling is true" .Values.aws.readMinCapacity }} | ||
| read_max_capacity: {{ required "aws.readMaxCapacity is required when aws.dynamoAutoScaling is true" .Values.aws.readMaxCapacity }} | ||
| read_target_value: {{ required "aws.readTargetValue is required when aws.dynamoAutoScaling is true" .Values.aws.readTargetValue }} | ||
| write_min_capacity: {{ required "aws.writeMinCapacity is required when aws.dynamoAutoScaling is true" .Values.aws.writeMinCapacity }} | ||
| write_max_capacity: {{ required "aws.writeMaxCapacity is required when aws.dynamoAutoScaling is true" .Values.aws.writeMaxCapacity }} | ||
| write_target_value: {{ required "aws.writeTargetValue is required when aws.dynamoAutoScaling is true" .Values.aws.writeTargetValue }} | ||
| {{- else }} | ||
| auto_scaling: false | ||
| {{- end }} | ||
| {{- end -}} |
64 changes: 64 additions & 0 deletions
64
examples/chart/teleport-cluster/templates/auth/_config.common.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| {{- define "teleport-cluster.auth.config.common" -}} | ||
| {{- $authentication := mustMergeOverwrite .Values.authentication (default dict .Values.authenticationSecondFactor) -}} | ||
| {{- $logLevel := (coalesce .Values.logLevel .Values.log.level "INFO") -}} | ||
| version: v3 | ||
| kubernetes_service: | ||
| enabled: true | ||
| listen_addr: 0.0.0.0:3026 | ||
| public_addr: "{{ include "teleport-cluster.auth.serviceFQDN" . }}:3026" | ||
| {{- if .Values.kubeClusterName }} | ||
| kube_cluster_name: {{ .Values.kubeClusterName }} | ||
| {{- else }} | ||
| kube_cluster_name: {{ .Values.clusterName }} | ||
| {{- end }} | ||
| {{- if .Values.labels }} | ||
| labels: {{- toYaml .Values.labels | nindent 8 }} | ||
| {{- end }} | ||
| proxy_service: | ||
| enabled: false | ||
| ssh_service: | ||
| enabled: false | ||
| auth_service: | ||
| enabled: true | ||
| cluster_name: {{ required "clusterName is required in chart values" .Values.clusterName }} | ||
| {{- if .Values.enterprise }} | ||
| license_file: '/var/lib/license/license.pem' | ||
| {{- end }} | ||
| authentication: | ||
| type: "{{ required "authentication.type is required in chart values" (coalesce .Values.authenticationType $authentication.type) }}" | ||
| local_auth: {{ $authentication.localAuth }} | ||
| {{- if $authentication.connectorName }} | ||
| connector_name: "{{ $authentication.connectorName }}" | ||
| {{- end }} | ||
| {{- if $authentication.lockingMode }} | ||
| locking_mode: "{{ $authentication.lockingMode }}" | ||
| {{- end }} | ||
| {{- if $authentication.secondFactor }} | ||
| second_factor: "{{ $authentication.secondFactor }}" | ||
| {{- if not (or (eq $authentication.secondFactor "off") (eq $authentication.secondFactor "otp")) }} | ||
| webauthn: | ||
| rp_id: {{ required "clusterName is required in chart values" .Values.clusterName }} | ||
| {{- if $authentication.webauthn }} | ||
| {{- if $authentication.webauthn.attestationAllowedCas }} | ||
| attestation_allowed_cas: {{- toYaml $authentication.webauthn.attestationAllowedCas | nindent 12 }} | ||
| {{- end }} | ||
| {{- if $authentication.webauthn.attestationDeniedCas }} | ||
| attestation_denied_cas: {{- toYaml $authentication.webauthn.attestationDeniedCas | nindent 12 }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- if .Values.sessionRecording }} | ||
| session_recording: {{ .Values.sessionRecording }} | ||
| {{- end }} | ||
| {{- if .Values.proxyListenerMode }} | ||
| proxy_listener_mode: {{ .Values.proxyListenerMode }} | ||
| {{- end }} | ||
| teleport: | ||
| log: | ||
| severity: {{ $logLevel }} | ||
| output: {{ .Values.log.output }} | ||
| format: | ||
| output: {{ .Values.log.format }} | ||
| extra_fields: {{ .Values.log.extraFields | toJson }} | ||
| {{- end -}} | ||
16 changes: 16 additions & 0 deletions
16
examples/chart/teleport-cluster/templates/auth/_config.gcp.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| {{- define "teleport-cluster.auth.config.gcp" -}} | ||
| {{ include "teleport-cluster.auth.config.common" . }} | ||
| storage: | ||
| type: firestore | ||
| project_id: {{ required "gcp.projectId is required in chart values" .Values.gcp.projectId }} | ||
| collection_name: {{ required "gcp.backendTable is required in chart values" .Values.gcp.backendTable }} | ||
| {{- if .Values.gcp.credentialSecretName }} | ||
| credentials_path: /etc/teleport-secrets/gcp-credentials.json | ||
| {{- end }} | ||
| {{- if .Values.gcp.auditLogMirrorOnStdout }} | ||
| audit_events_uri: ['firestore://{{ required "gcp.auditLogTable is required in chart values" .Values.gcp.auditLogTable }}?projectID={{ required "gcp.projectId is required in chart values" .Values.gcp.projectId }}{{ empty .Values.gcp.credentialSecretName | ternary "" "&credentialsPath=/etc/teleport-secrets/gcp-credentials.json"}}', 'stdout://'] | ||
| {{- else }} | ||
| audit_events_uri: ['firestore://{{ required "gcp.auditLogTable is required in chart values" .Values.gcp.auditLogTable }}?projectID={{ required "gcp.projectId is required in chart values" .Values.gcp.projectId }}{{ empty .Values.gcp.credentialSecretName | ternary "" "&credentialsPath=/etc/teleport-secrets/gcp-credentials.json"}}'] | ||
| {{- end }} | ||
| audit_sessions_uri: "gs://{{ required "gcp.sessionRecordingBucket is required in chart values" .Values.gcp.sessionRecordingBucket }}?projectID={{ required "gcp.projectId is required in chart values" .Values.gcp.projectId }}{{ empty .Values.gcp.credentialSecretName | ternary "" "&credentialsPath=/etc/teleport-secrets/gcp-credentials.json"}}" | ||
| {{- end -}} |
13 changes: 13 additions & 0 deletions
13
examples/chart/teleport-cluster/templates/auth/_config.scratch.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| {{- define "teleport-cluster.auth.config.scratch" -}} | ||
| {{- required "'auth.teleportConfig' is required in scratch mode" .Values.auth.teleportConfig }} | ||
| proxy_service: | ||
| enabled: false | ||
| ssh_service: | ||
| enabled: false | ||
| auth_service: | ||
| enabled: true | ||
| {{- end -}} | ||
|
|
||
| {{- define "teleport-cluster.auth.config.custom" -}} | ||
| {{ fail "'custom' mode has been removed with chart v12 because of the proxy/auth split breaking change, see https://goteleport.com/docs/deploy-a-cluster/helm-deployments/migration-v12/" }} | ||
| {{- end -}} |
3 changes: 3 additions & 0 deletions
3
examples/chart/teleport-cluster/templates/auth/_config.standalone.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| {{- define "teleport-cluster.auth.config.standalone" -}} | ||
| {{ include "teleport-cluster.auth.config.common" . }} | ||
| {{- end -}} |
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
examples/chart/teleport-cluster/templates/auth/clusterrolebinding.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| {{- if .Values.rbac.create -}} | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: {{ .Release.Name }} | ||
| labels: {{- include "teleport-cluster.auth.labels" . | nindent 4 }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: {{ .Release.Name }} | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ include "teleport-cluster.auth.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| --- | ||
| # This ClusterRoleBinding allows the auth service-account to validate Kubernetes tokens | ||
| # This is required for proxies to join using their Kubernetes tokens | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: {{ .Release.Name }}-auth | ||
| labels: {{- include "teleport-cluster.auth.labels" . | nindent 4 }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: system:auth-delegator | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ include "teleport-cluster.auth.serviceAccountName" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| {{- end }} |
28 changes: 28 additions & 0 deletions
28
examples/chart/teleport-cluster/templates/auth/config.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| {{- $auth := mustMergeOverwrite .Values .Values.auth -}} | ||
| {{- $configTemplate := printf "teleport-cluster.auth.config.%s" $auth.chartMode -}} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ .Release.Name }}-auth | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: {{- include "teleport-cluster.auth.labels" . | nindent 4 }} | ||
| {{- if $auth.annotations.config }} | ||
| annotations: {{- toYaml $auth.annotations.config | nindent 4 }} | ||
| {{- end }} | ||
| data: | ||
| {{- if $auth.createProxyToken }} | ||
| apply-on-startup.yaml: |2 | ||
| kind: token | ||
| version: v2 | ||
| metadata: | ||
| name: {{ .Release.Name }}-proxy | ||
| expires: "3000-01-01T00:00:00Z" | ||
| spec: | ||
| roles: [Proxy] | ||
| join_method: kubernetes | ||
| kubernetes: | ||
| allow: | ||
| - service_account: "{{ .Release.Namespace }}:{{ include "teleport-cluster.proxy.serviceAccountName" . }}" | ||
| {{- end }} | ||
| teleport.yaml: |2 | ||
| {{- mustMergeOverwrite (include $configTemplate . | fromYaml) $auth.teleportConfig | toYaml | nindent 4 -}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.