Bump teleport to version 15.3.3

This commit is contained in:
2024-05-10 20:56:53 +08:00
parent c7413eae10
commit df6da4aabb
236 changed files with 6866 additions and 1322 deletions
@@ -3,6 +3,14 @@ adds operator permissions to ClusterRole:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/component: auth
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: teleport-cluster
app.kubernetes.io/version: 15.3.3
helm.sh/chart: teleport-cluster-15.3.3
teleport.dev/majorVersion: "15"
name: RELEASE-NAME
rules:
- apiGroups:
@@ -13,6 +13,124 @@ adds a proxy token by default:
kubernetes:
allow:
- service_account: "NAMESPACE:RELEASE-NAME-proxy"
configures access monitoring when its values are set:
1: |
|-
auth_service:
access_monitoring:
enabled: true
report_results: s3://example-athena-long-term/report_results
role_arn: arn:aws:iam::123456789012:role/example_AccessMonitoringRole
workgroup: example_access_monitoring_workgroup
authentication:
local_auth: true
second_factor: "on"
type: local
webauthn:
rp_id: test-aws-cluster
cluster_name: test-aws-cluster
enabled: true
proxy_listener_mode: separate
kubernetes_service:
enabled: true
kube_cluster_name: test-aws-cluster
listen_addr: 0.0.0.0:3026
public_addr: RELEASE-NAME-auth.NAMESPACE.svc.cluster.local:3026
proxy_service:
enabled: false
ssh_service:
enabled: false
teleport:
auth_server: 127.0.0.1:3025
log:
format:
extra_fields:
- timestamp
- level
- component
- caller
output: text
output: stderr
severity: INFO
storage:
audit_events_uri:
- athena://db.table?topicArn=arn:aws:sns:region:account_id:topic_name
audit_sessions_uri: s3://test-s3-session-storage-bucket
auto_scaling: false
continuous_backups: false
region: us-west-2
table_name: test-dynamodb-backend-table
type: dynamodb
version: v3
keeps the second factor type even when it's "off":
1: |
|-
auth_service:
authentication:
local_auth: true
second_factor: "off"
type: local
cluster_name: helm-lint
enabled: true
proxy_listener_mode: separate
kubernetes_service:
enabled: true
kube_cluster_name: helm-lint
listen_addr: 0.0.0.0:3026
public_addr: RELEASE-NAME-auth.NAMESPACE.svc.cluster.local:3026
proxy_service:
enabled: false
ssh_service:
enabled: false
teleport:
auth_server: 127.0.0.1:3025
log:
format:
extra_fields:
- timestamp
- level
- component
- caller
output: text
output: stderr
severity: INFO
version: v3
keeps the session_recording type even when it's "off":
1: |
|-
auth_service:
authentication:
local_auth: true
second_factor: "on"
type: local
webauthn:
rp_id: helm-lint
cluster_name: helm-lint
enabled: true
proxy_listener_mode: separate
session_recording: "off"
kubernetes_service:
enabled: true
kube_cluster_name: helm-lint
listen_addr: 0.0.0.0:3026
public_addr: RELEASE-NAME-auth.NAMESPACE.svc.cluster.local:3026
proxy_service:
enabled: false
ssh_service:
enabled: false
teleport:
auth_server: 127.0.0.1:3025
log:
format:
extra_fields:
- timestamp
- level
- component
- caller
output: text
output: stderr
severity: INFO
version: v3
matches snapshot for acme-off.yaml:
1: |
|-
@@ -1673,3 +1791,139 @@ matches snapshot for volumes.yaml:
output: stderr
severity: INFO
version: v3
uses athena as primary backend when configured:
1: |
|-
auth_service:
authentication:
local_auth: true
second_factor: "on"
type: local
webauthn:
rp_id: teleport.example.com
cluster_name: teleport.example.com
enabled: true
proxy_listener_mode: separate
kubernetes_service:
enabled: true
kube_cluster_name: teleport.example.com
listen_addr: 0.0.0.0:3026
public_addr: RELEASE-NAME-auth.NAMESPACE.svc.cluster.local:3026
proxy_service:
enabled: false
ssh_service:
enabled: false
teleport:
auth_server: 127.0.0.1:3025
log:
format:
extra_fields:
- timestamp
- level
- component
- caller
output: text
output: stderr
severity: INFO
storage:
audit_events_uri:
- athena://db.table?topicArn=arn:aws:sns:region:account_id:topic_name
- dynamodb://my-dynamodb-table
audit_sessions_uri: s3://asd
auto_scaling: false
continuous_backups: false
region: asd
table_name: asd
type: dynamodb
version: v3
uses athena, dynamo, and stdout when everything is on:
1: |
|-
auth_service:
authentication:
local_auth: true
second_factor: "on"
type: local
webauthn:
rp_id: teleport.example.com
cluster_name: teleport.example.com
enabled: true
proxy_listener_mode: separate
kubernetes_service:
enabled: true
kube_cluster_name: teleport.example.com
listen_addr: 0.0.0.0:3026
public_addr: RELEASE-NAME-auth.NAMESPACE.svc.cluster.local:3026
proxy_service:
enabled: false
ssh_service:
enabled: false
teleport:
auth_server: 127.0.0.1:3025
log:
format:
extra_fields:
- timestamp
- level
- component
- caller
output: text
output: stderr
severity: INFO
storage:
audit_events_uri:
- athena://db.table?topicArn=arn:aws:sns:region:account_id:topic_name
- dynamodb://my-dynamodb-table
- stdout://
audit_sessions_uri: s3://asd
auto_scaling: false
continuous_backups: false
region: asd
table_name: asd
type: dynamodb
version: v3
uses dynamo as primary backend when configured:
1: |
|-
auth_service:
authentication:
local_auth: true
second_factor: "on"
type: local
webauthn:
rp_id: teleport.example.com
cluster_name: teleport.example.com
enabled: true
proxy_listener_mode: separate
kubernetes_service:
enabled: true
kube_cluster_name: teleport.example.com
listen_addr: 0.0.0.0:3026
public_addr: RELEASE-NAME-auth.NAMESPACE.svc.cluster.local:3026
proxy_service:
enabled: false
ssh_service:
enabled: false
teleport:
auth_server: 127.0.0.1:3025
log:
format:
extra_fields:
- timestamp
- level
- component
- caller
output: text
output: stderr
severity: INFO
storage:
audit_events_uri:
- dynamodb://my-dynamodb-table
- athena://db.table?topicArn=arn:aws:sns:region:account_id:topic_name
audit_sessions_uri: s3://asd
auto_scaling: false
continuous_backups: false
region: asd
table_name: asd
type: dynamodb
version: v3
@@ -8,7 +8,7 @@
- args:
- --diag-addr=0.0.0.0:3000
- --apply-on-startup=/etc/teleport/apply-on-startup.yaml
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
@@ -141,7 +141,7 @@ should set nodeSelector when set in values:
- args:
- --diag-addr=0.0.0.0:3000
- --apply-on-startup=/etc/teleport/apply-on-startup.yaml
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
@@ -238,7 +238,7 @@ should set resources when set in values:
- args:
- --diag-addr=0.0.0.0:3000
- --apply-on-startup=/etc/teleport/apply-on-startup.yaml
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
@@ -324,7 +324,7 @@ should set securityContext when set in values:
- args:
- --diag-addr=0.0.0.0:3000
- --apply-on-startup=/etc/teleport/apply-on-startup.yaml
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
@@ -5,8 +5,15 @@ should provision initContainer correctly when set in values:
- wait
- no-resolve
- RELEASE-NAME-auth-v14.NAMESPACE.svc.cluster.local
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
name: wait-auth-update
resources:
limits:
cpu: 1
memory: 512Mi
requests:
cpu: 0.1
memory: 256Mi
- args:
- echo test
image: alpine
@@ -62,7 +69,7 @@ should set nodeSelector when set in values:
containers:
- args:
- --diag-addr=0.0.0.0:3000
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
@@ -123,7 +130,7 @@ should set nodeSelector when set in values:
- wait
- no-resolve
- RELEASE-NAME-auth-v14.NAMESPACE.svc.cluster.local
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
name: wait-auth-update
nodeSelector:
environment: security
@@ -166,7 +173,7 @@ should set required affinity when highAvailability.requireAntiAffinity is set:
values:
- proxy
topologyKey: kubernetes.io/hostname
should set resources when set in values:
should set resources for wait-auth-update initContainer when set in values:
1: |
affinity:
podAntiAffinity: null
@@ -174,7 +181,7 @@ should set resources when set in values:
containers:
- args:
- --diag-addr=0.0.0.0:3000
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
@@ -242,8 +249,123 @@ should set resources when set in values:
- wait
- no-resolve
- RELEASE-NAME-auth-v14.NAMESPACE.svc.cluster.local
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
name: wait-auth-update
resources:
limits:
cpu: 1
memory: 512Mi
requests:
cpu: 0.1
memory: 256Mi
serviceAccountName: RELEASE-NAME-proxy
terminationGracePeriodSeconds: 60
volumes:
- name: proxy-serviceaccount-token
projected:
sources:
- serviceAccountToken:
path: token
- configMap:
items:
- key: ca.crt
path: ca.crt
name: kube-root-ca.crt
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.namespace
path: namespace
- configMap:
name: RELEASE-NAME-proxy
name: config
- emptyDir: {}
name: data
should set resources when set in values:
1: |
affinity:
podAntiAffinity: null
automountServiceAccountToken: false
containers:
- args:
- --diag-addr=0.0.0.0:3000
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
exec:
command:
- teleport
- wait
- duration
- 30s
livenessProbe:
failureThreshold: 6
httpGet:
path: /healthz
port: diag
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 1
name: teleport
ports:
- containerPort: 3080
name: tls
protocol: TCP
- containerPort: 3023
name: sshproxy
protocol: TCP
- containerPort: 3024
name: sshtun
protocol: TCP
- containerPort: 3026
name: kube
protocol: TCP
- containerPort: 3036
name: mysql
protocol: TCP
- containerPort: 3000
name: diag
protocol: TCP
readinessProbe:
failureThreshold: 12
httpGet:
path: /readyz
port: diag
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 1
resources:
limits:
cpu: 2
memory: 4Gi
requests:
cpu: 1
memory: 2Gi
volumeMounts:
- mountPath: /etc/teleport
name: config
readOnly: true
- mountPath: /var/lib/teleport
name: data
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: proxy-serviceaccount-token
readOnly: true
initContainers:
- command:
- teleport
- wait
- no-resolve
- RELEASE-NAME-auth-v14.NAMESPACE.svc.cluster.local
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
name: wait-auth-update
resources:
limits:
cpu: 1
memory: 512Mi
requests:
cpu: 0.1
memory: 256Mi
serviceAccountName: RELEASE-NAME-proxy
terminationGracePeriodSeconds: 60
volumes:
@@ -275,7 +397,7 @@ should set securityContext for initContainers when set in values:
containers:
- args:
- --diag-addr=0.0.0.0:3000
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
@@ -343,7 +465,7 @@ should set securityContext for initContainers when set in values:
- wait
- no-resolve
- RELEASE-NAME-auth-v14.NAMESPACE.svc.cluster.local
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
name: wait-auth-update
securityContext:
allowPrivilegeEscalation: false
@@ -383,7 +505,7 @@ should set securityContext when set in values:
containers:
- args:
- --diag-addr=0.0.0.0:3000
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
@@ -451,7 +573,7 @@ should set securityContext when set in values:
- wait
- no-resolve
- RELEASE-NAME-auth-v14.NAMESPACE.svc.cluster.local
image: public.ecr.aws/gravitational/teleport-distroless:15.0.1
image: public.ecr.aws/gravitational/teleport-distroless:15.3.3
name: wait-auth-update
securityContext:
allowPrivilegeEscalation: false
@@ -17,3 +17,20 @@ tests:
- isKind:
of: ClusterRole
- matchSnapshot: {}
- it: sets extraLabels on ClusterRole
set:
extraLabels:
clusterRole:
foo: bar
baz: override-me
auth:
extraLabels:
clusterRole:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
@@ -18,3 +18,21 @@ tests:
content:
kind: ServiceAccount
name: "helm-lint"
- it: sets extraLabels on ClusterRoleBindings
set:
extraLabels:
clusterRoleBinding:
foo: bar
baz: override-me
auth:
extraLabels:
clusterRoleBinding:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
@@ -510,3 +510,180 @@ tests:
- matchRegex:
path: data.teleport\.yaml
pattern: 'billing_mode: provisioned'
- it: fails when no audit backend is configured
set:
chartMode: aws
clusterName: "teleport.example.com"
aws:
region: asd
backendTable: asd
sessionRecordingBucket: asd
asserts:
- failedTemplate:
errorMessage: "You need an audit backend. In AWS mode, you must set at least one of `aws.auditLogTable` (Dynamo) and `aws.athenaURL` (Athena)."
- it: configures dynamo when dynamo is set
set:
chartMode: aws
clusterName: "teleport.example.com"
aws:
region: asd
backendTable: asd
sessionRecordingBucket: asd
auditLogTable: my-dynamodb-table
asserts:
- matchRegex:
path: data.teleport\.yaml
pattern: '- dynamodb://my-dynamodb-table'
- it: configures athena when athenaURL is set
set:
chartMode: aws
clusterName: "teleport.example.com"
aws:
region: asd
backendTable: asd
sessionRecordingBucket: asd
athenaURL: 'athena://db.table?topicArn=arn:aws:sns:region:account_id:topic_name'
asserts:
- matchRegex:
path: data.teleport\.yaml
pattern: '- athena://db.table'
- it: configures dynamo and stdout when dynamo is set and mirroring is on
set:
chartMode: aws
clusterName: "teleport.example.com"
aws:
region: asd
backendTable: asd
sessionRecordingBucket: asd
auditLogTable: my-dynamodb-table
auditLogMirrorOnStdout: true
asserts:
- matchRegex:
path: data.teleport\.yaml
pattern: '- dynamodb://my-dynamodb-table'
- matchRegex:
path: data.teleport\.yaml
pattern: '- stdout://'
- it: fails when both athena and dynamo are set but no order is specified
set:
chartMode: aws
clusterName: "teleport.example.com"
aws:
region: asd
backendTable: asd
sessionRecordingBucket: asd
auditLogTable: my-dynamodb-table
athenaURL: 'athena://db.table?topicArn=arn:aws:sns:region:account_id:topic_name'
asserts:
- failedTemplate:
errorMessage: "Both Dynamo and Athena audit backends are enabled. You must specify the primary backend by setting `aws.auditLogPrimaryBackend` to either 'dynamo' or 'athena'."
- it: uses athena as primary backend when configured
set:
chartMode: aws
clusterName: "teleport.example.com"
aws:
region: asd
backendTable: asd
sessionRecordingBucket: asd
auditLogTable: my-dynamodb-table
athenaURL: 'athena://db.table?topicArn=arn:aws:sns:region:account_id:topic_name'
auditLogPrimaryBackend: "athena"
asserts:
- matchSnapshot:
path: data.teleport\.yaml
- it: uses dynamo as primary backend when configured
set:
chartMode: aws
clusterName: "teleport.example.com"
aws:
region: asd
backendTable: asd
sessionRecordingBucket: asd
auditLogTable: my-dynamodb-table
athenaURL: 'athena://db.table?topicArn=arn:aws:sns:region:account_id:topic_name'
auditLogPrimaryBackend: "dynamo"
asserts:
- matchSnapshot:
path: data.teleport\.yaml
- it: uses athena, dynamo, and stdout when everything is on
set:
chartMode: aws
clusterName: "teleport.example.com"
aws:
region: asd
backendTable: asd
sessionRecordingBucket: asd
auditLogTable: my-dynamodb-table
athenaURL: 'athena://db.table?topicArn=arn:aws:sns:region:account_id:topic_name'
auditLogPrimaryBackend: "athena"
auditLogMirrorOnStdout: true
asserts:
- matchSnapshot:
path: data.teleport\.yaml
- it: keeps the second factor type even when it's "off"
set:
clusterName: helm-lint
authentication:
secondFactor: 'off'
asserts:
- matchSnapshot:
path: data.teleport\.yaml
- it: fails if access monitoring is enabled without athena
set:
chartMode: aws
clusterName: "teleport.example.com"
aws:
region: asd
backendTable: asd
sessionRecordingBucket: asd
auditLogTable: my-dynamodb-table
accessMonitoring:
enabled: true
asserts:
- failedTemplate:
errorMessage: "AccessMonitoring requires an Athena Event backend"
- it: configures access monitoring when its values are set
values:
- ../.lint/aws-access-monitoring.yaml
asserts:
- matchSnapshot:
path: data.teleport\.yaml
- it: sets extraLabels on Configmap
values:
- ../.lint/annotations.yaml
set:
extraLabels:
config:
foo: bar
baz: override-me
auth:
extraLabels:
config:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
- it: keeps the session_recording type even when it's "off"
set:
clusterName: helm-lint
sessionRecording: 'off'
asserts:
- matchSnapshot:
path: data.teleport\.yaml
@@ -3,7 +3,7 @@ templates:
- auth/deployment.yaml
- auth/config.yaml
tests:
- it: sets Statefulset annotations when specified
- it: sets Deployment annotations when specified
template: auth/deployment.yaml
values:
- ../.lint/annotations.yaml
@@ -126,6 +126,35 @@ tests:
- matchSnapshot:
path: spec.template.spec
- it: should set podSecurityContext when set in values
template: auth/deployment.yaml
values:
- ../.lint/pod-security-context.yaml
asserts:
- equal:
path: spec.template.spec.securityContext.fsGroup
value: 99
- equal:
path: spec.template.spec.securityContext.fsGroupChangePolicy
value: OnRootMismatch
- equal:
path: spec.template.spec.securityContext.runAsGroup
value: 99
- equal:
path: spec.template.spec.securityContext.runAsNonRoot
value: true
- equal:
path: spec.template.spec.securityContext.runAsUser
value: 99
- it: should not set podSecurityContext when is empty object (default value)
template: auth/deployment.yaml
values:
- ../.lint/pod-security-context-empty.yaml
asserts:
- isNull:
path: spec.template.spec.securityContext
- it: should set securityContext when set in values
template: auth/deployment.yaml
values:
@@ -828,3 +857,45 @@ tests:
- equal:
path: spec.template.metadata.labels.azure\.workload\.identity/use
value: "true"
- it: sets extraLabels on Deployment
template: auth/deployment.yaml
values:
- ../.lint/annotations.yaml
set:
extraLabels:
deployment:
foo: bar
baz: override-me
auth:
extraLabels:
deployment:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
- it: sets extraLabels on Deployment Pods
template: auth/deployment.yaml
values:
- ../.lint/annotations.yaml
set:
extraLabels:
pod:
foo: bar
baz: override-me
auth:
extraLabels:
pod:
baz: overridden
asserts:
- equal:
path: spec.template.metadata.labels.foo
value: bar
- equal:
path: spec.template.metadata.labels.baz
value: overridden
+20
View File
@@ -21,3 +21,23 @@ tests:
- equal:
path: spec.minAvailable
value: 2
- it: sets extraLabels on PodDisruptionBudget
values:
- ../.lint/pdb.yaml
set:
extraLabels:
podDisruptionBudget:
foo: bar
baz: override-me
auth:
extraLabels:
podDisruptionBudget:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
+19
View File
@@ -85,3 +85,22 @@ tests:
asserts:
- hasDocuments:
count: 0
- it: sets extraLabels on PersistentVolumeClaim
set:
chartMode: standalone
extraLabels:
persistentVolumeClaim:
foo: bar
baz: override-me
auth:
extraLabels:
persistentVolumeClaim:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
@@ -30,3 +30,23 @@ tests:
- equal:
path: metadata.annotations.azure\.workload\.identity/client-id
value: "1234"
- it: sets extraLabels on ServiceAccount
values:
- ../.lint/annotations.yaml
set:
extraLabels:
serviceAccount:
foo: bar
baz: override-me
auth:
extraLabels:
serviceAccount:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
+20
View File
@@ -536,3 +536,23 @@ tests:
value: helm-lint-tls-secret
- matchSnapshot:
path: spec.tls
- it: sets extraLabels on Ingress
values:
- ../.lint/ingress.yaml
set:
extraLabels:
ingress:
foo: bar
baz: override-me
proxy:
extraLabels:
ingress:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
@@ -109,3 +109,82 @@ tests:
value: myRegistryKeySecretName
- matchSnapshot:
path: spec.template.spec.imagePullSecrets
- it: should set extraLabels on auth predeploy job when set in values
template: auth/predeploy_job.yaml
set:
clusterName: helm-lint
extraLabels:
job:
foo: bar
baz: override-me
auth:
extraLabels:
job:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
- it: should set extraLabels on auth predeploy config when set in values
template: auth/predeploy_config.yaml
set:
clusterName: helm-lint
extraLabels:
config:
foo: bar
baz: override-me
auth:
extraLabels:
config:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
- it: should set extraLabels on proxy predeploy job when set in values
template: proxy/predeploy_job.yaml
set:
clusterName: helm-lint
extraLabels:
job:
foo: bar
baz: override-me
proxy:
extraLabels:
job:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
- it: should set extraLabels on proxy predeploy config when set in values
template: proxy/predeploy_config.yaml
set:
clusterName: helm-lint
extraLabels:
config:
foo: bar
baz: override-me
proxy:
extraLabels:
config:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
@@ -192,3 +192,23 @@ tests:
- notEqual:
path: spec.dnsNames[4]
value: "teleport.test.com"
- it: sets extraLabels on Certificate Secret
values:
- ../.lint/cert-manager.yaml
set:
extraLabels:
certSecret:
foo: bar
baz: override-me
proxy:
extraLabels:
certSecret:
baz: overridden
asserts:
- equal:
path: spec.secretTemplate.labels.foo
value: bar
- equal:
path: spec.secretTemplate.labels.baz
value: overridden
@@ -256,3 +256,23 @@ tests:
- notMatchRegex:
path: data.teleport\.yaml
pattern: 'proxy_protocol:'
- it: sets extraLabels on Configmap
values:
- ../.lint/annotations.yaml
set:
extraLabels:
config:
foo: bar
baz: override-me
proxy:
extraLabels:
config:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
@@ -164,6 +164,35 @@ tests:
- matchSnapshot:
path: spec.template.spec
- it: should set podSecurityContext when set in values
template: proxy/deployment.yaml
values:
- ../.lint/pod-security-context.yaml
asserts:
- equal:
path: spec.template.spec.securityContext.fsGroup
value: 99
- equal:
path: spec.template.spec.securityContext.fsGroupChangePolicy
value: OnRootMismatch
- equal:
path: spec.template.spec.securityContext.runAsGroup
value: 99
- equal:
path: spec.template.spec.securityContext.runAsNonRoot
value: true
- equal:
path: spec.template.spec.securityContext.runAsUser
value: 99
- it: should not set podSecurityContext when is empty object (default value)
template: proxy/deployment.yaml
values:
- ../.lint/pod-security-context-empty.yaml
asserts:
- isNull:
path: spec.template.spec.securityContext
- it: should set securityContext when set in values
template: proxy/deployment.yaml
values:
@@ -224,6 +253,25 @@ tests:
- matchSnapshot:
path: spec.template.spec
- it: should set resources for wait-auth-update initContainer when set in values
template: proxy/deployment.yaml
values:
- ../.lint/resources.yaml
asserts:
- equal:
path: spec.template.spec.initContainers[0].resources.requests.cpu
value: 0.1
- equal:
path: spec.template.spec.initContainers[0].resources.requests.memory
value: 256Mi
- equal:
path: spec.template.spec.initContainers[0].resources.limits.cpu
value: 1
- equal:
path: spec.template.spec.initContainers[0].resources.limits.memory
value: 512Mi
- matchSnapshot:
path: spec.template.spec
- it: should not set securityContext for initContainers when is empty object (default value)
template: proxy/deployment.yaml
@@ -939,3 +987,45 @@ tests:
mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: proxy-serviceaccount-token
readOnly: true
- it: sets extraLabels on Deployment
template: proxy/deployment.yaml
values:
- ../.lint/annotations.yaml
set:
extraLabels:
deployment:
foo: bar
baz: override-me
proxy:
extraLabels:
deployment:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
- it: sets extraLabels on Deployment Pods
template: proxy/deployment.yaml
values:
- ../.lint/annotations.yaml
set:
extraLabels:
pod:
foo: bar
baz: override-me
proxy:
extraLabels:
pod:
baz: overridden
asserts:
- equal:
path: spec.template.metadata.labels.foo
value: bar
- equal:
path: spec.template.metadata.labels.baz
value: overridden
@@ -21,3 +21,23 @@ tests:
- equal:
path: spec.minAvailable
value: 2
- it: sets extraLabels on PodDisruptionBudget
values:
- ../.lint/pdb.yaml
set:
extraLabels:
podDisruptionBudget:
foo: bar
baz: override-me
proxy:
extraLabels:
podDisruptionBudget:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
@@ -379,3 +379,23 @@ tests:
asserts:
- matchSnapshot:
path: spec.ports
- it: sets extraLabels on Service
values:
- ../.lint/annotations.yaml
set:
extraLabels:
service:
foo: bar
baz: override-me
proxy:
extraLabels:
service:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden
@@ -20,3 +20,23 @@ tests:
- equal:
path: metadata.name
value: "helm-lint-proxy"
- it: sets extraLabels on ServiceAccount
values:
- ../.lint/annotations.yaml
set:
extraLabels:
serviceAccount:
foo: bar
baz: override-me
proxy:
extraLabels:
serviceAccount:
baz: overridden
asserts:
- equal:
path: metadata.labels.foo
value: bar
- equal:
path: metadata.labels.baz
value: overridden