From 090e05710ba99b11ce93fd0ebc467bb6b7894a21 Mon Sep 17 00:00:00 2001 From: Craig Cooper Date: Mon, 19 Aug 2024 20:53:56 +0800 Subject: [PATCH] build: Force deployments on config change (#26) * fix: removed duplicated storages * fix: merge local and azure volume decorations * fix: merge local and aws and azure volume decorations * fix: bad jinja template typo * fix: bad jinja template typo AGAIN * fix: use old azure volume sizes as can't shrink exisiting ones * fix: restore RWO for aws * fix: don't change the provisioner * fix: correct ansible ternary syntax * chore: tidy ordering, restore non-azure sizings * feat: add checksum for CKAN ini file * feat: add checksum for CKAN ini file * fix: correct jinja syntax --- roles/ckan/templates/kubernetes/ckan.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/roles/ckan/templates/kubernetes/ckan.yaml b/roles/ckan/templates/kubernetes/ckan.yaml index 1b1f467..091e4c1 100644 --- a/roles/ckan/templates/kubernetes/ckan.yaml +++ b/roles/ckan/templates/kubernetes/ckan.yaml @@ -48,6 +48,8 @@ spec: maxSurge: 2 template: metadata: + annotations: + checksum/config: "{{ lookup('template', 'templates/ckan/ckan_production.ini') | hash('md5') }}" ## This forces a rolling deployment if the config changes creationTimestamp: null labels: app: ckan @@ -152,13 +154,7 @@ spec: value: "/usr/lib/ckan" {% endif %} image: {{ ckan_image }}:{{ ckan_image_tag }} - - -{% if fjelltopp_env_type == 'local' %} - imagePullPolicy: IfNotPresent -{% else %} - imagePullPolicy: Always -{% endif %} + imagePullPolicy: {{ (fjelltopp_env_type == 'local') | ternary('IfNotPresent', 'Always') }} name: ckan # assume local user uid @@ -175,7 +171,7 @@ spec: httpGet: path: / port: 5000 - initialDelaySeconds: 30 + initialDelaySeconds: 60 periodSeconds: 5 timeoutSeconds: 10 failureThreshold: 15 @@ -201,7 +197,6 @@ spec: - mountPath: /etc/ckan name: ckan-configs readOnly: true - {% if fjelltopp_env_type == 'local' %} - mountPath: /usr/lib/ckan name: localckan