Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External Secret使うようにしてみる #446

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ charset = utf-8
insert_final_newline = true
end_of_line = lf

[*.yml]
[*.{yml,yaml}]
indent_style = space
1 change: 1 addition & 0 deletions infra/k8s/helm/templates/jetdisc/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ metadata:
data:
BOT_NAME: {{ .Values.configMap.botName | quote }}
STORE_DRIVER: {{ .Values.configMap.storeDriver | quote }}
SET_COMMANDS_TARGET_SERVERS: {{ .Values.configMap.setCommandsTargetServers }}
2 changes: 1 addition & 1 deletion infra/k8s/helm/templates/jetdisc/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- secretRef:
name: jetdisc-secret
name: {{ .Values.externalSecrets.targetName }}
- configMapRef:
name: jetdisc-configmap
resources: {{- toYaml .Values.resources | nindent 12 }}
Expand Down
19 changes: 19 additions & 0 deletions infra/k8s/helm/templates/jetdisc/externalsecret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{ if .Values.externalSecrets.enabled }}
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: jetdisc-external-secret
spec:
refreshInterval: {{ .Values.externalSecrets.refreshInterval }}
secretStoreRef:
kind: {{ .Values.externalSecrets.secretStoreRef.kind }}
name: {{ .Values.externalSecrets.secretStoreRef.name }}
namespace: {{ .Values.externalSecrets.secretStoreRef.namespace }}
target:
name: {{ .Values.externalSecrets.targetName }}
creationPolicy: {{ .Values.externalSecrets.creationPolicy }}
data:
- secretKey: DISCORD_APP_TOKEN
remoteRef:
key: jetdisc_discord_app_token
{{ end }}
8 changes: 0 additions & 8 deletions infra/k8s/helm/templates/jetdisc/secret.yaml

This file was deleted.

11 changes: 10 additions & 1 deletion infra/k8s/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ image:

secrets:
discordAppToken: ""
setCommandsTargetServers: ""

configMap:
botName: ""
storeDriver: "local"
setCommandsTargetServers: ""

resources:
limits:
Expand All @@ -21,3 +21,12 @@ resources:
requests:
cpu: 250m
memory: 128Mi

externalSecrets:
enabled: true
secretStoreRef:
kind: ClusterSecretStore
name: secretstore
targetName: jetdisc-secret
creationPolicy: Owner
refreshInterval: 1h