91 lines
4.3 KiB
YAML
91 lines
4.3 KiB
YAML
{{- $localVals := dict }}
|
|
{{- $resourceName := "memcached" }}
|
|
{{- $netHostTrue := false }}
|
|
{{- $podTypeBootstrap := false }}
|
|
{{- $name := .Release.Name }}
|
|
{{- $elementSearchPath := ":global.kolla.memcached.deployment:global.kolla.memcached.all:global.kolla.all:global" }}
|
|
{{- $elementName := include "kolla_val_get_str" (dict "key" "element_name" "searchPath" $elementSearchPath "Values" .Values ) }}
|
|
{{- $searchPath := printf ":global.kolla.%s.deployment:global.kolla.%s.all:global.kolla.memcached.deployment:global.kolla.memcached.all:global.kolla.all" $elementName $elementName }}
|
|
{{- $serviceName := $elementName }}
|
|
{{- $serviceType := "deployment" }}
|
|
{{- with $env := dict "netHostTrue" $netHostTrue "podTypeBootstrap" $podTypeBootstrap "resourceName" $resourceName "serviceName" $serviceName "serviceType" $serviceType "elementName" $elementName "searchPath" $searchPath "Values" .Values "Release" .Release }}
|
|
{{- $c := dict "searchPath" $searchPath "key" "enabled" "retDict" $localVals "retKey" "enabled" "Values" .Values }}
|
|
{{- include "kolla_val_get_raw" $c }}
|
|
{{- $ci := dict "searchPath" $searchPath "Values" .Values "contName" "memcached" }}
|
|
{{- $_ := set $ci "imageName" "image_full" }}
|
|
{{- $_ := set $ci "tagName" "image_tag" }}
|
|
{{- $memcachedImageFull := include "kolla_build_image_full" $ci }}
|
|
{{- $selectorKey := include "kolla_val_get_str" (dict "key" "selector_key" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $selectorValue := include "kolla_val_get_str" (dict "key" "selector_value" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $port := include "kolla_val_get_str" (dict "key" "port" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $containerConfigDirectory := include "kolla_val_get_str" (dict "key" "container_config_directory" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $imagePullPolicy := include "kolla_val_get_str" (dict "key" "image_pull_policy" "searchPath" $searchPath "Values" .Values ) }}
|
|
{{- $c := dict "searchPath" .searchPath "key" "prometheus_exporter" "retDict" $localVals "retKey" "prometheus" "Values" .Values }}
|
|
{{- include "kolla_val_get_raw" $c }}
|
|
{{- $c := dict "searchPath" .searchPath "key" "prometheus_port" "retDict" $localVals "retKey" "prometheusPort" "Values" .Values }}
|
|
{{- include "kolla_val_get_raw" $c }}
|
|
{{- if $localVals.enabled }}
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ $elementName }}
|
|
spec:
|
|
replicas: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
service: {{ $elementName }}
|
|
annotations:
|
|
{{- if $localVals.prometheus }}
|
|
"prometheus.io/port": {{ $localVals.prometheusPort | quote }}
|
|
"prometheus.io/scrape": "true"
|
|
{{- end }}
|
|
spec:
|
|
{{- if $localVals.prometheus }}
|
|
hostPID: True
|
|
{{- end }}
|
|
nodeSelector:
|
|
{{ $selectorKey }}: {{ $selectorValue | quote }}
|
|
initContainers:
|
|
{{- include "common_dependency_container" $env | indent 8 }}
|
|
containers:
|
|
- image: "{{ $memcachedImageFull }}"
|
|
imagePullPolicy: {{ $imagePullPolicy | quote }}
|
|
name: main
|
|
volumeMounts:
|
|
{{- include "common_volume_mounts" $env | indent 12 }}
|
|
- mountPath: {{ $containerConfigDirectory }}
|
|
name: memcached-config
|
|
- mountPath: /memcached
|
|
name: pid
|
|
env:
|
|
- name: KOLLA_CONFIG_STRATEGY
|
|
value: COPY_ONCE
|
|
ports:
|
|
- containerPort: {{ $port }}
|
|
name: {{ $elementName | trunc 15 | quote }}
|
|
{{- if $localVals.prometheus }}
|
|
- name: exporter
|
|
image: {{ include "memcached_prometheus_image_full" . | quote }}
|
|
imagePullPolicy: {{ $imagePullPolicy | quote }}
|
|
command: [memcached_exporter, "-memcached.pid-file=/memcached/memcached.pid", "-web.listen-address=:{{ $localVals.prometheusPort}}"]
|
|
volumeMounts:
|
|
- mountPath: /memcached
|
|
name: pid
|
|
ports:
|
|
- containerPort: {{ $localVals.prometheusPort }}
|
|
name: prometheus
|
|
{{- end }}
|
|
{{- include "common_containers" $env | indent 8 }}
|
|
volumes:
|
|
{{- include "common_volumes" $env | indent 8 }}
|
|
- name: memcached-config
|
|
configMap:
|
|
name: {{ $elementName }}
|
|
- name: pid
|
|
emptyDir: {}
|
|
{{- else }}
|
|
{{- include "common_disabled" (dict "elementName" $elementName "serviceKind" "deployment") }}
|
|
{{- end }}
|
|
{{- end }}
|