mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
Add env and project long id (#714)
This commit is contained in:
committed by
GitHub
parent
0da238c4d3
commit
b58dfdb42a
962
Cargo.lock
generated
962
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@
|
||||
image:
|
||||
## Bitnami MongoDB registry
|
||||
##
|
||||
registry: quay.io
|
||||
registry: docker.io
|
||||
## Bitnami MongoDB image name
|
||||
##
|
||||
repository: bitnami/mongodb
|
||||
@@ -207,19 +207,22 @@ annotations: {}
|
||||
|
||||
# Additional abels to apply to the deployment or statefulsets
|
||||
labels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseName: {{ sanitized_name }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
# Annotations to be added to MongoDB pods
|
||||
podAnnotations: {}
|
||||
|
||||
# Additional pod labels to apply
|
||||
podLabels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
## Use an alternate scheduler, e.g. "stork".
|
||||
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
##
|
||||
image:
|
||||
debug: false
|
||||
registry: quay.io
|
||||
registry: docker.io
|
||||
repository: bitnami/mysql
|
||||
tag: "{{ version }}"
|
||||
|
||||
@@ -44,10 +44,11 @@ fullnameOverride: {{ sanitized_name }}
|
||||
clusterDomain: cluster.local
|
||||
|
||||
commonLabels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseName: {{ sanitized_name }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
## Init containers parameters:
|
||||
## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
|
||||
|
||||
@@ -13,7 +13,7 @@ global:
|
||||
## ref: https://hub.docker.com/r/bitnami/postgresql/tags/
|
||||
##
|
||||
image:
|
||||
registry: quay.io
|
||||
registry: docker.io
|
||||
repository: bitnami/postgresql
|
||||
tag: "{{ version }}"
|
||||
## Specify a imagePullPolicy
|
||||
@@ -349,14 +349,18 @@ master:
|
||||
affinity: {}
|
||||
tolerations: []
|
||||
labels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations: {}
|
||||
podLabels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
podAnnotations: {}
|
||||
priorityClassName: ""
|
||||
## Extra init containers
|
||||
|
||||
@@ -13,7 +13,7 @@ global:
|
||||
## ref: https://hub.docker.com/r/bitnami/redis/tags/
|
||||
##
|
||||
image:
|
||||
registry: quay.io
|
||||
registry: docker.io
|
||||
repository: bitnami/redis
|
||||
## Bitnami Redis image tag
|
||||
## ref: https://github.com/bitnami/bitnami-docker-redis#supported-tags-and-respective-dockerfile-links
|
||||
@@ -132,9 +132,11 @@ sentinel:
|
||||
##
|
||||
annotations: {}
|
||||
labels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
loadBalancerIP:
|
||||
|
||||
## Specifies the Kubernetes Cluster's Domain Name.
|
||||
@@ -291,10 +293,11 @@ master:
|
||||
## Redis Master additional pod labels and annotations
|
||||
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
podLabels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseName: {{ sanitized_name }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
podAnnotations: {}
|
||||
|
||||
## Redis Master resource requests and limits
|
||||
@@ -388,9 +391,11 @@ master:
|
||||
external-dns.alpha.kubernetes.io/ttl: "300"
|
||||
{% endif %}
|
||||
labels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
loadBalancerIP:
|
||||
# loadBalancerSourceRanges: ["10.0.0.0/8"]
|
||||
|
||||
@@ -425,9 +430,11 @@ master:
|
||||
## https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets
|
||||
statefulset:
|
||||
labels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
updateStrategy: RollingUpdate
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
|
||||
@@ -10,6 +10,9 @@ metadata:
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
app: {{ sanitized_name }}
|
||||
appLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations:
|
||||
releaseTime: {% raw %}{{ dateInZone "2006-01-02 15:04:05Z" (now) "UTC"| quote }}{% endraw %}
|
||||
spec:
|
||||
@@ -33,6 +36,9 @@ spec:
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
app: {{ sanitized_name }}
|
||||
appLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations:
|
||||
checksum/config: {% raw %}{{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}{% endraw %}
|
||||
spec:
|
||||
|
||||
@@ -10,6 +10,9 @@ metadata:
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
app: {{ sanitized_name }}
|
||||
appLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations:
|
||||
releaseTime: {% raw %}{{ dateInZone "2006-01-02 15:04:05Z" (now) "UTC"| quote }}{% endraw %}
|
||||
spec:
|
||||
@@ -28,6 +31,9 @@ spec:
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
app: {{ sanitized_name }}
|
||||
appLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations:
|
||||
checksum/config: {% raw %}{{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}{% endraw %}
|
||||
spec:
|
||||
@@ -91,27 +97,6 @@ spec:
|
||||
{%- endfor %}
|
||||
volumeClaimTemplates:
|
||||
{%- for s in storage %}
|
||||
{% if clone %}
|
||||
- metadata:
|
||||
name: {{ s.id }}
|
||||
labels:
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
app: {{ sanitized_name }}
|
||||
diskId: {{ s.id }}
|
||||
diskType: {{ s.storage_type }}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: aws-ebs-{{ s.storage_type }}-0
|
||||
dataSource:
|
||||
name: {{ s.id }}
|
||||
kind: PersistentVolumeClaim
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ disk.size_in_gib }}Gi
|
||||
{% else %}
|
||||
- metadata:
|
||||
name: {{ s.id }}
|
||||
labels:
|
||||
@@ -127,6 +112,5 @@ spec:
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ s.size_in_gib }}Gi
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
|
||||
@@ -7,6 +7,9 @@ metadata:
|
||||
namespace: {{ namespace }}
|
||||
labels:
|
||||
ownerId: {{ owner_id }}
|
||||
routerLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
spec:
|
||||
acme:
|
||||
server: {{ spec_acme_server }}
|
||||
|
||||
@@ -10,6 +10,9 @@ metadata:
|
||||
routerName: {{ sanitized_name }}
|
||||
routerId: {{ id }}
|
||||
envId: {{ environment_id }}
|
||||
routerLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
fqdn: "{{ router_default_domain }}"
|
||||
annotations:
|
||||
external-dns.alpha.kubernetes.io/hostname: {{ router_default_domain }}
|
||||
|
||||
@@ -210,6 +210,8 @@ labels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
# Annotations to be added to MongoDB pods
|
||||
podAnnotations: {}
|
||||
@@ -219,6 +221,8 @@ podLabels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
## Use an alternate scheduler, e.g. "stork".
|
||||
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||
|
||||
@@ -47,6 +47,8 @@ commonLabels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
## Init containers parameters:
|
||||
## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
|
||||
|
||||
@@ -352,11 +352,15 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations: {}
|
||||
podLabels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
podAnnotations: {}
|
||||
priorityClassName: ""
|
||||
## Extra init containers
|
||||
|
||||
@@ -135,6 +135,8 @@ sentinel:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
loadBalancerIP:
|
||||
|
||||
## Specifies the Kubernetes Cluster's Domain Name.
|
||||
@@ -294,6 +296,8 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
podAnnotations: {}
|
||||
|
||||
## Redis Master resource requests and limits
|
||||
@@ -390,6 +394,8 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
loadBalancerIP:
|
||||
# loadBalancerSourceRanges: ["10.0.0.0/8"]
|
||||
|
||||
@@ -427,6 +433,8 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
updateStrategy: RollingUpdate
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
|
||||
@@ -9,6 +9,8 @@ metadata:
|
||||
appLongId: {{ long_id }}
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
appId: {{ id }}
|
||||
app: {{ sanitized_name }}
|
||||
annotations:
|
||||
@@ -35,6 +37,8 @@ spec:
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
app: {{ sanitized_name }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations:
|
||||
checksum/config: {% raw %}{{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}{% endraw %}
|
||||
appCommitId: {{ version }}
|
||||
|
||||
@@ -11,6 +11,8 @@ metadata:
|
||||
appId: {{ id }}
|
||||
appLongId: {{ long_id }}
|
||||
app: {{ sanitized_name }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations:
|
||||
releaseTime: {% raw %}{{ dateInZone "2006-01-02 15:04:05Z" (now) "UTC"| quote }}{% endraw %}
|
||||
spec:
|
||||
@@ -30,6 +32,8 @@ spec:
|
||||
appId: {{ id }}
|
||||
appLongId: {{ long_id }}
|
||||
app: {{ sanitized_name }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations:
|
||||
checksum/config: {% raw %}{{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}{% endraw %}
|
||||
spec:
|
||||
|
||||
@@ -7,6 +7,8 @@ metadata:
|
||||
namespace: {{ namespace }}
|
||||
labels:
|
||||
routerLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
spec:
|
||||
acme:
|
||||
server: {{ spec_acme_server }}
|
||||
|
||||
@@ -9,6 +9,8 @@ metadata:
|
||||
routerId: {{ id }}
|
||||
routerLongId: {{ long_id }}
|
||||
envId: {{ environment_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
fqdn: "{{ router_default_domain }}"
|
||||
annotations:
|
||||
external-dns.alpha.kubernetes.io/hostname: {{ router_default_domain }}
|
||||
|
||||
@@ -213,6 +213,8 @@ labels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
# Annotations to be added to MongoDB pods
|
||||
podAnnotations: {}
|
||||
@@ -222,6 +224,8 @@ podLabels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
## Use an alternate scheduler, e.g. "stork".
|
||||
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||
|
||||
@@ -47,6 +47,8 @@ commonLabels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
## Init containers parameters:
|
||||
## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
|
||||
|
||||
@@ -354,11 +354,15 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations: {}
|
||||
podLabels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
podAnnotations: {}
|
||||
priorityClassName: ""
|
||||
## Extra init containers
|
||||
|
||||
@@ -135,6 +135,8 @@ sentinel:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
loadBalancerIP:
|
||||
|
||||
## Specifies the Kubernetes Cluster's Domain Name.
|
||||
@@ -294,6 +296,8 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
podAnnotations: {}
|
||||
|
||||
## Redis Master resource requests and limits
|
||||
@@ -393,6 +397,8 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
loadBalancerIP:
|
||||
# loadBalancerSourceRanges: ["10.0.0.0/8"]
|
||||
|
||||
@@ -430,6 +436,8 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
updateStrategy: RollingUpdate
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
|
||||
@@ -11,6 +11,8 @@ metadata:
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
app: {{ sanitized_name }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations:
|
||||
releaseTime: {% raw %}{{ dateInZone "2006-01-02 15:04:05Z" (now) "UTC"| quote }}{% endraw %}
|
||||
spec:
|
||||
@@ -31,6 +33,8 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
appLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
|
||||
@@ -6,6 +6,8 @@ metadata:
|
||||
name: {{ sanitized_name }}
|
||||
namespace: {{ namespace }}
|
||||
labels:
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
appLongId: {{ long_id }}
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
@@ -25,6 +27,8 @@ spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
appLongId: {{ long_id }}
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
|
||||
@@ -7,6 +7,8 @@ metadata:
|
||||
namespace: {{ namespace }}
|
||||
labels:
|
||||
routerLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
spec:
|
||||
acme:
|
||||
server: {{ spec_acme_server }}
|
||||
|
||||
@@ -8,6 +8,8 @@ metadata:
|
||||
labels:
|
||||
routerId: {{ id }}
|
||||
routerLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
envId: {{ environment_id }}
|
||||
fqdn: "{{ router_default_domain }}"
|
||||
annotations:
|
||||
|
||||
@@ -148,6 +148,8 @@ labels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
|
||||
# Additional pod labels to apply
|
||||
@@ -155,6 +157,8 @@ podLabels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
## updateStrategy for MongoDB Primary, Secondary and Arbitrer statefulsets
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies
|
||||
|
||||
@@ -47,6 +47,8 @@ commonLabels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
|
||||
## Init containers parameters:
|
||||
## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
|
||||
|
||||
@@ -190,11 +190,15 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
annotations: {}
|
||||
podLabels:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
podAnnotations: {}
|
||||
priorityClassName: ""
|
||||
## Extra init containers
|
||||
|
||||
@@ -124,6 +124,8 @@ sentinel:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
loadBalancerIP:
|
||||
|
||||
networkPolicy:
|
||||
@@ -251,6 +253,8 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
podAnnotations: {}
|
||||
|
||||
## Redis Master resource requests and limits
|
||||
@@ -352,6 +356,8 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
loadBalancerIP:
|
||||
# loadBalancerSourceRanges: ["10.0.0.0/8"]
|
||||
|
||||
@@ -389,6 +395,8 @@ master:
|
||||
envId: {{ environment_id }}
|
||||
databaseId: {{ id }}
|
||||
databaseLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
updateStrategy: RollingUpdate
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
|
||||
@@ -7,6 +7,8 @@ metadata:
|
||||
namespace: {{ namespace }}
|
||||
labels:
|
||||
appLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
@@ -30,6 +32,8 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
appLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
|
||||
@@ -7,6 +7,8 @@ metadata:
|
||||
namespace: {{ namespace }}
|
||||
labels:
|
||||
appLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
@@ -26,6 +28,8 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
appLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
ownerId: {{ owner_id }}
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
|
||||
@@ -7,6 +7,8 @@ metadata:
|
||||
namespace: {{ namespace }}
|
||||
labels:
|
||||
routerLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
spec:
|
||||
acme:
|
||||
server: {{ spec_acme_server }}
|
||||
|
||||
@@ -8,6 +8,8 @@ metadata:
|
||||
labels:
|
||||
routerId: {{ id }}
|
||||
routerLongId: {{ long_id }}
|
||||
envLongId: {{ environment_long_id }}
|
||||
projectLongId: {{ project_long_id }}
|
||||
envId: {{ environment_id }}
|
||||
fqdn: "{{ router_default_domain }}"
|
||||
annotations:
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
use crate::cloud_provider::service::{Action, DatabaseService, RouterService, StatefulService, StatelessService};
|
||||
use crate::models::application::ApplicationService;
|
||||
use crate::utilities::to_short_id;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct Environment {
|
||||
namespace: String,
|
||||
pub id: String,
|
||||
pub long_id: Uuid,
|
||||
pub project_id: String,
|
||||
pub project_long_id: Uuid,
|
||||
pub owner_id: String,
|
||||
pub organization_id: String,
|
||||
pub organization_long_id: Uuid,
|
||||
pub action: Action,
|
||||
pub applications: Vec<Box<dyn ApplicationService>>,
|
||||
pub routers: Vec<Box<dyn RouterService>>,
|
||||
@@ -15,21 +20,25 @@ pub struct Environment {
|
||||
|
||||
impl Environment {
|
||||
pub fn new(
|
||||
id: &str,
|
||||
project_id: &str,
|
||||
owner_id: &str,
|
||||
organization_id: &str,
|
||||
long_id: Uuid,
|
||||
project_long_id: Uuid,
|
||||
organization_long_id: Uuid,
|
||||
action: Action,
|
||||
applications: Vec<Box<dyn ApplicationService>>,
|
||||
routers: Vec<Box<dyn RouterService>>,
|
||||
databases: Vec<Box<dyn DatabaseService>>,
|
||||
) -> Self {
|
||||
let project_id = to_short_id(&project_long_id);
|
||||
let env_id = to_short_id(&long_id);
|
||||
Environment {
|
||||
namespace: format!("{}-{}", project_id, id),
|
||||
id: id.to_string(),
|
||||
project_id: project_id.to_string(),
|
||||
owner_id: owner_id.to_string(),
|
||||
organization_id: organization_id.to_string(),
|
||||
namespace: format!("{}-{}", project_id, env_id),
|
||||
id: env_id,
|
||||
long_id,
|
||||
project_id,
|
||||
project_long_id,
|
||||
owner_id: "FAKE".to_string(),
|
||||
organization_id: to_short_id(&organization_long_id),
|
||||
organization_long_id,
|
||||
action,
|
||||
applications,
|
||||
routers,
|
||||
|
||||
@@ -333,8 +333,11 @@ pub fn default_tera_context(
|
||||
context.insert("long_id", service.long_id());
|
||||
context.insert("owner_id", environment.owner_id.as_str());
|
||||
context.insert("project_id", environment.project_id.as_str());
|
||||
context.insert("project_long_id", &environment.project_long_id);
|
||||
context.insert("organization_id", environment.organization_id.as_str());
|
||||
context.insert("organization_long_id", &environment.organization_long_id);
|
||||
context.insert("environment_id", environment.id.as_str());
|
||||
context.insert("environment_long_id", &environment.long_id);
|
||||
context.insert("region", kubernetes.region().as_str());
|
||||
context.insert("zone", kubernetes.zone());
|
||||
context.insert("name", service.name());
|
||||
|
||||
@@ -82,10 +82,9 @@ impl Display for QoveryIdentifier {
|
||||
#[derive(Serialize, Deserialize, Clone, Eq, PartialEq, Hash)]
|
||||
pub struct EnvironmentRequest {
|
||||
pub execution_id: String,
|
||||
pub id: String,
|
||||
pub owner_id: String,
|
||||
pub project_id: String,
|
||||
pub organization_id: String,
|
||||
pub long_id: Uuid,
|
||||
pub project_long_id: Uuid,
|
||||
pub organization_long_id: Uuid,
|
||||
pub action: Action,
|
||||
pub applications: Vec<Application>,
|
||||
pub routers: Vec<Router>,
|
||||
@@ -134,10 +133,9 @@ impl EnvironmentRequest {
|
||||
}
|
||||
|
||||
Ok(Environment::new(
|
||||
self.id.as_str(),
|
||||
self.project_id.as_str(),
|
||||
self.owner_id.as_str(),
|
||||
self.organization_id.as_str(),
|
||||
self.long_id,
|
||||
self.project_long_id,
|
||||
self.organization_long_id,
|
||||
self.action.to_service_action(),
|
||||
applications,
|
||||
routers,
|
||||
|
||||
@@ -101,8 +101,11 @@ impl<T: CloudProvider> Application<T> {
|
||||
context.insert("long_id", &self.long_id);
|
||||
context.insert("owner_id", environment.owner_id.as_str());
|
||||
context.insert("project_id", environment.project_id.as_str());
|
||||
context.insert("project_long_id", &environment.project_long_id);
|
||||
context.insert("organization_id", environment.organization_id.as_str());
|
||||
context.insert("organization_long_id", &environment.organization_long_id);
|
||||
context.insert("environment_id", environment.id.as_str());
|
||||
context.insert("environment_long_id", &environment.long_id);
|
||||
context.insert("region", kubernetes.region().as_str());
|
||||
context.insert("zone", kubernetes.zone());
|
||||
context.insert("name", self.name());
|
||||
|
||||
@@ -254,10 +254,9 @@ pub fn environment_3_apps_3_routers_3_databases(
|
||||
|
||||
EnvironmentRequest {
|
||||
execution_id: context.execution_id().to_string(),
|
||||
id: generate_id(),
|
||||
owner_id: generate_id(),
|
||||
project_id: generate_id(),
|
||||
organization_id: context.organization_id().to_string(),
|
||||
long_id: Uuid::new_v4(),
|
||||
project_long_id: Uuid::new_v4(),
|
||||
organization_long_id: Uuid::new_v4(),
|
||||
action: Action::Create,
|
||||
applications: vec![
|
||||
Application {
|
||||
@@ -518,21 +517,19 @@ pub fn environment_3_apps_3_routers_3_databases(
|
||||
}
|
||||
|
||||
pub fn working_minimal_environment(context: &Context, test_domain: &str) -> EnvironmentRequest {
|
||||
let suffix = generate_id();
|
||||
let application_id = generate_id();
|
||||
let application_name = format!("{}-{}", "simple-app", &suffix);
|
||||
let application_id = Uuid::new_v4();
|
||||
let application_name = to_short_id(&application_id);
|
||||
let router_name = "main".to_string();
|
||||
let application_domain = format!("{}.{}.{}", application_id, context.cluster_id(), test_domain);
|
||||
let application_domain = format!("{}.{}.{}", application_name, context.cluster_id(), test_domain);
|
||||
EnvironmentRequest {
|
||||
execution_id: context.execution_id().to_string(),
|
||||
id: generate_id(),
|
||||
owner_id: generate_id(),
|
||||
project_id: generate_id(),
|
||||
organization_id: context.organization_id().to_string(),
|
||||
long_id: application_id,
|
||||
project_long_id: Uuid::new_v4(),
|
||||
organization_long_id: Uuid::new_v4(),
|
||||
action: Action::Create,
|
||||
applications: vec![Application {
|
||||
long_id: Uuid::new_v4(),
|
||||
name: application_name,
|
||||
long_id: application_id,
|
||||
name: application_name.to_string(),
|
||||
git_url: "https://github.com/Qovery/engine-testing.git".to_string(),
|
||||
commit_id: "fc575a2f3be0b9100492c8a463bf18134a8698a5".to_string(),
|
||||
dockerfile_path: Some("Dockerfile".to_string()),
|
||||
@@ -572,7 +569,7 @@ pub fn working_minimal_environment(context: &Context, test_domain: &str) -> Envi
|
||||
custom_domains: vec![],
|
||||
routes: vec![Route {
|
||||
path: "/".to_string(),
|
||||
application_name: format!("{}-{}", "simple-app", &suffix),
|
||||
application_name: application_name.to_string(),
|
||||
}],
|
||||
sticky_sessions_enabled: false,
|
||||
}],
|
||||
@@ -587,10 +584,9 @@ pub fn database_test_environment(context: &Context) -> EnvironmentRequest {
|
||||
|
||||
EnvironmentRequest {
|
||||
execution_id: context.execution_id().to_string(),
|
||||
id: generate_id(),
|
||||
owner_id: generate_id(),
|
||||
project_id: generate_id(),
|
||||
organization_id: context.organization_id().to_string(),
|
||||
long_id: Uuid::new_v4(),
|
||||
project_long_id: Uuid::new_v4(),
|
||||
organization_long_id: Uuid::new_v4(),
|
||||
action: Action::Create,
|
||||
applications: vec![Application {
|
||||
long_id: Uuid::new_v4(),
|
||||
@@ -624,15 +620,14 @@ pub fn database_test_environment(context: &Context) -> EnvironmentRequest {
|
||||
}
|
||||
|
||||
pub fn database_test_environment_on_upgrade(context: &Context) -> EnvironmentRequest {
|
||||
let suffix = "c3dn5so3dltod3s";
|
||||
let application_name = format!("{}-{}", "simple-app", &suffix);
|
||||
let suffix = Uuid::new_v4();
|
||||
let application_name = format!("{}-{}", "simple-app", to_short_id(&suffix));
|
||||
|
||||
EnvironmentRequest {
|
||||
execution_id: context.execution_id().to_string(),
|
||||
id: "c4dn5so3dltod3s".to_string(),
|
||||
owner_id: "c5dn5so3dltod3s".to_string(),
|
||||
project_id: "c6dn5so3dltod3s".to_string(),
|
||||
organization_id: context.organization_id().to_string(),
|
||||
long_id: suffix,
|
||||
project_long_id: suffix,
|
||||
organization_long_id: Uuid::new_v4(),
|
||||
action: Action::Create,
|
||||
applications: vec![Application {
|
||||
long_id: Uuid::from_str("9d0158db-b783-4bc2-a23b-c7d9228cbe90").unwrap(),
|
||||
@@ -698,10 +693,9 @@ pub fn environnement_2_app_2_routers_1_psql(
|
||||
|
||||
EnvironmentRequest {
|
||||
execution_id: context.execution_id().to_string(),
|
||||
id: generate_id(),
|
||||
owner_id: generate_id(),
|
||||
project_id: generate_id(),
|
||||
organization_id: context.organization_id().to_string(),
|
||||
long_id: Uuid::new_v4(),
|
||||
project_long_id: Uuid::new_v4(),
|
||||
organization_long_id: Uuid::new_v4(),
|
||||
action: Action::Create,
|
||||
databases: vec![Database {
|
||||
kind: DatabaseKind::Postgresql,
|
||||
@@ -876,10 +870,9 @@ pub fn echo_app_environment(context: &Context, test_domain: &str) -> Environment
|
||||
let suffix = generate_id();
|
||||
EnvironmentRequest {
|
||||
execution_id: context.execution_id().to_string(),
|
||||
id: generate_id(),
|
||||
owner_id: generate_id(),
|
||||
project_id: generate_id(),
|
||||
organization_id: context.organization_id().to_string(),
|
||||
long_id: Uuid::new_v4(),
|
||||
project_long_id: Uuid::new_v4(),
|
||||
organization_long_id: Uuid::new_v4(),
|
||||
action: Action::Create,
|
||||
applications: vec![Application {
|
||||
long_id: Uuid::new_v4(),
|
||||
@@ -939,10 +932,9 @@ pub fn environment_only_http_server(context: &Context) -> EnvironmentRequest {
|
||||
let suffix = generate_id();
|
||||
EnvironmentRequest {
|
||||
execution_id: context.execution_id().to_string(),
|
||||
id: generate_id(),
|
||||
owner_id: generate_id(),
|
||||
project_id: generate_id(),
|
||||
organization_id: context.organization_id().to_string(),
|
||||
long_id: Uuid::new_v4(),
|
||||
project_long_id: Uuid::new_v4(),
|
||||
organization_long_id: Uuid::new_v4(),
|
||||
action: Action::Create,
|
||||
applications: vec![Application {
|
||||
long_id: Uuid::new_v4(),
|
||||
@@ -989,10 +981,9 @@ pub fn environment_only_http_server_router(context: &Context, test_domain: &str)
|
||||
let id = Uuid::new_v4();
|
||||
EnvironmentRequest {
|
||||
execution_id: context.execution_id().to_string(),
|
||||
id: generate_id(),
|
||||
owner_id: generate_id(),
|
||||
project_id: generate_id(),
|
||||
organization_id: context.organization_id().to_string(),
|
||||
long_id: Uuid::new_v4(),
|
||||
project_long_id: Uuid::new_v4(),
|
||||
organization_long_id: Uuid::new_v4(),
|
||||
action: Action::Create,
|
||||
applications: vec![Application {
|
||||
long_id: id,
|
||||
|
||||
@@ -748,7 +748,11 @@ pub fn is_pod_restarted_env(
|
||||
pod_to_check: &str,
|
||||
secrets: FuncTestsSecrets,
|
||||
) -> (bool, String) {
|
||||
let namespace_name = format!("{}-{}", &environment_check.project_id, &environment_check.id,);
|
||||
let namespace_name = format!(
|
||||
"{}-{}",
|
||||
to_short_id(&environment_check.project_long_id),
|
||||
to_short_id(&environment_check.long_id),
|
||||
);
|
||||
|
||||
let kubernetes_config = kubernetes_config_path(context, provider_kind.clone(), "/tmp", secrets.clone());
|
||||
|
||||
@@ -779,7 +783,11 @@ pub fn get_pods(
|
||||
pod_to_check: &str,
|
||||
secrets: FuncTestsSecrets,
|
||||
) -> Result<KubernetesList<KubernetesPod>, CommandError> {
|
||||
let namespace_name = format!("{}-{}", &environment_check.project_id, &environment_check.id,);
|
||||
let namespace_name = format!(
|
||||
"{}-{}",
|
||||
to_short_id(&environment_check.project_long_id),
|
||||
to_short_id(&environment_check.long_id),
|
||||
);
|
||||
|
||||
let kubernetes_config = kubernetes_config_path(context, provider_kind.clone(), "/tmp", secrets.clone());
|
||||
|
||||
@@ -847,7 +855,11 @@ pub fn get_pvc(
|
||||
environment_check: EnvironmentRequest,
|
||||
secrets: FuncTestsSecrets,
|
||||
) -> Result<PVC, CommandError> {
|
||||
let namespace_name = format!("{}-{}", &environment_check.project_id, &environment_check.id,);
|
||||
let namespace_name = format!(
|
||||
"{}-{}",
|
||||
to_short_id(&environment_check.project_long_id),
|
||||
to_short_id(&environment_check.long_id),
|
||||
);
|
||||
|
||||
let kubernetes_config = kubernetes_config_path(context, provider_kind.clone(), "/tmp", secrets.clone());
|
||||
|
||||
@@ -872,7 +884,11 @@ pub fn get_svc(
|
||||
environment_check: EnvironmentRequest,
|
||||
secrets: FuncTestsSecrets,
|
||||
) -> Result<SVC, CommandError> {
|
||||
let namespace_name = format!("{}-{}", &environment_check.project_id, &environment_check.id,);
|
||||
let namespace_name = format!(
|
||||
"{}-{}",
|
||||
to_short_id(&environment_check.project_long_id),
|
||||
to_short_id(&environment_check.long_id),
|
||||
);
|
||||
|
||||
let kubernetes_config = kubernetes_config_path(context, provider_kind.clone(), "/tmp", secrets.clone());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user