diff --git a/environment-promotion/base/deployment.yml b/environment-promotion/base/deployment.yml index beda4e4..b594dce 100644 --- a/environment-promotion/base/deployment.yml +++ b/environment-promotion/base/deployment.yml @@ -24,4 +24,7 @@ spec: env: - name: REGION value: "us" + envFrom: + - configMapRef: + name: example-configmap diff --git a/environment-promotion/envs/prod/application.properties b/environment-promotion/envs/prod/application.properties new file mode 100644 index 0000000..755fc26 --- /dev/null +++ b/environment-promotion/envs/prod/application.properties @@ -0,0 +1,7 @@ +UI_THEME=dark +CACHE_SIZE=1024kb +PAGE_LIMIT=25 +SORTING=ascending +N_BUCKETS=12 + + \ No newline at end of file diff --git a/environment-promotion/envs/prod/kustomization.yml b/environment-promotion/envs/prod/kustomization.yml index 36fb2fd..fd9966e 100644 --- a/environment-promotion/envs/prod/kustomization.yml +++ b/environment-promotion/envs/prod/kustomization.yml @@ -14,6 +14,12 @@ patchesStrategicMerge: - deployment.yml - version.yml - replicas.yml -- settings.yml - service.yml + +configMapGenerator: +- name: example-configmap + behavior: merge + envs: + - application.properties + diff --git a/environment-promotion/envs/prod/settings.yml b/environment-promotion/envs/prod/settings.yml deleted file mode 100644 index 2b94ef8..0000000 --- a/environment-promotion/envs/prod/settings.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: simple-deployment -spec: - template: - spec: - containers: - - name: webserver-simple - env: - - name: UI_THEME - value: "dark" - - name: CACHE_SIZE - value: "1024kb" - - name: PAGE_LIMIT - value: "25" - - name: SORTING - value: "ascending" - - name: N_BUCKETS - value: "12" diff --git a/environment-promotion/envs/qa/application.properties b/environment-promotion/envs/qa/application.properties index 4e5bfa3..89f3e64 100644 --- a/environment-promotion/envs/qa/application.properties +++ b/environment-promotion/envs/qa/application.properties @@ -1,2 +1,5 @@ -SHARED=QA -EXTRA=QA \ No newline at end of file +UI_THEME=light +CACHE_SIZE=2048kb +PAGE_LIMIT=25 +SORTING=ascending +N_BUCKETS=42 \ No newline at end of file diff --git a/environment-promotion/envs/qa/kustomization.yml b/environment-promotion/envs/qa/kustomization.yml index 14bb60a..6ea3378 100644 --- a/environment-promotion/envs/qa/kustomization.yml +++ b/environment-promotion/envs/qa/kustomization.yml @@ -13,7 +13,6 @@ components: patchesStrategicMerge: - deployment.yml - version.yml -- settings.yml - service.yml configMapGenerator: diff --git a/environment-promotion/envs/qa/settings.yml b/environment-promotion/envs/qa/settings.yml deleted file mode 100644 index 738a5be..0000000 --- a/environment-promotion/envs/qa/settings.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: simple-deployment -spec: - template: - spec: - containers: - - name: webserver-simple - env: - - name: UI_THEME - value: "light" - - name: CACHE_SIZE - value: "2048kb" - - name: PAGE_LIMIT - value: "25" - - name: SORTING - value: "ascending" - - name: N_BUCKETS - value: "42" \ No newline at end of file diff --git a/environment-promotion/envs/staging/application.properties b/environment-promotion/envs/staging/application.properties index 9bd9e2f..5b57031 100644 --- a/environment-promotion/envs/staging/application.properties +++ b/environment-promotion/envs/staging/application.properties @@ -1,2 +1,7 @@ -SHARED=STAGING -EXTRA=STAGING \ No newline at end of file +UI_THEME=light +CACHE_SIZE=1024kb +PAGE_LIMIT=25 +SORTING=ascending +N_BUCKETS=24 + + \ No newline at end of file diff --git a/environment-promotion/envs/staging/kustomization.yml b/environment-promotion/envs/staging/kustomization.yml index 3b73698..df48c07 100644 --- a/environment-promotion/envs/staging/kustomization.yml +++ b/environment-promotion/envs/staging/kustomization.yml @@ -14,7 +14,6 @@ patchesStrategicMerge: - deployment.yml - version.yml - replicas.yml -- settings.yml - service.yml configMapGenerator: diff --git a/environment-promotion/envs/staging/settings.yml b/environment-promotion/envs/staging/settings.yml deleted file mode 100644 index 400ffc9..0000000 --- a/environment-promotion/envs/staging/settings.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: simple-deployment -spec: - template: - spec: - containers: - - name: webserver-simple - env: - - name: UI_THEME - value: "light" - - name: CACHE_SIZE - value: "1024kb" - - name: PAGE_LIMIT - value: "25" - - name: SORTING - value: "ascending" - - name: N_BUCKETS - value: "24" \ No newline at end of file diff --git a/environment-promotion/qa.yml b/environment-promotion/qa.yml deleted file mode 100644 index 3b4c334..0000000 --- a/environment-promotion/qa.yml +++ /dev/null @@ -1,77 +0,0 @@ -apiVersion: v1 -data: - EXTRA: QA - LAST: NO_PROD - SHARED: QA -kind: ConfigMap -metadata: - name: qa-example-configmap-hhg557gbcf - namespace: qa ---- -apiVersion: v1 -kind: Service -metadata: - name: qa-simple-service - namespace: qa -spec: - ports: - - name: qa-port - nodePort: 31000 - port: 8080 - protocol: TCP - - name: internal-port - port: 80 - protocol: TCP - targetPort: 8080 - selector: - app: trivial-go-web-app - type: NodePort ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - codefresh.io/app: simple-go-app - name: qa-simple-deployment - namespace: qa -spec: - replicas: 3 - selector: - matchLabels: - app: trivial-go-web-app - template: - metadata: - labels: - app: trivial-go-web-app - spec: - containers: - - env: - - name: UI_THEME - value: light - - name: CACHE_SIZE - value: 2048kb - - name: PAGE_LIMIT - value: "25" - - name: SORTING - value: ascending - - name: N_BUCKETS - value: "42" - - name: ENV - value: qa - - name: GPU_ENABLED - value: "0" - - name: ENV_TYPE - value: non-prod - - name: PAYPAL_URL - value: staging2.paypal.com - - name: DB_USER - value: non-prod-user - - name: DB_PASSWORD - value: non-prod-password - - name: REGION - value: us - image: docker.io/kostiscodefresh/simple-env-app:3.0 - imagePullPolicy: Always - name: webserver-simple - ports: - - containerPort: 8080 diff --git a/environment-promotion/variants/non-prod/application.properties b/environment-promotion/variants/non-prod/application.properties index d97beec..b35c55a 100644 --- a/environment-promotion/variants/non-prod/application.properties +++ b/environment-promotion/variants/non-prod/application.properties @@ -1,2 +1,4 @@ -SHARED=NO_PROD -LAST=NO_PROD \ No newline at end of file +ENV_TYPE=non-prod +PAYPAL_URL=staging2.paypal.com +DB_USER=non-prod-user +DB_PASSWORD=non-prod-password \ No newline at end of file diff --git a/environment-promotion/variants/non-prod/kustomization.yml b/environment-promotion/variants/non-prod/kustomization.yml index cc775f3..1f2c5b7 100644 --- a/environment-promotion/variants/non-prod/kustomization.yml +++ b/environment-promotion/variants/non-prod/kustomization.yml @@ -2,7 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1alpha1 kind: Component patchesStrategicMerge: -- non-prod.yml - replicas.yml diff --git a/environment-promotion/variants/non-prod/non-prod.yml b/environment-promotion/variants/non-prod/non-prod.yml deleted file mode 100644 index 9d64dbd..0000000 --- a/environment-promotion/variants/non-prod/non-prod.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: simple-deployment -spec: - template: - spec: - containers: - - name: webserver-simple - env: - - name: ENV_TYPE - value: "non-prod" - - name: PAYPAL_URL - value: "staging2.paypal.com" - - name: DB_USER - value: "non-prod-user" - - name: DB_PASSWORD - value: "non-prod-password" \ No newline at end of file diff --git a/environment-promotion/variants/prod/application.properties b/environment-promotion/variants/prod/application.properties new file mode 100644 index 0000000..17b1204 --- /dev/null +++ b/environment-promotion/variants/prod/application.properties @@ -0,0 +1,6 @@ +ENV_TYPE=production +PAYPAL_URL=production.paypal.com +DB_USER=prod_username +DB_PASSWORD=prod_password + + diff --git a/environment-promotion/variants/prod/kustomization.yml b/environment-promotion/variants/prod/kustomization.yml index 5822fb3..7bee6b7 100644 --- a/environment-promotion/variants/prod/kustomization.yml +++ b/environment-promotion/variants/prod/kustomization.yml @@ -4,3 +4,7 @@ kind: Component patchesStrategicMerge: - prod.yml +configMapGenerator: +- name: example-configmap + envs: + - application.properties diff --git a/environment-promotion/variants/prod/prod.yml b/environment-promotion/variants/prod/prod.yml index 723be91..ae9a3ac 100644 --- a/environment-promotion/variants/prod/prod.yml +++ b/environment-promotion/variants/prod/prod.yml @@ -7,16 +7,7 @@ spec: template: spec: containers: - - name: webserver-simple - env: - - name: ENV_TYPE - value: "production" - - name: PAYPAL_URL - value: "production.paypal.com" - - name: DB_USER - value: "prod_username" - - name: DB_PASSWORD - value: "prod_password" + - name: webserver-simple livenessProbe: httpGet: path: /health