Skip to content

Commit d3c1841

Browse files
authored
Replace bitnami memcached images with community images (#571)
* Replace bitnami memcached images with community images Signed-off-by: Tom Hayward <thayward@infoblox.com> * update readme Signed-off-by: Tom Hayward <thayward@infoblox.com> * configure memcached with args Signed-off-by: Tom Hayward <thayward@infoblox.com> * improve changelog Signed-off-by: Tom Hayward <thayward@infoblox.com> --------- Signed-off-by: Tom Hayward <thayward@infoblox.com>
1 parent 4fe7991 commit d3c1841

File tree

5 files changed

+98
-60
lines changed

5 files changed

+98
-60
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## master / unreleased
44

5+
* [CHANGE] Replace bitnami images with community images. Config via .extraEnvVars must be migrated to .args. See memcached docs for standard args. #571
56
* [CHANGE] Memcacheds are now enabled by default #551
67
* [CHANGE] Change default config: distributors, rulers, queriers, query-frontend, nginx and compactors can be disrupted until 30%
78
* [CHANGE] Remove startup probes from compactors from default values. It's not recommended in general #542

README.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -383,41 +383,57 @@ Kubernetes: `^1.19.0-0`
383383
| memberlist.&ZeroWidthSpace;service.&ZeroWidthSpace;annotations | object | `{}` | |
384384
| memberlist.&ZeroWidthSpace;service.&ZeroWidthSpace;labels | object | `{}` | |
385385
| memcached-blocks-index.&ZeroWidthSpace;architecture | string | `"high-availability"` | |
386+
| memcached-blocks-index.&ZeroWidthSpace;args | list | `["-m 1024"]` | Command line argument supplied to memcached |
387+
| memcached-blocks-index.&ZeroWidthSpace;args[0] | string | `"-m 1024"` | The amount of memory allocated to memcached for object storage |
388+
| memcached-blocks-index.&ZeroWidthSpace;disableValidation | bool | `false` | Bypass validation of the memcached configuration in case a custom image is in use |
386389
| memcached-blocks-index.&ZeroWidthSpace;enabled | bool | `true` | Enables support for block index caching |
387-
| memcached-blocks-index.&ZeroWidthSpace;extraEnvVars[0] | object | `{"name":"MEMCACHED_CACHE_SIZE","value":"1024"}` | MEMCACHED_CACHE_SIZE is the amount of memory allocated to memcached for object storage |
388-
| memcached-blocks-index.&ZeroWidthSpace;extraEnvVars[1] | object | `{"name":"MEMCACHED_MAX_CONNECTIONS","value":"1024"}` | MEMCACHED_MAX_CONNECTIONS is the maximum number of simultaneous connections to the memcached service |
389-
| memcached-blocks-index.&ZeroWidthSpace;extraEnvVars[2] | object | `{"name":"MEMCACHED_THREADS","value":"4"}` | MEMCACHED_THREADS is the number of threads to use when processing incoming requests. By default, memcached is configured to use 4 concurrent threads. The threading improves the performance of storing and retrieving data in the cache, using a locking system to prevent different threads overwriting or updating the same values. |
390+
| memcached-blocks-index.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"memcached"` | |
391+
| memcached-blocks-index.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"1.6.39"` | |
390392
| memcached-blocks-index.&ZeroWidthSpace;metrics.&ZeroWidthSpace;enabled | bool | `true` | |
393+
| memcached-blocks-index.&ZeroWidthSpace;metrics.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"prom/memcached-exporter"` | |
394+
| memcached-blocks-index.&ZeroWidthSpace;metrics.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"v0.15.4"` | |
391395
| memcached-blocks-index.&ZeroWidthSpace;metrics.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;enabled | bool | `false` | |
392396
| memcached-blocks-index.&ZeroWidthSpace;replicaCount | int | `2` | |
393397
| memcached-blocks-index.&ZeroWidthSpace;resources | object | `{}` | |
394398
| memcached-blocks-index.&ZeroWidthSpace;service.&ZeroWidthSpace;clusterIP | string | `"None"` | |
395399
| memcached-blocks-metadata.&ZeroWidthSpace;architecture | string | `"high-availability"` | |
400+
| memcached-blocks-metadata.&ZeroWidthSpace;args | list | `["-m 1024"]` | Command line argument supplied to memcached |
401+
| memcached-blocks-metadata.&ZeroWidthSpace;args[0] | string | `"-m 1024"` | The amount of memory allocated to memcached for object storage |
402+
| memcached-blocks-metadata.&ZeroWidthSpace;disableValidation | bool | `false` | Bypass validation of the memcached configuration in case a custom image is in use |
396403
| memcached-blocks-metadata.&ZeroWidthSpace;enabled | bool | `true` | Enables support for block metadata caching |
397-
| memcached-blocks-metadata.&ZeroWidthSpace;extraEnvVars[0] | object | `{"name":"MEMCACHED_CACHE_SIZE","value":"1024"}` | MEMCACHED_CACHE_SIZE is the amount of memory allocated to memcached for object storage |
398-
| memcached-blocks-metadata.&ZeroWidthSpace;extraEnvVars[1] | object | `{"name":"MEMCACHED_MAX_CONNECTIONS","value":"1024"}` | MEMCACHED_MAX_CONNECTIONS is the maximum number of simultaneous connections to the memcached service |
399-
| memcached-blocks-metadata.&ZeroWidthSpace;extraEnvVars[2] | object | `{"name":"MEMCACHED_THREADS","value":"4"}` | MEMCACHED_THREADS is the number of threads to use when processing incoming requests. By default, memcached is configured to use 4 concurrent threads. The threading improves the performance of storing and retrieving data in the cache, using a locking system to prevent different threads overwriting or updating the same values. |
404+
| memcached-blocks-metadata.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"memcached"` | |
405+
| memcached-blocks-metadata.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"1.6.39"` | |
400406
| memcached-blocks-metadata.&ZeroWidthSpace;metrics.&ZeroWidthSpace;enabled | bool | `true` | |
407+
| memcached-blocks-metadata.&ZeroWidthSpace;metrics.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"prom/memcached-exporter"` | |
408+
| memcached-blocks-metadata.&ZeroWidthSpace;metrics.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"v0.15.4"` | |
401409
| memcached-blocks-metadata.&ZeroWidthSpace;metrics.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;enabled | bool | `false` | |
402410
| memcached-blocks-metadata.&ZeroWidthSpace;replicaCount | int | `2` | |
403411
| memcached-blocks-metadata.&ZeroWidthSpace;resources | object | `{}` | |
404412
| memcached-blocks-metadata.&ZeroWidthSpace;service.&ZeroWidthSpace;clusterIP | string | `"None"` | |
405413
| memcached-blocks.&ZeroWidthSpace;architecture | string | `"high-availability"` | |
414+
| memcached-blocks.&ZeroWidthSpace;args | list | `["-m 1024"]` | Command line argument supplied to memcached |
415+
| memcached-blocks.&ZeroWidthSpace;args[0] | string | `"-m 1024"` | The amount of memory allocated to memcached for object storage |
416+
| memcached-blocks.&ZeroWidthSpace;disableValidation | bool | `false` | Bypass validation of the memcached configuration in case a custom image is in use |
406417
| memcached-blocks.&ZeroWidthSpace;enabled | bool | `true` | Enables support for block caching |
407-
| memcached-blocks.&ZeroWidthSpace;extraEnvVars[0] | object | `{"name":"MEMCACHED_CACHE_SIZE","value":"1024"}` | MEMCACHED_CACHE_SIZE is the amount of memory allocated to memcached for object storage |
408-
| memcached-blocks.&ZeroWidthSpace;extraEnvVars[1] | object | `{"name":"MEMCACHED_MAX_CONNECTIONS","value":"1024"}` | MEMCACHED_MAX_CONNECTIONS is the maximum number of simultaneous connections to the memcached service |
409-
| memcached-blocks.&ZeroWidthSpace;extraEnvVars[2] | object | `{"name":"MEMCACHED_THREADS","value":"4"}` | MEMCACHED_THREADS is the number of threads to use when processing incoming requests. By default, memcached is configured to use 4 concurrent threads. The threading improves the performance of storing and retrieving data in the cache, using a locking system to prevent different threads overwriting or updating the same values. |
418+
| memcached-blocks.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"memcached"` | |
419+
| memcached-blocks.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"1.6.39"` | |
410420
| memcached-blocks.&ZeroWidthSpace;metrics.&ZeroWidthSpace;enabled | bool | `true` | |
421+
| memcached-blocks.&ZeroWidthSpace;metrics.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"prom/memcached-exporter"` | |
422+
| memcached-blocks.&ZeroWidthSpace;metrics.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"v0.15.4"` | |
411423
| memcached-blocks.&ZeroWidthSpace;metrics.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;enabled | bool | `false` | |
412424
| memcached-blocks.&ZeroWidthSpace;replicaCount | int | `2` | |
413425
| memcached-blocks.&ZeroWidthSpace;resources | object | `{}` | |
414426
| memcached-blocks.&ZeroWidthSpace;service.&ZeroWidthSpace;clusterIP | string | `"None"` | |
415427
| memcached-frontend.&ZeroWidthSpace;architecture | string | `"high-availability"` | |
428+
| memcached-frontend.&ZeroWidthSpace;args | list | `["-m 1024"]` | Command line argument supplied to memcached |
429+
| memcached-frontend.&ZeroWidthSpace;args[0] | string | `"-m 1024"` | The amount of memory allocated to memcached for object storage |
430+
| memcached-frontend.&ZeroWidthSpace;disableValidation | bool | `false` | Bypass validation of the memcached configuration in case a custom image is in use |
416431
| memcached-frontend.&ZeroWidthSpace;enabled | bool | `true` | Enables support for caching queries in the frontend |
417-
| memcached-frontend.&ZeroWidthSpace;extraEnvVars[0] | object | `{"name":"MEMCACHED_CACHE_SIZE","value":"1024"}` | MEMCACHED_CACHE_SIZE is the amount of memory allocated to memcached for object storage |
418-
| memcached-frontend.&ZeroWidthSpace;extraEnvVars[1] | object | `{"name":"MEMCACHED_MAX_CONNECTIONS","value":"1024"}` | MEMCACHED_MAX_CONNECTIONS is the maximum number of simultaneous connections to the memcached service |
419-
| memcached-frontend.&ZeroWidthSpace;extraEnvVars[2] | object | `{"name":"MEMCACHED_THREADS","value":"4"}` | MEMCACHED_THREADS is the number of threads to use when processing incoming requests. By default, memcached is configured to use 4 concurrent threads. The threading improves the performance of storing and retrieving data in the cache, using a locking system to prevent different threads overwriting or updating the same values. |
432+
| memcached-frontend.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"memcached"` | |
433+
| memcached-frontend.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"1.6.39"` | |
420434
| memcached-frontend.&ZeroWidthSpace;metrics.&ZeroWidthSpace;enabled | bool | `true` | |
435+
| memcached-frontend.&ZeroWidthSpace;metrics.&ZeroWidthSpace;image.&ZeroWidthSpace;repository | string | `"prom/memcached-exporter"` | |
436+
| memcached-frontend.&ZeroWidthSpace;metrics.&ZeroWidthSpace;image.&ZeroWidthSpace;tag | string | `"v0.15.4"` | |
421437
| memcached-frontend.&ZeroWidthSpace;metrics.&ZeroWidthSpace;serviceMonitor.&ZeroWidthSpace;enabled | bool | `false` | |
422438
| memcached-frontend.&ZeroWidthSpace;replicaCount | int | `2` | |
423439
| memcached-frontend.&ZeroWidthSpace;resources | object | `{}` | |

templates/NOTES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
{{- include "cortex.validateMemcached" (index .Values "memcached-frontend") }}
2+
{{- include "cortex.validateMemcached" (index .Values "memcached-blocks-index") }}
3+
{{- include "cortex.validateMemcached" (index .Values "memcached-blocks") }}
4+
{{- include "cortex.validateMemcached" (index .Values "memcached-blocks-metadata") }}
5+
16
Verify the application is working by running these commands:
27
kubectl --namespace {{ .Release.Namespace }} port-forward service/{{ include "cortex.querierFullname" . }} {{ .Values.config.server.http_listen_port }}
38
curl http://127.0.0.1:{{ .Values.config.server.http_listen_port }}/services

templates/_helpers.tpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,19 @@ autoscaling/v2
159159
autoscaling/v2beta2
160160
{{- end -}}
161161
{{- end -}}
162+
163+
{{/*
164+
bitnami/memcached was configured with env vars while memcached official image requires args
165+
This helper validates that if memcached image is set to official image, args are used instead of env vars
166+
*/}}
167+
{{- define "cortex.validateMemcached" -}}
168+
{{- if .enabled -}}
169+
{{- if not .disableValidation -}}
170+
{{- if and .image (eq .image.repository "memcached") -}}
171+
{{- if .extraEnvVars -}}
172+
{{- fail "memcached must be configured with .args not .extraEnvVars" -}}
173+
{{- end -}}
174+
{{- end -}}
175+
{{- end -}}
176+
{{- end -}}
177+
{{- end -}}

values.yaml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,20 +1588,20 @@ memcached-frontend:
15881588
architecture: "high-availability"
15891589
replicaCount: 2
15901590
resources: {}
1591-
extraEnvVars:
1592-
# -- MEMCACHED_CACHE_SIZE is the amount of memory allocated to memcached for object storage
1593-
- name: MEMCACHED_CACHE_SIZE
1594-
value: "1024"
1595-
# -- MEMCACHED_MAX_CONNECTIONS is the maximum number of simultaneous connections to the memcached service
1596-
- name: MEMCACHED_MAX_CONNECTIONS
1597-
value: "1024"
1598-
# -- MEMCACHED_THREADS is the number of threads to use when processing incoming requests.
1599-
# By default, memcached is configured to use 4 concurrent threads. The threading improves the performance of
1600-
# storing and retrieving data in the cache, using a locking system to prevent different threads overwriting or updating the same values.
1601-
- name: MEMCACHED_THREADS
1602-
value: "4"
1591+
# -- Bypass validation of the memcached configuration in case a custom image is in use
1592+
disableValidation: false
1593+
# -- Command line argument supplied to memcached
1594+
args:
1595+
# -- The amount of memory allocated to memcached for object storage
1596+
- -m 1024
1597+
image:
1598+
repository: memcached
1599+
tag: "1.6.39"
16031600
metrics:
16041601
enabled: true
1602+
image:
1603+
repository: prom/memcached-exporter
1604+
tag: "v0.15.4"
16051605
serviceMonitor:
16061606
enabled: false
16071607

@@ -1613,20 +1613,20 @@ memcached-blocks-index:
16131613
architecture: "high-availability"
16141614
replicaCount: 2
16151615
resources: {}
1616-
extraEnvVars:
1617-
# -- MEMCACHED_CACHE_SIZE is the amount of memory allocated to memcached for object storage
1618-
- name: MEMCACHED_CACHE_SIZE
1619-
value: "1024"
1620-
# -- MEMCACHED_MAX_CONNECTIONS is the maximum number of simultaneous connections to the memcached service
1621-
- name: MEMCACHED_MAX_CONNECTIONS
1622-
value: "1024"
1623-
# -- MEMCACHED_THREADS is the number of threads to use when processing incoming requests.
1624-
# By default, memcached is configured to use 4 concurrent threads. The threading improves the performance of
1625-
# storing and retrieving data in the cache, using a locking system to prevent different threads overwriting or updating the same values.
1626-
- name: MEMCACHED_THREADS
1627-
value: "4"
1616+
# -- Bypass validation of the memcached configuration in case a custom image is in use
1617+
disableValidation: false
1618+
# -- Command line argument supplied to memcached
1619+
args:
1620+
# -- The amount of memory allocated to memcached for object storage
1621+
- -m 1024
1622+
image:
1623+
repository: memcached
1624+
tag: "1.6.39"
16281625
metrics:
16291626
enabled: true
1627+
image:
1628+
repository: prom/memcached-exporter
1629+
tag: "v0.15.4"
16301630
serviceMonitor:
16311631
enabled: false
16321632

@@ -1638,20 +1638,20 @@ memcached-blocks:
16381638
architecture: "high-availability"
16391639
replicaCount: 2
16401640
resources: {}
1641-
extraEnvVars:
1642-
# -- MEMCACHED_CACHE_SIZE is the amount of memory allocated to memcached for object storage
1643-
- name: MEMCACHED_CACHE_SIZE
1644-
value: "1024"
1645-
# -- MEMCACHED_MAX_CONNECTIONS is the maximum number of simultaneous connections to the memcached service
1646-
- name: MEMCACHED_MAX_CONNECTIONS
1647-
value: "1024"
1648-
# -- MEMCACHED_THREADS is the number of threads to use when processing incoming requests.
1649-
# By default, memcached is configured to use 4 concurrent threads. The threading improves the performance of
1650-
# storing and retrieving data in the cache, using a locking system to prevent different threads overwriting or updating the same values.
1651-
- name: MEMCACHED_THREADS
1652-
value: "4"
1641+
# -- Bypass validation of the memcached configuration in case a custom image is in use
1642+
disableValidation: false
1643+
# -- Command line argument supplied to memcached
1644+
args:
1645+
# -- The amount of memory allocated to memcached for object storage
1646+
- -m 1024
1647+
image:
1648+
repository: memcached
1649+
tag: "1.6.39"
16531650
metrics:
16541651
enabled: true
1652+
image:
1653+
repository: prom/memcached-exporter
1654+
tag: "v0.15.4"
16551655
serviceMonitor:
16561656
enabled: false
16571657

@@ -1663,20 +1663,20 @@ memcached-blocks-metadata:
16631663
architecture: "high-availability"
16641664
replicaCount: 2
16651665
resources: {}
1666-
extraEnvVars:
1667-
# -- MEMCACHED_CACHE_SIZE is the amount of memory allocated to memcached for object storage
1668-
- name: MEMCACHED_CACHE_SIZE
1669-
value: "1024"
1670-
# -- MEMCACHED_MAX_CONNECTIONS is the maximum number of simultaneous connections to the memcached service
1671-
- name: MEMCACHED_MAX_CONNECTIONS
1672-
value: "1024"
1673-
# -- MEMCACHED_THREADS is the number of threads to use when processing incoming requests.
1674-
# By default, memcached is configured to use 4 concurrent threads. The threading improves the performance of
1675-
# storing and retrieving data in the cache, using a locking system to prevent different threads overwriting or updating the same values.
1676-
- name: MEMCACHED_THREADS
1677-
value: "4"
1666+
# -- Bypass validation of the memcached configuration in case a custom image is in use
1667+
disableValidation: false
1668+
# -- Command line argument supplied to memcached
1669+
args:
1670+
# -- The amount of memory allocated to memcached for object storage
1671+
- -m 1024
1672+
image:
1673+
repository: memcached
1674+
tag: "1.6.39"
16781675
metrics:
16791676
enabled: true
1677+
image:
1678+
repository: prom/memcached-exporter
1679+
tag: "v0.15.4"
16801680
serviceMonitor:
16811681
enabled: false
16821682

0 commit comments

Comments
 (0)