{%- set ns = project_name -%}
---
apiVersion: v1
kind: Secret
metadata:
  name: freva-secrets
  namespace: {{ ns }}
  labels:
    app.kubernetes.io/name: freva-secrets
    app.kubernetes.io/part-of: freva
    app.kubernetes.io/component: platform
    app.kubernetes.io/managed-by: ansible
type: Opaque
stringData:
  ADMIN_PASSWORD: "{{ root_passwd }}"
  MYSQL_ROOT_PASSWORD: "{{ root_passwd }}"
  MYSQL_PASSWORD: "{{ db_passwd }}"
  REDIS_USERNAME: "{{ redis_username }}"
  REDIS_PASSWORD: "{{ redis_password }}"
  OIDC_CLIENT_SECRET: "{{ freva_rest_oidc_client_secret }}"
  FREVA_REST_DB_USER: "{{ freva_rest_db_user }}"
  FREVA_REST_DB_PASSWORD: "{{ freva_rest_db_passwd }}"
  MONGO_APP_USER: "{{ mongodb_server_db_user }}"
  MONGO_APP_PASSWORD: "{{ mongodb_server_db_passwd }}"
{% if ingress.certs_managed %}

---
apiVersion: v1
kind: Secret
metadata:
  name: web-cert-secret
  namespace: {{ ns }}
type: kubernetes.io/tls
data:
  tls.crt: {{ web_cert_content }}
  tls.key: {{ web_key_content }}
{% endif %}
