diff --git a/charts/chirpstack/templates/chirpstack-claim1-persistentvolumeclaim.yaml b/charts/chirpstack/templates/chirpstack-claim1-persistentvolumeclaim.yaml deleted file mode 100644 index 8a2787f4..00000000 --- a/charts/chirpstack/templates/chirpstack-claim1-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - labels: - app.kubernetes.io/component: networkServer - app.kubernetes.io/part-of: chirstack - app.kubernetes.io/version: {{ .Chart.AppVersion }} - name: chirpstack-claim1 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi diff --git a/charts/chirpstack/templates/chirpstack-deployment.yaml b/charts/chirpstack/templates/chirpstack-deployment.yaml index b8dffb39..e89b7761 100644 --- a/charts/chirpstack/templates/chirpstack-deployment.yaml +++ b/charts/chirpstack/templates/chirpstack-deployment.yaml @@ -51,25 +51,27 @@ spec: volumes: - name: vchirpstack-config configMap: - name: chirpstack-config - - name: chirpstack-claim1 - persistentVolumeClaim: - claimName: chirpstack-claim1 + name: chirpstack-config {{- if .Values.chirpstack.fetch_lorawan_device }} initContainers: - # init container is used to fetch lorawan devices and import them into the postgreSQL + # init container is used to fetch LoRaWAN devices and import them into PostgreSQL - name: fetch-lorawan-devices image: chirpstack/chirpstack:4 - command: ['sh', '-c', 'apk add --no-cache git && git clone https://github.com/brocaar/lorawan-devices /opt/lorawan-devices/repo && chirpstack -c /etc/chirpstack import-legacy-lorawan-devices-repository -d /opt/lorawan-devices/repo; sleep 60'] + command: + - sh + - -c + - | + apk add --no-cache git && \ + git clone https://github.com/brocaar/lorawan-devices /tmp/lorawan-devices && \ + chirpstack -c /etc/chirpstack import-legacy-lorawan-devices-repository -d /tmp/lorawan-devices; \ + echo "LoRaWAN devices imported" env: {{- include "kargo.environment.render" (dict "env" $.Values.chirpstack.redis.auth "context" $) | indent 12 }} - {{- include "kargo.environment.render" (dict "env" $.Values.chirpstack.postgres "context" $) | indent 12 }} + {{- include "kargo.environment.render" (dict "env" $.Values.chirpstack.postgres "context" $) | indent 12 }} securityContext: runAsUser: 0 volumeMounts: - mountPath: /etc/chirpstack name: vchirpstack-config - - mountPath: /opt/lorawan-devices - name: chirpstack-claim1 - {{- end }} + {{- end }}