From 91beda6fc437c1093002279393a305fce71b8dc8 Mon Sep 17 00:00:00 2001 From: apiaseck Date: Fri, 1 Nov 2024 14:11:42 +0100 Subject: [PATCH] coreos-cincinnati: Move from deprecated DeploymentConfig to Deployment First try aat move from deprecated DeploymentConfig to Deployment using staging environment. See: https://github.com/jbtrystram/coreos-hackathon/issues/13 --- .../openshift-apps/coreos-cincinnati.yml | 7 +++ .../templates/deployment.yml.j2 | 63 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 roles/openshift-apps/coreos-cincinnati/templates/deployment.yml.j2 diff --git a/playbooks/openshift-apps/coreos-cincinnati.yml b/playbooks/openshift-apps/coreos-cincinnati.yml index e109c9f455..837581e0ae 100644 --- a/playbooks/openshift-apps/coreos-cincinnati.yml +++ b/playbooks/openshift-apps/coreos-cincinnati.yml @@ -56,6 +56,13 @@ object_app: coreos-cincinnati object_template: deploymentconfig.yml object_objectname: deploymentconfig.yml + when: env == "production" + + - role: openshift/object + object_app: coreos-cincinnati + object_template: deployment.yml.j2 + object_objectname: deployment.yml + when: env == "staging" - role: openshift/rollout rollout_app: coreos-cincinnati diff --git a/roles/openshift-apps/coreos-cincinnati/templates/deployment.yml.j2 b/roles/openshift-apps/coreos-cincinnati/templates/deployment.yml.j2 new file mode 100644 index 0000000000..2810f6b643 --- /dev/null +++ b/roles/openshift-apps/coreos-cincinnati/templates/deployment.yml.j2 @@ -0,0 +1,63 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: coreos-cincinnati + name: coreos-cincinnati + annotations: + image.openshift.io/triggers: >- + [ + {"from":{"kind":"ImageStreamTag","name":"coreos-cincinnati-img:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"fcos-graph-builder\")].image","paused":false}, + {"from":{"kind":"ImageStreamTag","name":"coreos-cincinnati-img:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"fcos-policy-engine\")].image","paused":false} + ] +spec: + replicas: 1 + selector: + matchLabels: + app: coreos-cincinnati + strategy: + activeDeadlineSeconds: 21600 + recreateParams: + timeoutSeconds: 600 + resources: {} + rollingParams: + intervalSeconds: 1 + maxSurge: 25% + maxUnavailable: 25% + timeoutSeconds: 600 + updatePeriodSeconds: 1 + type: RollingUpdate + template: + metadata: + labels: + app: coreos-cincinnati + name: coreos-cincinnati + spec: + containers: + - name: fcos-graph-builder + image: "" + args: [ + "/usr/local/bin/fcos-graph-builder", + "-v", + "-c", "/etc/cincinnati/graph-builder.toml", + ] + volumeMounts: + - name: stub-config + mountPath: /etc/cincinnati/ + readOnly: true + - name: fcos-policy-engine + image: "" + args: [ + "/usr/local/bin/fcos-policy-engine", + "-v", + "-c", "/etc/cincinnati/policy-engine.toml", + ] + volumeMounts: + - name: stub-config + mountPath: /etc/cincinnati/ + readOnly: true + volumes: + - name: stub-config + configMap: + name: coreos-cincinnati-config-stub