From c83675585ad64673b0ca7d438e262a903afc3511 Mon Sep 17 00:00:00 2001 From: Petr Hracek Date: Wed, 7 Feb 2024 09:30:34 +0100 Subject: [PATCH] Migrate from DeploymentConfig -> Deployment --- openshift/deployment.yml | 52 ++++++++++++------------- openshift/templates/flower.yml | 6 ++- openshift/templates/redis-commander.yml | 6 ++- openshift/templates/redis.yml | 6 ++- 4 files changed, 36 insertions(+), 34 deletions(-) diff --git a/openshift/deployment.yml b/openshift/deployment.yml index 4977f05..fc278de 100644 --- a/openshift/deployment.yml +++ b/openshift/deployment.yml @@ -1,10 +1,30 @@ --- -apiVersion: apps.openshift.io/v1 -kind: DeploymentConfig +apiVersion: apps/v1 +kind: Deployment metadata: labels: io.openshift.tags: bot-betka-fedora + app: bot-betka-fedora + template: bot-betka-fedora name: bot-betka-fedora + annotations: + template.alpha.openshift.io/wait-for-ready: "true" + image.openshift.io/triggers: |- + [ + { + "from": { + "kind": "ImageStreamTag", + "name": "bot-betka-fedora:latest" + }, + "fieldPath": "spec.template.spec.containers[0].image" + }, + { + "from": { + "kind": "ImageStreamTag", + "name": "cwt-generator:latest" + } + } + ] spec: template: metadata: @@ -14,7 +34,7 @@ spec: containers: - name: bot-betka-fedora # get latest from image stream - image: bot-betka-fedora:latest + image: " " env: - name: GITLAB_API_TOKEN valueFrom: @@ -77,32 +97,8 @@ spec: persistentVolumeClaim: claimName: claim.betka restartPolicy: Always - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - # 'automatic: false' means disable trigger (@ prod) - # 'automatic: true' means enable trigger (@ stage) - # This is all you have to change (to true) to enable CD - automatic: true - containerNames: - - bot-betka-fedora - from: - kind: ImageStreamTag - name: 'bot-betka-fedora:latest' - - type: ImageChange - imageChangeParams: - # 'automatic: false' means disable trigger (@ prod) - # 'automatic: true' means enable trigger (@ stage) - # This is all you have to change (to true) to enable CD - automatic: true - containerNames: - - cwt-generator - from: - kind: ImageStreamTag - name: 'cwt-generator:latest' replicas: 1 strategy: - type: Rolling + type: RollingUpdate rollingParams: intervalSeconds: 1 diff --git a/openshift/templates/flower.yml b/openshift/templates/flower.yml index 6e29767..5052c86 100644 --- a/openshift/templates/flower.yml +++ b/openshift/templates/flower.yml @@ -1,6 +1,6 @@ --- -kind: DeploymentConfig -apiVersion: apps.openshift.io/v1 +kind: Deployment +apiVersion: apps/v1 metadata: name: flower labels: @@ -8,6 +8,8 @@ metadata: spec: selector: service: flower + matchLabels: + name: flower template: metadata: labels: diff --git a/openshift/templates/redis-commander.yml b/openshift/templates/redis-commander.yml index a9c2d47..673dd55 100644 --- a/openshift/templates/redis-commander.yml +++ b/openshift/templates/redis-commander.yml @@ -1,6 +1,6 @@ --- -kind: DeploymentConfig -apiVersion: apps.openshift.io/v1 +kind: Deployment +apiVersion: apps/v1 metadata: name: redis-commander labels: @@ -8,6 +8,8 @@ metadata: spec: selector: service: redis-commander + matchLabels: + name: redis-commander template: metadata: labels: diff --git a/openshift/templates/redis.yml b/openshift/templates/redis.yml index 8a78b5f..f49ab61 100644 --- a/openshift/templates/redis.yml +++ b/openshift/templates/redis.yml @@ -1,6 +1,6 @@ --- -kind: DeploymentConfig -apiVersion: apps.openshift.io/v1 +kind: Deployment +apiVersion: apps/v1 metadata: name: redis labels: @@ -8,6 +8,8 @@ metadata: spec: selector: service: redis + matchLabels: + name: redis template: metadata: labels: