blob: f023315df4472c2b3e32ef4fc258f08a4d6c5f09 [file] [log] [blame]
apiVersion: apps/v1beta2
kind: DaemonSet
metadata:
name: opencontrail
namespace: kube-system
labels:
app: opencontrail
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
spec:
selector:
matchLabels:
app: opencontrail
template:
metadata:
labels:
app: opencontrail
spec:
hostNetwork: true
containers:
- name: rabbitmq
image: rabbitmq:3.6.6-management-alpine
lifecycle:
postStart:
exec:
command:
- /bin/sh
- -c
- >
if [ -z "$(grep rabbitmq /etc/resolv.conf)" ]; then
sed "s/^search \([^ ]\+\)/search rabbitmq.\1 \1/" /etc/resolv.conf > /etc/resolv.conf.new;
cat /etc/resolv.conf.new > /etc/resolv.conf;
rm /etc/resolv.conf.new;
fi;
until rabbitmqctl node_health_check; do sleep 1; done;
if [[ "$HOSTNAME" != "ctl01" && -z "$(rabbitmqctl cluster_status | grep ctl01)" ]]; then
rabbitmqctl stop_app;
rabbitmqctl join_cluster rabbit@ctl01;
rabbitmqctl start_app;
fi;
rabbitmqctl set_policy ha-all "." '{"ha-mode":"exactly","ha-params":3,"ha-sync-mode":"automatic"}'
env:
- name: RABBITMQ_ERLANG_COOKIE
value: YTQMGYEHFATZPDKPOCXX
- name: opencontrail-controller
image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-controller
securityContext:
privileged: true
lifecycle:
postStart:
exec:
command:
- /bin/sh
- -c
- >
service rabbitmq-server stop;
systemctl disable rabbitmq-server.service;
service redis-server stop;
systemctl disable redis-server.service;
volumeMounts:
- name: etc-contrail
mountPath: /etc/contrail
- name: var-lib-configdb
mountPath: /var/lib/cassandra
- name: var-lib-config-zookeeper-data
mountPath: /var/lib/zookeeper
- name: var-lib-zookeeper-myid
mountPath: /var/lib/zookeeper/myid
- name: etc-cassandra-cassandra-env-sh
mountPath: /etc/cassandra/cassandra-env.sh
- name: etc-cassandra-cassandra-yaml
mountPath: /etc/cassandra/cassandra.yaml
- name: etc-cassandra-logback-xml
mountPath: /etc/cassandra/logback.xml
- name: etc-zookeeper-conf-zoo-cfg
mountPath: /etc/zookeeper/conf/zoo.cfg
- name: etc-zookeeper-conf-log4j-properties
mountPath: /etc/zookeeper/conf/log4j.properties
- name: var-lib-rabbitmq-erlang-cookie
mountPath: /var/lib/rabbitmq/.erlang.cookie
- name: opencontrail-analyticsdb
image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-analyticsdb
securityContext:
privileged: true
volumeMounts:
- name: etc-contrail
mountPath: /etc/contrail
- name: etc-cassandra-cassandra-env-analytics-sh
mountPath: /etc/cassandra/cassandra-env.sh
- name: etc-cassandra-cassandra-analytics-yaml
mountPath: /etc/cassandra/cassandra.yaml
- name: etc-cassandra-logback-xml
mountPath: /etc/cassandra/logback.xml
- name: var-lib-analyticsdb
mountPath: /var/lib/cassandra
- name: var-lib-analyticsdb-zookeeper-data
mountPath: /var/lib/zookeeper
- name: var-lib-zookeeper-myid
mountPath: /var/lib/zookeeper/myid
- name: usr-share-kafka-config-server-properties
mountPath: /usr/share/kafka/config/server.properties
- name: usr-share-kafka-config-consumer-properties
mountPath: /usr/share/kafka/config/consumer.properties
- name: usr-share-kafka-config-zookeeper-properties
mountPath: /usr/share/kafka/config/zookeeper.properties
- name: usr-share-kafka-logs
mountPath: /usr/share/kafka/logs
- name: etc-zookeeper-conf-zoo-analytics-cfg
mountPath: /etc/zookeeper/conf/zoo.cfg
- name: etc-zookeeper-conf-log4j-properties
mountPath: /etc/zookeeper/conf/log4j.properties
- name: opencontrail-analytics
image: docker-prod-local.artifactory.mirantis.com/opencontrail-oc40/opencontrail-analytics
volumeMounts:
- name: etc-contrail
mountPath: /etc/contrail
- name: etc-redis-redis-conf
mountPath: /etc/redis/redis.conf
securityContext:
privileged: true
volumes:
# analytics / analyticsdb / controller /
- name: etc-contrail
hostPath:
path: /etc/contrail
type: Directory
# controller
- name: var-lib-configdb
hostPath:
path: /var/lib/configdb
type: Directory
- name: var-lib-config-zookeeper-data
hostPath:
path: /var/lib/config_zookeeper_data
type: Directory
- name: etc-cassandra-cassandra-env-sh
hostPath:
path: /etc/cassandra/cassandra-env.sh
type: File
- name: etc-cassandra-cassandra-yaml
hostPath:
path: /etc/cassandra/cassandra.yaml
type: File
- name: etc-zookeeper-conf-zoo-cfg
hostPath:
path: /etc/zookeeper/conf/zoo.cfg
type: File
- name: var-lib-rabbitmq-erlang-cookie
hostPath:
path: /var/lib/rabbitmq/.erlang.cookie
type: File
# analyticsdb
- name: etc-cassandra-cassandra-env-analytics-sh
hostPath:
path: /etc/cassandra/cassandra-env-analytics.sh
type: File
- name: etc-cassandra-cassandra-analytics-yaml
hostPath:
path: /etc/cassandra/cassandra_analytics.yaml
type: File
- name: etc-cassandra-logback-xml # is used by controller as well
hostPath:
path: /etc/cassandra/logback.xml
type: File
- name: var-lib-analyticsdb
hostPath:
path: /var/lib/analyticsdb
type: Directory
- name: var-lib-analyticsdb-zookeeper-data
hostPath:
path: /var/lib/analyticsdb-zookeeper-data
type: Directory
- name: var-lib-zookeeper-myid # is used for controller as well
hostPath:
path: /var/lib/zookeeper/myid
type: File
- name: usr-share-kafka-config-server-properties
hostPath:
path: /usr/share/kafka/config/server.properties
type: File
- name: usr-share-kafka-config-consumer-properties
hostPath:
path: /usr/share/kafka/config/consumer.properties
type: File
- name: usr-share-kafka-config-zookeeper-properties
hostPath:
path: /usr/share/kafka/config/zookeeper.properties
type: File
- name: usr-share-kafka-logs
hostPath:
path: /usr/share/kafka/logs
type: Directory
- name: etc-zookeeper-conf-zoo-analytics-cfg
hostPath:
path: /etc/zookeeper/conf/zoo_analytics.cfg
type: File
- name: etc-zookeeper-conf-log4j-properties # is used by controller as well
hostPath:
path: /etc/zookeeper/conf/log4j.properties
type: File
# analytics
- name: etc-redis-redis-conf
hostPath:
path: /etc/redis/redis.conf
type: File
nodeSelector:
"node-role.kubernetes.io/master": "true"
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master