From a1169d71515fe052b537471f3967a945379dc8a6 Mon Sep 17 00:00:00 2001 From: M Kundegorski Date: Thu, 28 Nov 2024 18:07:13 +0200 Subject: [PATCH] wrc141 Disable giftless debug (#45) * default env var to false * correct templating * set variable to empty, as unsetting it completely doesnt work well --- group_vars/all/all.yml | 1 + roles/ckan/templates/kubernetes/giftless.yaml | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/group_vars/all/all.yml b/group_vars/all/all.yml index 3e0a726..9a3bf27 100644 --- a/group_vars/all/all.yml +++ b/group_vars/all/all.yml @@ -112,6 +112,7 @@ use_giftless: false giftless_url: "http://{{ ckan_fqdn }}/giftless" giftless_image: "ghcr.io/fjelltopp/fjelltopp-base-images/giftless" giftless_version: "v0.4.0-fjelltopp" +giftless_debug: "false" #set to literal "true" to enable # Google analytics ckan_googleanalytics_enable: false diff --git a/roles/ckan/templates/kubernetes/giftless.yaml b/roles/ckan/templates/kubernetes/giftless.yaml index e711c96..fdfc331 100644 --- a/roles/ckan/templates/kubernetes/giftless.yaml +++ b/roles/ckan/templates/kubernetes/giftless.yaml @@ -19,7 +19,7 @@ type: Opaque --- apiVersion: apps/v1 kind: Deployment -metadata: +metadata: name: giftless annotations: reloader.stakater.com/auto: "true" @@ -29,11 +29,11 @@ spec: strategy: type: Recreate selector: - matchLabels: + matchLabels: app: giftless template: metadata: - labels: + labels: app: giftless spec: containers: @@ -51,8 +51,13 @@ spec: - --http - 0.0.0.0:5001 env: +{% if giftless_debug == 'true' %} - name: GIFTLESS_DEBUG value: "1" +{% else %} + - name: GIFTLESS_DEBUG + value: "" +{% endif %} - name: GIFTLESS_CONFIG_FILE value: /app/giftless.yaml image: "{{ giftless_image }}:{{ giftless_version }}" @@ -80,7 +85,7 @@ spec: --- apiVersion: v1 kind: Service -metadata: +metadata: name: giftless {% if fjelltopp_env_type != 'local' and giftless_s3_bucket is defined %} annotations: @@ -88,7 +93,7 @@ metadata: service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{ certificate_acm.certificates[0].certificate_arn }} service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "giftless-http" {% endif %} -{% if giftless_azure_blob_string is defined %} +{% if giftless_azure_blob_string is defined %} annotations: service.beta.kubernetes.io/azure-load-balancer-internal: "true" service.beta.kubernetes.io/azure-pls-create: "true" @@ -98,13 +103,11 @@ metadata: service.beta.kubernetes.io/azure-pls-visibility: "*" {% endif %} spec: -{% if giftless_azure_blob_string is defined %} +{% if giftless_azure_blob_string is defined %} type: LoadBalancer {% endif %} ports: - name: 'giftless-http' port: 5001 - selector: + selector: app: giftless - -