Skip to content
Snippets Groups Projects
Commit 860869a1 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

using custom redis image in deployment

parent 948afe28
Branches
No related tags found
1 merge request!1995Resolve "Make MetaGer Pods shutdown gracefully"
......@@ -5,6 +5,7 @@ variables:
DOCKER_FPM_IMAGE_NAME: fpm
DOCKER_NGINX_IMAGE_NAME: nginx
DOCKER_NODE_IMAGE_NAME: node
DOCKER_REDIS_IMAGE_NAME: redis
KUBE_NAMESPACE: metager-2
workflow:
......@@ -18,6 +19,7 @@ workflow:
DOCKER_FPM_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
DOCKER_NGINX_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
DOCKER_NODE_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
DOCKER_REDIS_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
HELM_RELEASE_NAME: review-$DOCKER_IMAGE_TAG_PREFIX
- if: $CI_COMMIT_BRANCH == "master"
variables:
......@@ -28,6 +30,7 @@ workflow:
DOCKER_FPM_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
DOCKER_NGINX_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
DOCKER_NODE_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
DOCKER_REDIS_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
HELM_RELEASE_NAME: $DOCKER_IMAGE_TAG_PREFIX
- if: $CI_COMMIT_BRANCH == "development"
variables:
......@@ -38,6 +41,7 @@ workflow:
DOCKER_FPM_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
DOCKER_NGINX_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
DOCKER_NODE_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
DOCKER_REDIS_IMAGE_TAG: $DOCKER_IMAGE_TAG_PREFIX-$CI_COMMIT_SHA
HELM_RELEASE_NAME: $DOCKER_IMAGE_TAG_PREFIX
stages:
......
......@@ -33,6 +33,19 @@ nginx:
after_script:
- docker logout $CI_REGISTRY
redis:
stage: build_docker_images
image: $BUILD_DOCKER_IMAGE
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- cd build/redis
- docker build --network=host
-t ${CI_REGISTRY_IMAGE}/$DOCKER_REDIS_IMAGE_NAME:$DOCKER_REDIS_IMAGE_TAG .
- docker push ${CI_REGISTRY_IMAGE}/$DOCKER_REDIS_IMAGE_NAME:$DOCKER_REDIS_IMAGE_TAG
after_script:
- docker logout $CI_REGISTRY
.cleanup_revision_images:
stage: build_docker_images
image: $DEPLOY_KUBERNETES_IMAGE
......
......@@ -11,5 +11,6 @@ helm -n $KUBE_NAMESPACE upgrade --install \
--set ingress.hosts[0].host="$DEPLOYMENT_URL" \
--set image.fpm.tag=$DOCKER_FPM_IMAGE_TAG \
--set image.nginx.tag=$DOCKER_NGINX_IMAGE_TAG \
--set image.redis.tag=$DOCKER_REDIS_IMAGE_TAG \
--set app_url=$APP_URL \
--wait
\ No newline at end of file
......@@ -73,6 +73,14 @@ Create the name of the service account to use
{{- end -}}
{{- end -}}
{{- define "redis_image" -}}
{{- if eq .Values.image.redis.tag "" -}}
{{- .Values.image.redis.repository -}}
{{- else -}}
{{- printf "%s:%s" .Values.image.redis.repository .Values.image.redis.tag -}}
{{- end -}}
{{- end -}}
{{- define "secret_name" -}}
{{- printf "%s" .Release.Name }}
{{- end -}}
\ No newline at end of file
......@@ -214,7 +214,7 @@ spec:
memory: 100M
limits:
- name: redis
image: "redis:6"
image: "{{ template "redis_image" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
volumeMounts:
......
......@@ -16,6 +16,11 @@ image:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
redis:
repository: registry.metager.de/open-source/metager/redis
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []
nameOverride: ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment