Skip to content

Commit 6cac0c9

Browse files
authored
feat: add existingSecret option for data (#33)
* feat: adding existingSecret option for data * bump chart version * updating documentation * updating documentation
1 parent 2d079ca commit 6cac0c9

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

chart/ssh-punchhole/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ description: Tiny SSH based reverse-tunnel to expose services behind a firewall
44

55
type: application
66

7-
version: 0.0.4
7+
version: 0.0.5
88

99
appVersion: "v2.3"

chart/ssh-punchhole/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ The command removes all the Kubernetes components associated with the chart and
5858

5959
### SSH Credentials
6060

61-
| Name | Description | Value |
62-
| ----------------- | ----------------------------------------------------------------------------------- | ----- |
63-
| `data.privateKey` | Passwordless OpenSSH Private Key authorized to login as `SSH_USER` on `REMOTE_HOST` | `""` |
64-
| `data.knownHosts` | Used for OpenSSH HostKeyVerification. Output of `ssh-keyscan ${REMOTE_HOST}`. | `""` |
61+
| Name | Description | Value |
62+
| --------------------- | ----------------------------------------------------------------------------------- | ----- |
63+
| `data.privateKey` | Passwordless OpenSSH Private Key authorized to login as `SSH_USER` on `REMOTE_HOST` | `""` |
64+
| `data.knownHosts` | Used for OpenSSH HostKeyVerification. Output of `ssh-keyscan ${REMOTE_HOST}`. | `""` |
65+
| `data.existingSecret` | Name of secret containing keys `id_rsa` and `known_hosts`. | `""` |
6566

6667

6768
## License

chart/ssh-punchhole/templates/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,9 @@ spec:
8080
- name: ssh-data
8181
secret:
8282
defaultMode: 0600
83+
{{- if not $.Values.data.existingSecret }}
8384
secretName: {{ include "charts.fullname" $ }}-data
85+
{{- else }}
86+
secretName: {{ $.Values.data.existingSecret }}
87+
{{- end }}
8488
{{- end }}

chart/ssh-punchhole/templates/secret.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if not $.Values.data.existingSecret }}
12
apiVersion: v1
23
kind: Secret
34
type: Opaque
@@ -8,3 +9,4 @@ metadata:
89
data:
910
id_rsa: {{ required "data.privateKey is required" .Values.data.privateKey | b64enc | quote }}
1011
known_hosts: {{ required "data.knownHosts is required" .Values.data.knownHosts | b64enc | quote }}
12+
{{- end }}

chart/ssh-punchhole/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ configuration:
5757
## @section SSH Credentials
5858
## @param data.privateKey Passwordless OpenSSH Private Key authorized to login as `SSH_USER` on `REMOTE_HOST`
5959
## @param data.knownHosts Used for OpenSSH HostKeyVerification. Output of `ssh-keyscan ${REMOTE_HOST}`.
60+
## @param data.existingSecret The name of a secret containing keys `id_rsa` and `known_hosts`.
6061
data:
6162
privateKey: ""
6263
knownHosts: ""
64+
existingSecret: ""
6365

6466
podSecurityContext:
6567
fsGroup: 65534

0 commit comments

Comments
 (0)