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

BC-8267 - aktivate for dev thr only the one mongo cluster for all mode #24

Merged
merged 1 commit into from
Oct 17, 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
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
Loading