From 37066f172f8d7dad354e367f23dfcd66144cb6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kone=C4=8Dn=C3=BD?= Date: Thu, 26 May 2022 14:37:17 +0200 Subject: [PATCH] [the-new-hotness] Add redis deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR adds redis service together with deployment config and updates the configuration of the hotness to work with this new redis deployment. This will now only work for the staging, but it doesn't break anything if deployed on production. Signed-off-by: Michal Konečný --- .../files/deploymentconfig.yml | 35 +++++++++++++++++++ .../the-new-hotness/files/imagestream.yml | 11 ++++++ .../the-new-hotness/files/service.yml | 16 +++++++++ .../the-new-hotness/templates/config.toml | 9 +++++ 4 files changed, 71 insertions(+) create mode 100644 roles/openshift-apps/the-new-hotness/files/service.yml diff --git a/roles/openshift-apps/the-new-hotness/files/deploymentconfig.yml b/roles/openshift-apps/the-new-hotness/files/deploymentconfig.yml index 63c64d0241..48597d60b3 100644 --- a/roles/openshift-apps/the-new-hotness/files/deploymentconfig.yml +++ b/roles/openshift-apps/the-new-hotness/files/deploymentconfig.yml @@ -82,5 +82,40 @@ items: namespace: the-new-hotness type: ImageChange - type: ConfigChange +- apiVersion: v1 + kind: DeploymentConfig + metadata: + labels: + app: the-new-hotness + service: the-new-hotness-redis + name: the-new-hotness-redis + spec: + replicas: 1 # Never change this to more or less than ONE! + selector: + app: the-new-hotness + deploymentconfig: the-new-hotness-redis + template: + metadata: + labels: + app: the-new-hotness + deploymentconfig: the-new-hotness-redis + spec: + containers: + - name: the-new-hotness-redis + image: the-new-hotness-redis:latest + resources: {} + env: + - name: REDIS_PASSWORD + value: "{{ hotness_redis_pass }}" + triggers: + - type: ConfigChange + - type: ImageChange + imageChangeParams: + automatic: true + containerNames: + - the-new-hotness-redis + from: + kind: ImageStreamTag + name: the-new-hotness-redis:latest kind: List metadata: {} diff --git a/roles/openshift-apps/the-new-hotness/files/imagestream.yml b/roles/openshift-apps/the-new-hotness/files/imagestream.yml index aa89c3752a..9cfe74696e 100644 --- a/roles/openshift-apps/the-new-hotness/files/imagestream.yml +++ b/roles/openshift-apps/the-new-hotness/files/imagestream.yml @@ -1,3 +1,4 @@ +--- apiVersion: v1 items: - apiVersion: v1 @@ -6,5 +7,15 @@ items: name: the-new-hotness labels: build: the-new-hotness + - apiVersion: v1 + kind: ImageStream + metadata: + name: the-new-hotness-redis + spec: + tags: + - name: latest + from: + kind: DockerImage + name: gcr.io/bitnami-containers/redis:latest kind: List metadata: {} diff --git a/roles/openshift-apps/the-new-hotness/files/service.yml b/roles/openshift-apps/the-new-hotness/files/service.yml new file mode 100644 index 0000000000..2b8fe8bd67 --- /dev/null +++ b/roles/openshift-apps/the-new-hotness/files/service.yml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: the-new-hotness + name: the-new-hotness-redis +spec: + ports: + - name: 6379-tcp + port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: the-new-hotness + deploymentconfig: the-new-hotness-redis diff --git a/roles/openshift-apps/the-new-hotness/templates/config.toml b/roles/openshift-apps/the-new-hotness/templates/config.toml index 7608198674..f4302d5f08 100644 --- a/roles/openshift-apps/the-new-hotness/templates/config.toml +++ b/roles/openshift-apps/the-new-hotness/templates/config.toml @@ -88,6 +88,15 @@ read_timeout = 15 # that failed for any reason (e.g. read timeout, DNS error, etc) requests_retries = 3 +# Redis configuration for the-new-hotness +[consumer_config.redis] +# Hostname of the redis server +hostname = "the-new-hotness-redis.the-new-hotness.svc.cluster.local" +# Port of the redis server +port = 6379 +# Password for redis server +password = "{{ hotness_redis_pass }}" + [consumer_config.bugzilla] enabled = true {% if env == "staging" %}