feat: add postgres setup
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
0c6ba3d630
commit
2712707da8
@ -14,6 +14,7 @@ use cuddle_clusters::catalog::cluster_vars::ClusterVars;
|
||||
use cuddle_clusters::catalog::crdb_database::CockroachDB;
|
||||
use cuddle_clusters::catalog::cuddle_vars::CuddleVars;
|
||||
use cuddle_clusters::catalog::ingress::Ingress;
|
||||
use cuddle_clusters::catalog::postgres_database::PostgresDatabase;
|
||||
use cuddle_clusters::catalog::vault_secret::VaultSecret;
|
||||
use cuddle_clusters::releaser::Releaser;
|
||||
use cuddle_clusters::IntoComponent;
|
||||
@ -153,6 +154,10 @@ impl RustServiceRender {
|
||||
.await
|
||||
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
||||
.into_component(),
|
||||
PostgresDatabase::new(&std::env::current_dir()?)
|
||||
.await
|
||||
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
||||
.into_component(),
|
||||
Ingress::new(&std::env::current_dir()?)
|
||||
.await
|
||||
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
||||
|
@ -36,8 +36,13 @@ spec:
|
||||
- configMapRef:
|
||||
name: {{ vars.cuddle_crdb.file_name(service_name) }}
|
||||
{%- endif %}
|
||||
{%- if vars.vault_secret.has_values or vars.cuddle_crdb.has_values %}
|
||||
{%- if vars.cuddle_postgres.has_values %}
|
||||
- configMapRef:
|
||||
name: {{ vars.cuddle_postgres.file_name(service_name) }}
|
||||
{%- endif %}
|
||||
{%- if vars.vault_secret.has_values or vars.cuddle_crdb.has_values or vars.cuddle_postgres.has_values %}
|
||||
env:
|
||||
|
||||
{%- if vars.vault_secret.has_values %}
|
||||
{%- for secret in vars.vault_secret.secrets %}
|
||||
- name: {{secret | upper | replace(".", "_") | replace("-", "_") }}
|
||||
@ -47,6 +52,17 @@ spec:
|
||||
key: {{ secret }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if vars.vault_postgres.has_values %}
|
||||
{%- for env in vars.vault_postgres.env %}
|
||||
- name: {{ env | upper | replace(".", "_") | replace("-", "_") }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ vars.vault_postgres.file_name(service_name) }}
|
||||
key: {{ env }}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
|
||||
{#
|
||||
{%- if vars.cuddle_crdb.has_values %}
|
||||
- name: {{vars.cuddle_crdb.env }}
|
||||
|
Loading…
Reference in New Issue
Block a user