Skip to content

Commit 46e0adc

Browse files
committed
Added checksums to configmaps.
1 parent 22f3210 commit 46e0adc

File tree

9 files changed

+66
-0
lines changed

9 files changed

+66
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Made existing context settings configurable (`context`, `context_estimated_count`, `context_estimated_cost`, `context_stats_ttl`)
1515
- Automatic queue processor CronJob created when `use_queue` is "true" (configurable schedule via `queueProcessor.schedule`)
1616
- Automatic extent updater CronJob created when `update_collection_extent` is "false" (configurable schedule via `extentUpdater.schedule`)
17+
- Added ConfigMap checksum annotations to automatically restart pods when configuration changes [#344](https://github.com/developmentseed/eoapi-k8s/pull/344)
1718

1819
### Changed
1920

charts/eoapi/templates/services/multidim/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ spec:
2929
app: {{ .Release.Name }}-multidim
3030
template:
3131
metadata:
32+
annotations:
33+
checksum/config: {{ include (print $.Template.BasePath "/services/multidim/configmap.yaml") . | sha256sum }}
3234
labels:
3335
{{- include "eoapi.selectorLabels" . | nindent 8 }}
3436
app.kubernetes.io/component: multidim

charts/eoapi/templates/services/raster/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ spec:
2929
app: {{ .Release.Name }}-raster
3030
template:
3131
metadata:
32+
annotations:
33+
checksum/config: {{ include (print $.Template.BasePath "/services/raster/configmap.yaml") . | sha256sum }}
3234
labels:
3335
{{- include "eoapi.selectorLabels" . | nindent 8 }}
3436
app.kubernetes.io/component: raster

charts/eoapi/templates/services/stac/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ spec:
2929
app: {{ .Release.Name }}-stac
3030
template:
3131
metadata:
32+
annotations:
33+
checksum/config: {{ include (print $.Template.BasePath "/services/stac/configmap.yaml") . | sha256sum }}
3234
labels:
3335
{{- include "eoapi.selectorLabels" . | nindent 8 }}
3436
app.kubernetes.io/component: stac

charts/eoapi/templates/services/vector/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ spec:
2929
app: {{ .Release.Name }}-vector
3030
template:
3131
metadata:
32+
annotations:
33+
checksum/config: {{ include (print $.Template.BasePath "/services/vector/configmap.yaml") . | sha256sum }}
3234
labels:
3335
{{- include "eoapi.selectorLabels" . | nindent 8 }}
3436
app.kubernetes.io/component: vector

charts/eoapi/tests/multidim_tests.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ tests:
3838
path: metadata.labels.gitsha
3939
value: "ABC123"
4040

41+
- it: "multidim deployment includes configmap checksum annotation"
42+
set:
43+
multidim.enabled: true
44+
stac.enabled: false
45+
raster.enabled: false
46+
vector.enabled: false
47+
template: templates/services/multidim/deployment.yaml
48+
asserts:
49+
- exists:
50+
path: spec.template.metadata.annotations["checksum/config"]
51+
- matchRegex:
52+
path: spec.template.metadata.annotations["checksum/config"]
53+
pattern: ^[a-f0-9]{64}$
54+
4155
- it: "multidim configmap defaults"
4256
set:
4357
raster.enabled: false

charts/eoapi/tests/raster_tests.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ tests:
3434
- equal:
3535
path: spec.template.spec.containers[0].resources.requests.memory
3636
value: "3072Mi"
37+
38+
- it: "raster deployment includes configmap checksum annotation"
39+
set:
40+
raster.enabled: true
41+
stac.enabled: false
42+
vector.enabled: false
43+
multidim.enabled: false
44+
gitSha: "ABC123"
45+
template: templates/services/raster/deployment.yaml
46+
asserts:
47+
- exists:
48+
path: spec.template.metadata.annotations["checksum/config"]
49+
- matchRegex:
50+
path: spec.template.metadata.annotations["checksum/config"]
51+
pattern: ^[a-f0-9]{64}$
3752
- equal:
3853
path: metadata.labels.gitsha
3954
value: "ABC123"

charts/eoapi/tests/stac_tests.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ tests:
3838
path: metadata.labels.gitsha
3939
value: "ABC123"
4040

41+
- it: "stac deployment includes configmap checksum annotation"
42+
set:
43+
stac.enabled: true
44+
raster.enabled: false
45+
vector.enabled: false
46+
multidim.enabled: false
47+
template: templates/services/stac/deployment.yaml
48+
asserts:
49+
- exists:
50+
path: spec.template.metadata.annotations["checksum/config"]
51+
- matchRegex:
52+
path: spec.template.metadata.annotations["checksum/config"]
53+
pattern: ^[a-f0-9]{64}$
54+
4155
- it: "stac configmap defaults"
4256
set:
4357
raster.enabled: false

charts/eoapi/tests/vector_tests.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ tests:
3939
path: metadata.labels.gitsha
4040
value: "ABC123"
4141

42+
- it: "vector deployment includes configmap checksum annotation"
43+
set:
44+
vector.enabled: true
45+
stac.enabled: false
46+
raster.enabled: false
47+
multidim.enabled: false
48+
template: templates/services/vector/deployment.yaml
49+
asserts:
50+
- exists:
51+
path: spec.template.metadata.annotations["checksum/config"]
52+
- matchRegex:
53+
path: spec.template.metadata.annotations["checksum/config"]
54+
pattern: ^[a-f0-9]{64}$
55+
4256
- it: "vector configmap defaults"
4357
set:
4458
raster.enabled: false

0 commit comments

Comments
 (0)