Replacing the bare pod with a replication controller

This will keep the mariadb pod scheduled.  Downside: you can't count
on there being a pod named `mariadb` anymore.  Upside: Kubernetes
handles supervision fastidiously.

Change-Id: I6bbc67bf3e049ddf6afba195e8803a176c21e4d4
partially-implements: blueprint replication-controllers
This commit is contained in:
Ken Wronkiewicz 2016-06-01 12:49:47 -07:00
parent bfedbe4570
commit f0960a27c5
1 changed files with 37 additions and 29 deletions

View File

@ -1,33 +1,41 @@
apiVersion: v1
kind: Pod
kind: ReplicationController
spec:
hostNetwork: True
containers:
- image: "{{ mariadb_image_full }}"
name: mariadb
volumeMounts:
- mountPath: {{ container_config_directory }}
name: mariadb-config
- mountPath: /var/lib/mysql
name: mariadb-persistent-storage
- mountPath: /var/log/kolla/
name: kolla-logs
env:
- name: KOLLA_CONFIG_STRATEGY
value: {{ config_strategy }}
#TODO: Replace with templated values
- name: ETCD_HOST
value: {{ etcd_ip_address }}
- name: ETCD_PORT
value: "{{ etcd_port }}"
volumes:
- name: mariadb-config
configMap:
name: mariadb-configmap
- name: mariadb-persistent-storage
hostPath:
path: /var/lib/mysql
- name: kolla-logs
emptyDir: {}
replicas: 1
selector:
service: mariadb
template:
metadata:
labels:
service: mariadb
spec:
hostNetwork: True
containers:
- image: "{{ mariadb_image_full }}"
name: mariadb
volumeMounts:
- mountPath: {{ container_config_directory }}
name: mariadb-config
- mountPath: /var/lib/mysql
name: mariadb-persistent-storage
- mountPath: /var/log/kolla/
name: kolla-logs
env:
- name: KOLLA_CONFIG_STRATEGY
value: {{ config_strategy }}
#TODO: Replace with templated values
- name: ETCD_HOST
value: {{ etcd_ip_address }}
- name: ETCD_PORT
value: "{{ etcd_port }}"
volumes:
- name: mariadb-config
configMap:
name: mariadb-configmap
- name: mariadb-persistent-storage
hostPath:
path: /var/lib/mysql
- name: kolla-logs
emptyDir: {}
metadata:
name: mariadb