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::crdb_database::CockroachDB;
|
||||||
use cuddle_clusters::catalog::cuddle_vars::CuddleVars;
|
use cuddle_clusters::catalog::cuddle_vars::CuddleVars;
|
||||||
use cuddle_clusters::catalog::ingress::Ingress;
|
use cuddle_clusters::catalog::ingress::Ingress;
|
||||||
|
use cuddle_clusters::catalog::postgres_database::PostgresDatabase;
|
||||||
use cuddle_clusters::catalog::vault_secret::VaultSecret;
|
use cuddle_clusters::catalog::vault_secret::VaultSecret;
|
||||||
use cuddle_clusters::releaser::Releaser;
|
use cuddle_clusters::releaser::Releaser;
|
||||||
use cuddle_clusters::IntoComponent;
|
use cuddle_clusters::IntoComponent;
|
||||||
@ -153,6 +154,10 @@ impl RustServiceRender {
|
|||||||
.await
|
.await
|
||||||
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
||||||
.into_component(),
|
.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()?)
|
Ingress::new(&std::env::current_dir()?)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
.map_err(|e| eyre::anyhow!("failed to get cuddle vars: {}", e.to_string()))?
|
||||||
|
@ -36,8 +36,13 @@ spec:
|
|||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: {{ vars.cuddle_crdb.file_name(service_name) }}
|
name: {{ vars.cuddle_crdb.file_name(service_name) }}
|
||||||
{%- endif %}
|
{%- 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:
|
env:
|
||||||
|
|
||||||
{%- if vars.vault_secret.has_values %}
|
{%- if vars.vault_secret.has_values %}
|
||||||
{%- for secret in vars.vault_secret.secrets %}
|
{%- for secret in vars.vault_secret.secrets %}
|
||||||
- name: {{secret | upper | replace(".", "_") | replace("-", "_") }}
|
- name: {{secret | upper | replace(".", "_") | replace("-", "_") }}
|
||||||
@ -47,6 +52,17 @@ spec:
|
|||||||
key: {{ secret }}
|
key: {{ secret }}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- 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 %}
|
{%- if vars.cuddle_crdb.has_values %}
|
||||||
- name: {{vars.cuddle_crdb.env }}
|
- name: {{vars.cuddle_crdb.env }}
|
||||||
|
Loading…
Reference in New Issue
Block a user