Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
81fe141
helm: Make chart versions match Teleport version
webvictim Apr 6, 2021
a9de3eb
helm: Update teleport-cluster README
webvictim Apr 7, 2021
d0a41e3
helm: Add 'aws', 'gcp' and 'standalone' modes, overhaul HA
webvictim Apr 7, 2021
a55f058
helm: Fix linter complaints for older charts and bump versions
webvictim Apr 7, 2021
e8eb2bc
helm: Rename values files used for linting
webvictim Apr 7, 2021
35c887b
helm: Fix podAntiAffinity
webvictim Apr 7, 2021
03ffb5f
helm: Add projectID and credentialsPath to Firestore/GS URLs
webvictim Apr 7, 2021
4946f33
helm: Only enable ACME for single-instance clusters
webvictim Apr 7, 2021
8c0f2a8
helm: Add trailing line break
webvictim Apr 7, 2021
6249f88
helm: Update license path to match the path downloaded from Houston d…
webvictim Apr 8, 2021
f290094
helm: Add instructions for creating license secret
webvictim Apr 8, 2021
8147c70
helm: Automatically update chart versions when publishing new Telepor…
webvictim Apr 8, 2021
eca03b2
helm: Mark older charts as deprecated
webvictim Apr 8, 2021
762a38e
helm: teleport-cluster: Add support for annotations, extraVolumes etc
webvictim Apr 20, 2021
ef0762d
helm: teleport-kube-agent: Add support for annotations, extraVolumes etc
webvictim Apr 20, 2021
b3042c3
helm: teleport-cluster: Add JSON schema
webvictim Apr 20, 2021
ff2da02
helm: teleport-kube-agent: Add JSON schema
webvictim Apr 20, 2021
effaaff
helm: add support for getting certificates in HA deployments using ce…
webvictim Apr 22, 2021
c26f55b
helm: Allow adding annotations to ServiceAccount
webvictim Apr 29, 2021
1c4b5c5
Fix PR comments
webvictim Apr 30, 2021
023f752
helm: Rename 'ownconfig' mode to 'custom' mode
webvictim Apr 30, 2021
6116c72
helm: Simplify checks and disable HA in standalone mode
webvictim May 6, 2021
c7ab016
helm: Add support for setting affinity and tolerations
webvictim May 6, 2021
ff9e589
helm: Add support for setting affinity and tolerations to teleport-ku…
webvictim May 6, 2021
bd73c92
Merge branch 'master' into gus/helm/improvements-2
webvictim May 14, 2021
d02a7da
Update examples/chart/teleport-cluster/templates/deployment.yaml
webvictim May 14, 2021
cff07ff
Merge branch 'master' into gus/helm/improvements-2
webvictim May 15, 2021
590336b
helm: Remove superfluous bracket
webvictim May 17, 2021
f64f6af
Merge branch 'master' into gus/helm/improvements-2
webvictim May 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,9 @@ lint-sh:

# Lints all the Helm charts found in directories under examples/chart and exits on failure
# If there is a .lint directory inside, the chart gets linted once for each .yaml file in that directory
# We use yamllint's 'relaxed' configuration as it's more compatible with Helm output and will only error on
# We inherit yamllint's 'relaxed' configuration as it's more compatible with Helm output and will only error on
# show-stopping issues. Kubernetes' YAML parser is not particularly fussy.
# If errors are found, the file is printed with line numbers to aid in debugging.
.PHONY: lint-helm
lint-helm:
@if ! type yamllint 2>&1 >/dev/null; then \
Expand All @@ -373,16 +374,21 @@ lint-helm:
exit 0; \
fi; \
for CHART in $$(find examples/chart -mindepth 1 -maxdepth 1 -type d); do \
if [ -d $$CHART/.lint ]; then \
for VALUES in $$CHART/.lint/*.yaml; do \
echo "$$CHART: $$VALUES"; \
helm lint --strict $$CHART -f $$VALUES || exit 1; \
helm template test $$CHART -f $$VALUES | yamllint -d relaxed - || exit 1; \
if [ -d $${CHART}/.lint ]; then \
for VALUES in $${CHART}/.lint/*.yaml; do \
export HELM_TEMP=$$(mktemp); \
echo -n "Using values from '$${VALUES}': "; \
yamllint -c examples/chart/.lint-config.yaml $${VALUES} || { cat -En $${VALUES}; exit 1; }; \
helm lint --strict $${CHART} -f $${VALUES} || exit 1; \
helm template test $${CHART} -f $${VALUES} 1>$${HELM_TEMP} || exit 1; \
yamllint -c examples/chart/.lint-config.yaml $${HELM_TEMP} || { cat -En $${HELM_TEMP}; exit 1; }; \
Comment thread
webvictim marked this conversation as resolved.
done \
else \
helm lint --strict $$CHART || exit 1; \
helm template test $$CHART 1>/dev/null || exit 1; \
fi \
export HELM_TEMP=$$(mktemp); \
helm lint --strict $${CHART} || exit 1; \
helm template test $${CHART} 1>$${HELM_TEMP} || exit 1; \
yamllint -c examples/chart/.lint-config.yaml $${HELM_TEMP} || { cat -En $${HELM_TEMP}; exit 1; }; \
Comment thread
webvictim marked this conversation as resolved.
fi; \
done

# This rule triggers re-generation of version.go and gitref.go if Makefile changes
Expand Down
4 changes: 4 additions & 0 deletions examples/chart/.lint-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends: relaxed
rules:
line-length:
max: 120
5 changes: 3 additions & 2 deletions examples/chart/teleport-auto-trustedcluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: teleport-auto-trustedcluster
apiVersion: v2
version: 0.0.8
version: 0.0.9
appVersion: "6"
description: Teleport trusted cluster installation which automatically joins itself back to the provided root cluster.
description: "[deprecated] Teleport trusted cluster installation which automatically joins itself back to the provided root cluster."
Comment thread
webvictim marked this conversation as resolved.
icon: https://goteleport.com/images/logos/logo-teleport-square.svg
keywords:
- Teleport Enterprise
deprecated: true
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ spec:
type: {{ .Values.service.type }}
ports:
{{- range $key, $value := .Values.service.ports }}
- name: {{ $key }}
{{ toYaml $value | indent 6 }}
- name: {{ $key }}
{{ toYaml $value | indent 4 }}
{{- end }}
{{- if and (semverCompare ">=1.7-0" .Capabilities.KubeVersion.GitVersion) (.Values.service.externalTrafficPolicy) }}
externalTrafficPolicy: "{{ .Values.service.externalTrafficPolicy }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
clusterName: test-cluster-name
extraArgs:
- "--insecure"
3 changes: 3 additions & 0 deletions examples/chart/teleport-cluster/.lint/acme-on.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
clusterName: test-acme-cluster
acme: true
acmeEmail: test@email.com
29 changes: 29 additions & 0 deletions examples/chart/teleport-cluster/.lint/affinity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
clusterName: test-gcp-cluster
chartMode: gcp
gcp:
projectId: gcpproj-123456
backendTable: test-teleport-firestore-storage-collection
auditLogTable: test-teleport-firestore-auditlog-collection
sessionRecordingBucket: test-gcp-session-storage-bucket
highAvailability:
replicaCount: 2
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gravitational.io/dedicated
operator: In
values:
- teleport
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- teleport
topologyKey: kubernetes.io/hostname
weight: 1
17 changes: 17 additions & 0 deletions examples/chart/teleport-cluster/.lint/annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
clusterName: helm-lint
annotations:
config:
kubernetes.io/config: "test-annotation"
kubernetes.io/config-different: 2
deployment:
kubernetes.io/deployment: "test-annotation"
kubernetes.io/deployment-different: 3
pod:
kubernetes.io/pod: "test-annotation"
kubernetes.io/pod-different: 4
service:
kubernetes.io/service: "test-annotation"
kubernetes.io/service-different: 5
serviceAccount:
kubernetes.io/serviceaccount: "test-annotation"
kubernetes.io/serviceaccount-different: 6
14 changes: 14 additions & 0 deletions examples/chart/teleport-cluster/.lint/aws-ha-acme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
clusterName: test-aws-cluster
chartMode: aws
aws:
region: us-west-2
backendTable: test-dynamodb-backend-table
auditLogTable: test-dynamodb-auditlog-table
sessionRecordingBucket: test-s3-session-storage-bucket
highAvailability:
replicaCount: 3
certManager:
enabled: true
issuerName: letsencrypt-production
labels:
env: aws
12 changes: 12 additions & 0 deletions examples/chart/teleport-cluster/.lint/aws-ha-antiaffinity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
clusterName: test-aws-cluster
chartMode: aws
aws:
region: us-west-2
backendTable: test-dynamodb-backend-table
auditLogTable: test-dynamodb-auditlog-table
sessionRecordingBucket: test-s3-session-storage-bucket
highAvailability:
replicaCount: 3
requireAntiAffinity: true
labels:
env: aws
11 changes: 11 additions & 0 deletions examples/chart/teleport-cluster/.lint/aws-ha.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clusterName: test-aws-cluster
chartMode: aws
aws:
region: us-west-2
backendTable: test-dynamodb-backend-table
auditLogTable: test-dynamodb-auditlog-table
sessionRecordingBucket: test-s3-session-storage-bucket
highAvailability:
replicaCount: 3
labels:
env: aws
11 changes: 11 additions & 0 deletions examples/chart/teleport-cluster/.lint/aws.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clusterName: test-aws-cluster
chartMode: aws
aws:
region: us-west-2
backendTable: test-dynamodb-backend-table
auditLogTable: test-dynamodb-auditlog-table
sessionRecordingBucket: test-s3-session-storage-bucket
acme: true
acmeEmail: test@email.com
labels:
env: aws
14 changes: 14 additions & 0 deletions examples/chart/teleport-cluster/.lint/gcp-ha-acme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
clusterName: test-gcp-cluster
chartMode: gcp
gcp:
projectId: gcpproj-123456
backendTable: test-teleport-firestore-storage-collection
auditLogTable: test-teleport-firestore-auditlog-collection
sessionRecordingBucket: test-gcp-session-storage-bucket
highAvailability:
replicaCount: 3
certManager:
enabled: true
issuerName: letsencrypt-production
labels:
env: gcp
12 changes: 12 additions & 0 deletions examples/chart/teleport-cluster/.lint/gcp-ha-antiaffinity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
clusterName: test-gcp-cluster
chartMode: gcp
gcp:
projectId: gcpproj-123456
backendTable: test-teleport-firestore-storage-collection
auditLogTable: test-teleport-firestore-auditlog-collection
sessionRecordingBucket: test-gcp-session-storage-bucket
highAvailability:
replicaCount: 3
requireAntiAffinity: true
labels:
env: gcp
11 changes: 11 additions & 0 deletions examples/chart/teleport-cluster/.lint/gcp-ha.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clusterName: test-gcp-cluster
chartMode: gcp
gcp:
projectId: gcpproj-123456
backendTable: test-teleport-firestore-storage-collection
auditLogTable: test-teleport-firestore-auditlog-collection
sessionRecordingBucket: test-gcp-session-storage-bucket
highAvailability:
replicaCount: 3
labels:
env: gcp
11 changes: 11 additions & 0 deletions examples/chart/teleport-cluster/.lint/gcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clusterName: test-gcp-cluster
chartMode: gcp
gcp:
projectId: gcpproj-123456
backendTable: test-teleport-firestore-storage-collection
auditLogTable: test-teleport-firestore-auditlog-collection
sessionRecordingBucket: test-gcp-session-storage-bucket
acme: true
acmeEmail: test@email.com
labels:
env: gcp
5 changes: 5 additions & 0 deletions examples/chart/teleport-cluster/.lint/initcontainers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
clusterName: helm-lint
Comment thread
webvictim marked this conversation as resolved.
initContainers:
- name: "teleport-init"
image: "alpine"
args: ["echo test"]
10 changes: 10 additions & 0 deletions examples/chart/teleport-cluster/.lint/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
clusterName: helm-lint
# These are just sample values to test the chart.
# They are not intended to be guidelines or suggestions for running teleport.
resources:
limits:
cpu: 2
memory: 4Gi
requests:
cpu: 1
memory: 2Gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
clusterName: test-standalone-cluster
chartMode: standalone
standalone:
existingClaimName: teleport-storage
acme: true
acmeEmail: test@email.com
labels:
env: standalone
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
clusterName: test-standalone-cluster
chartMode: standalone
standalone:
volumeSize: 50Gi
acme: true
acmeEmail: test@email.com
labels:
env: standalone
18 changes: 18 additions & 0 deletions examples/chart/teleport-cluster/.lint/tolerations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
clusterName: test-aws-cluster
chartMode: aws
aws:
region: us-west-2
backendTable: test-dynamodb-backend-table
auditLogTable: test-dynamodb-auditlog-table
sessionRecordingBucket: test-s3-session-storage-bucket
highAvailability:
replicaCount: 3
tolerations:
- key: "dedicated"
operator: "Equal"
value: "teleport"
effect: "NoExecute"
- key: "dedicated"
operator: "Equal"
value: "teleport"
effect: "NoSchedule"
8 changes: 8 additions & 0 deletions examples/chart/teleport-cluster/.lint/volumes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
clusterName: helm-lint
extraVolumeMounts:
- name: "my-mount"
path: "/path/to/mount"
extraVolumes:
- name: "my-mount"
secret:
secretName: "mySecret"
2 changes: 1 addition & 1 deletion examples/chart/teleport-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: teleport-cluster
apiVersion: v2
version: 6.0.0
version: "6"
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.

oh, we're using only the major version?
so any changes to the chart can only happen during major releases?

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.

Hmm, that's not the intention.

When VERSION is set to a proper version like 7.0.1, the charts' version and appVersion will automatically be set to "7.0.1" as well - we'll bump the Helm chart versions along with every Teleport release we make, and we'll also bump the Teleport release number up when we make Helm chart changes.

The "6" here was intended as a special case for when VERSION has a -dev suffix (as it does on master). We should really be setting it to 7.0.0, but we can't because the quay.io/gravitational/teleport:7.0.0 Docker tag won't exist until we publish the release. As such, overriding the chart's version to 6 on master was a way to keep the chart working as intended for anyone who deploys it from that branch.

This is a bit confusing now I look back on it. I'm not sure how we can handle this better, though. I could update the logic in version.mk to instead handle -dev suffixes on VERSION by just using the most recently released Teleport tag instead?

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.

Can we publish a :7.0.0-dev tag for docker images from master?
People using the chart from master would then get the true "bleeding edge" experience (both code and chart).

Alternatively, if we already conditioned users to use helm from master, maybe de-couple version from appVersion and only set the old image tag in appVersion?

appVersion: "6"
description: Teleport is a unified access plane for your infrastructure
icon: https://goteleport.com/images/logos/logo-teleport-square.svg
Expand Down
16 changes: 16 additions & 0 deletions examples/chart/teleport-cluster/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.highAvailability.certManager.enabled }}
Comment thread
webvictim marked this conversation as resolved.
You have enabled cert-manager support in high availability mode.

There may be a short delay before Teleport pods start while an ACME certificate is issued.
You can check the status of the certificate with `kubectl -n {{ .Release.Namespace }} describe certificate/{{ .Release.Name }}`

NOTE: For certificates to be provisioned, you must also install cert-manager (https://cert-manager.io/docs/) and configure an appropriate
Issuer with access to your DNS provider to handle DNS01 challenges (https://cert-manager.io/docs/configuration/acme/dns01/#supported-dns01-providers)

For more information, please see the Helm guides in the Teleport docs (https://goteleport.com/docs/kubernetes-access/helm/guides/)
{{- else if (gt (int .Values.highAvailability.replicaCount) 1) }}
Comment thread
webvictim marked this conversation as resolved.
You have requested more than 1 replica but have not enabled cert-manager support (highAvailability.certManager.enabled=true) to get ACME certificates.
Your Teleport cluster will not be properly accessible by remote nodes until TLS certificates with the correct clusterName ({{ .Values.clusterName }}) are configured.

For more information, please see the Helm guides in the Teleport docs (https://goteleport.com/docs/kubernetes-access/helm/guides/)
{{- end }}
17 changes: 17 additions & 0 deletions examples/chart/teleport-cluster/templates/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.highAvailability.certManager.enabled }}
{{- $domain:= (required "clusterName is required in chartValues when certManager is enabled" .Values.clusterName) }}
{{- $domainWildcard := printf "*.%s" (required "clusterName is required in chartValues when certManager is enabled" .Values.clusterName) }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
spec:
secretName: teleport-tls
dnsNames:
- {{ quote $domain }}
- {{ quote $domainWildcard }}
issuerRef:
name: {{ required "highAvailability.certManager.issuerName is required in chart values" .Values.highAvailability.certManager.issuerName }}
kind: {{ required "highAvailability.certManager.issuerKind is required in chart values" .Values.highAvailability.certManager.issuerKind }}
{{- end }}
Loading