From 64368c6436fc34d2e483cbc27cf4dd683da0c48b Mon Sep 17 00:00:00 2001 From: Thomas Carmet Date: Tue, 1 Nov 2022 16:49:38 +0000 Subject: [PATCH] support annotations on services --- manifests/templates/deployment.yaml | 12 ++++++++++++ .../templates/tmate-server-loadbalancer-client.yaml | 4 ++++ .../templates/tmate-server-loadbalancer-daemon.yaml | 4 ++++ manifests/values.yaml | 7 +++++++ 4 files changed, 27 insertions(+) diff --git a/manifests/templates/deployment.yaml b/manifests/templates/deployment.yaml index 94603d13..5bd751d2 100644 --- a/manifests/templates/deployment.yaml +++ b/manifests/templates/deployment.yaml @@ -34,11 +34,23 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: + - name: daemon-port + containerPort: {{ .Values.daemonPort }} + - name: client-port + containerPort: {{ .Values.clientPort }} {{- range .Values.ports }} - name: {{ .name }} containerPort: {{ .containerPort }} {{- end }} env: + - name: "SSH_PORT_LISTEN_DAEMON" + value: "{{ .Values.daemonPort }}" + - name: "SSH_PORT_LISTEN_CLIENT" + value: "{{ .Values.clientPort }}" + - name: "USE_PROXY_PROTOCOL" + value: "0" + - name: "SSH_KEYS_PATH" + value: "/etc/tmate-ssh-server/keys" {{- range .Values.env }} - name: {{ .name | quote }} value: {{ .value | quote }} diff --git a/manifests/templates/tmate-server-loadbalancer-client.yaml b/manifests/templates/tmate-server-loadbalancer-client.yaml index eebcda39..1cc22b82 100644 --- a/manifests/templates/tmate-server-loadbalancer-client.yaml +++ b/manifests/templates/tmate-server-loadbalancer-client.yaml @@ -2,6 +2,10 @@ apiVersion: v1 kind: Service metadata: name: tmate-server-lb-client + {{- with .Values.clientAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: # https://cloud.google.com/kubernetes-engine/docs/concepts/service-load-balancer-parameters#fw_ip_address {{- with .Values.loadBalancerSourceRanges }} diff --git a/manifests/templates/tmate-server-loadbalancer-daemon.yaml b/manifests/templates/tmate-server-loadbalancer-daemon.yaml index 355a1287..b19cdd50 100644 --- a/manifests/templates/tmate-server-loadbalancer-daemon.yaml +++ b/manifests/templates/tmate-server-loadbalancer-daemon.yaml @@ -2,6 +2,10 @@ apiVersion: v1 kind: Service metadata: name: tmate-server-lb + {{- with .Values.daemonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: # https://cloud.google.com/kubernetes-engine/docs/concepts/service-load-balancer-parameters#fw_ip_address ports: diff --git a/manifests/values.yaml b/manifests/values.yaml index e720ba60..06ff5101 100644 --- a/manifests/values.yaml +++ b/manifests/values.yaml @@ -46,6 +46,13 @@ service: type: ClusterIP port: 80 + +daemonPort: 2200 +clientPort: 2201 + +clientAnnotations: {} +daemonAnnotations: {} + ingress: enabled: false className: ""