Memcached: permit multiple deployments within a single namespace

This PS updates the Memcached chart to permit multiple deployments
within a single namespace.

Change-Id: I282d73fdbb03c29ef063537a03d4ace026083930
This commit is contained in:
portdirect 2018-01-17 12:39:22 -05:00 committed by Pete Birley
parent 5f26fcd91e
commit ea4c7b7ac8
3 changed files with 24 additions and 11 deletions

View File

@ -17,13 +17,13 @@ limitations under the License.
{{- $envAll := . }}
{{- $dependencies := .Values.dependencies.memcached }}
{{- $serviceAccountName := "memcached" }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
{{- $rcControllerName := printf "%s-%s" $envAll.Release.Name "memcached" }}
{{ tuple $envAll $dependencies $rcControllerName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: memcached
name: {{ $rcControllerName | quote }}
spec:
replicas: {{ .Values.pod.replicas.server }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
@ -32,7 +32,7 @@ spec:
labels:
{{ tuple $envAll "memcached" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}
serviceAccountName: {{ $rcControllerName | quote }}
affinity:
{{ tuple $envAll "memcached" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
nodeSelector:
@ -48,12 +48,12 @@ spec:
args:
- |
exec memcached -v \
-p {{ .Values.network.port }} \
-p {{ tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} \
-U 0 \
-c {{ .Values.memcached.max_connections }} \
-m {{ .Values.memcached.memory }};
ports:
- containerPort: {{ .Values.network.port }}
- containerPort: {{ tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
tcpSocket:
port: {{ .Values.network.port }}
port: {{ tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}

View File

@ -13,15 +13,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- $envAll := . }}
---
apiVersion: v1
kind: Service
metadata:
name: memcached
name: {{ tuple "oslo_cache" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
spec:
sessionAffinity: ClientIP
ports:
- port: {{ .Values.network.port }}
- port: {{ tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
selector:
{{ tuple $envAll "memcached" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}

View File

@ -54,8 +54,20 @@ labels:
node_selector_key: openstack-control-plane
node_selector_value: enabled
network:
port: 11211
# typically overriden by environmental
# values, but should include all endpoints
# required by this chart
endpoints:
cluster_domain_suffix: cluster.local
oslo_cache:
namespace: null
hosts:
default: memcached
host_fqdn_override:
default: null
port:
memcache:
default: 11211
memcached:
memory: 1024