Skip to content

Commit 17305db

Browse files
authored
feat(chart): add bootstrap priv key secret support (#88)
* feat(chart): add secret for private key Signed-off-by: Peter Balogh <[email protected]>
1 parent fbc684a commit 17305db

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

Diff for: install/charts/dir/apiserver/templates/deployment.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ spec:
3232
{{- toYaml .Values.podSecurityContext | nindent 8 }}
3333
containers:
3434
- name: {{ .Chart.Name }}
35+
env:
36+
- name: DIRECTORY_LOGGER_LOG_LEVEL
37+
value: {{ .Values.log_level }}
3538
securityContext:
3639
{{- toYaml .Values.securityContext | nindent 12 }}
3740
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
@@ -71,10 +74,24 @@ spec:
7174
- name: config-volume
7275
mountPath: /etc/agntcy/dir/server.config.yml
7376
subPath: server.config.yml
77+
{{- if .Values.privKey }}
78+
- name: secret-volume
79+
mountPath: {{ .Values.config.routing.key_path }}
80+
subPath: node.privkey
81+
readOnly: true
82+
{{- end }}
7483
volumes:
7584
- name: config-volume
7685
configMap:
7786
name: {{ include "chart.fullname" . }}
87+
{{- if .Values.privKey }}
88+
- name: secret-volume
89+
secret:
90+
secretName: {{ include "chart.fullname" . }}
91+
items:
92+
- key: node.privkey
93+
path: node.privkey
94+
{{- end }}
7895
{{- with .Values.nodeSelector }}
7996
nodeSelector:
8097
{{- toYaml . | nindent 8 }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
{{- if .Values.config.routing.listen_address }}
5+
apiVersion: v1
6+
kind: Service
7+
metadata:
8+
name: {{ include "chart.fullname" . }}-routing
9+
labels:
10+
{{- include "chart.labels" . | nindent 4 }}
11+
spec:
12+
type: {{ .Values.service.type }}
13+
ports:
14+
- port: {{ (split "/" .Values.config.routing.listen_address)._4 }}
15+
targetPort: routing
16+
protocol: TCP
17+
name: routing
18+
selector:
19+
{{- include "chart.selectorLabels" . | nindent 4 }}
20+
{{- end }}

Diff for: install/charts/dir/apiserver/templates/secret.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright AGNTCY Contributors (https://github.com/agntcy)
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
{{- if .Values.privKey -}}
5+
---
6+
apiVersion: v1
7+
kind: Secret
8+
metadata:
9+
name: {{ include "chart.fullname" . }}
10+
labels:
11+
{{- include "chart.labels" . | nindent 4 }}
12+
data:
13+
node.privkey: {{ .Values.privKey | b64enc }}
14+
{{- end }}

Diff for: install/charts/dir/apiserver/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
nameOverride: ""
99
fullnameOverride: ""
1010

11+
log_level: INFO
12+
1113
image:
1214
repository: ghcr.io/agntcy/dir-apiserver
1315
tag: latest

0 commit comments

Comments
 (0)