Skip to content

Commit

Permalink
BC-8267 - aktivate for dev thr only the one mongo cluster for all mode (
Browse files Browse the repository at this point in the history
  • Loading branch information
mamutmk5 authored Oct 17, 2024
1 parent 145343c commit 1afb19c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
14 changes: 14 additions & 0 deletions ansible/roles/tldraw-server/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
- name: External Secret for TlDraw Server
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: tldraw-server-external-secret.yml.j2
state: "{{ 'present' if
WITH_BRANCH_MONGO_DB_MANAGEMENT is defined and WITH_BRANCH_MONGO_DB_MANAGEMENT|bool and
WITH_TLDRAW2 is defined and WITH_TLDRAW2|bool
else 'absent'}}"
when:
- EXTERNAL_SECRETS_OPERATOR is defined and EXTERNAL_SECRETS_OPERATOR|bool
tags:
- 1password

- name: TlDraw server Secret (from 1Password)
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/tldraw-server/templates/onepassword.yml.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: onepassword.com/v1
kind: OnePasswordItem
metadata:
name: tldraw-server-secret
name: tldraw-server-secret{{ EXTERNAL_SECRETS_POSTFIX }}
namespace: {{ NAMESPACE }}
labels:
app: tldraw-server
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: tldraw-server-secret
namespace: {{ NAMESPACE }}
labels:
app: tldraw-server
spec:
refreshInterval: {{ EXTERNAL_SECRETS_REFRESH_INTERVAL }}
secretStoreRef:
kind: SecretStore
name: {{ EXTERNAL_SECRETS_K8S_STORE }}
target:
name: tldraw-server-secret
template:
engineVersion: v2
mergePolicy: Merge
data:
TLDRAW_DB_URL: "{{ '{{ .MONGO_MANAGEMENT_TEMPLATE_URL }}/' ~ MONGO_MANAGEMENT_PREFIX ~ 'tldraw' ~ MONGO_MANAGEMENT_POSTFIX }}"
dataFrom:
- extract:
key: tldraw-server-secret{{ EXTERNAL_SECRETS_POSTFIX }}
data:
- secretKey: MONGO_MANAGEMENT_TEMPLATE_URL
remoteRef:
key: mongo-cluster-readwrite-secret
property: credentials-url

0 comments on commit 1afb19c

Please sign in to comment.