diff --git a/manifests/templates/deployment.yaml b/manifests/templates/deployment.yaml index 389c94ff..94603d13 100644 --- a/manifests/templates/deployment.yaml +++ b/manifests/templates/deployment.yaml @@ -44,15 +44,19 @@ spec: value: {{ .value | quote }} {{- end }} volumeMounts: + - name: ssh-host-keys + mountPath: /volume {{- range .Values.volumeMounts }} - name: {{ .name }} mountPath: {{ .mountPath | quote }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} - - {{- with .Values.volumes }} volumes: + - name: ssh-host-keys + secret: + secretName: {{ include "tmate-server.fullname" . }} + {{- with .Values.volumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.nodeSelector }} diff --git a/manifests/templates/secret.yaml b/manifests/templates/secret.yaml new file mode 100644 index 00000000..46f77e34 --- /dev/null +++ b/manifests/templates/secret.yaml @@ -0,0 +1,11 @@ +--- +kind: Secret +apiVersion: v1 +metadata: + name: {{ include "tmate-server.fullname" . }} + labels: + {{- include "tmate-server.labels" . | nindent 4 }} +type: Opaque +data: + tmate-server-rsa-key: {{ .Values.tmateServerRsaKey | b64enc }} + tmate-server-ed25519-key: {{ .Values.tmateServerEd25519Key | b64enc }} diff --git a/manifests/templates/tmate-server-ed25519-key.yaml b/manifests/templates/tmate-server-ed25519-key.yaml deleted file mode 100644 index c5cb9ffe..00000000 --- a/manifests/templates/tmate-server-ed25519-key.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: tmate-server-ed25519-key -spec: - refreshInterval: 1h - secretStoreRef: - kind: ClusterSecretStore - name: gcs-secret-store - target: - name: tmate-server-ed25519-key - creationPolicy: Owner - data: - - secretKey: tmate-server-ed25519-key - remoteRef: - key: tmate-server-ed25519-key diff --git a/manifests/templates/tmate-server-rsa-key.yaml b/manifests/templates/tmate-server-rsa-key.yaml deleted file mode 100644 index 7708e8ac..00000000 --- a/manifests/templates/tmate-server-rsa-key.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: tmate-server-rsa-key -spec: - refreshInterval: 1h - secretStoreRef: - kind: ClusterSecretStore - name: gcs-secret-store - target: - name: tmate-server-rsa-key - creationPolicy: Owner - data: - - secretKey: tmate-server-rsa-key - remoteRef: - key: tmate-server-rsa-key diff --git a/manifests/values.yaml b/manifests/values.yaml index fab1e637..e720ba60 100644 --- a/manifests/values.yaml +++ b/manifests/values.yaml @@ -27,6 +27,10 @@ podAnnotations: {} podSecurityContext: {} # fsGroup: 2000 +# Content for tmate keys +tmateServerRsaKey: "rsakey" +tmateServerEd25519Key: "ed25519key" + securityContext: capabilities: add: