apiVersion: v1
kind: ConfigMap
metadata:
  name: env
  namespace: contrail-system
data:
  AAA_MODE: {{ aaa_mode }}
  ANALYTICS_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  ANALYTICSDB_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  AUTH_MODE: {{ auth_mode }}
  CLOUD_ORCHESTRATOR: {{ cloud_orchestrator }}
  CONFIG_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  CONFIGDB_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
{% if multi_interface is defined and multi_interface.lower() == 'true' %}
  CONTROL_NODES: {{ control_nodes }}
  CONTROLLER_NODES: {{ controller_nodes }}
  PHYSICAL_INTERFACE: {{ vrouter_physical_interface }}
{% else %}
  CONTROL_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  CONTROLLER_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  PHYSICAL_INTERFACE: {{ vrouter_physical_interface | default('') }}
{% endif %}
  KAFKA_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  LOG_LEVEL: {{ log_level }}
  METADATA_PROXY_SECRET: {{ metadata_proxy_secret }}
  PHYSICAL_INTERFACE: {{ vrouter_physical_interface | default('') }}
  RABBITMQ_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  RABBITMQ_NODE_PORT: "{{ rabbitmq_node_port }}"
  DNS_SERVER_PORT: "{{ dns_server_port | default('9053') }}"
  REDIS_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  VROUTER_GATEWAY: {{ vrouter_gateway }}
  WEBUI_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  ZOOKEEPER_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  ANALYTICSDB_PORT: "9163"
  ANALYTICSDB_CQL_PORT: "9045"
  CONFIGDB_PORT: "9164"
  CONFIGDB_CQL_PORT: "9044"
  ANALYTICSDB_ENABLE: "true"
  ANALYTICS_ALARM_ENABLE: "true"
  ANALYTICS_SNMP_ENABLE: "true"
  ANALYTICS_SNMP_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  ANALYTICS_ALARM_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: contrail
  namespace: contrail-system
---
kind: ClusterRole
apiVersion: v1
metadata:
  name: contrail
  namespace: contrail-system
rules:
  - apiGroups: ["*"]
    resources: ["*"]
    verbs: ["*"]
---
apiVersion: v1
kind: ClusterRoleBinding
metadata:
  name: contrail
roleRef:
  name: contrail
subjects:
- kind: SystemUser
  name: contrail-system:contrail
- kind: ServiceAccount
  name: contrail
  namespace: contrail-system
userNames:
  - system:serviceaccount:contrail-system:contrail
---
apiVersion: v1
kind: Secret
metadata:
  name: contrail-kubernetes-token
  namespace: contrail-system
  annotations:
    kubernetes.io/service-account.name: contrail
type: kubernetes.io/service-account-token
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: kube-manager-config
  namespace: contrail-system
data:
  KUBERNETES_API_SERVER: {{ kubernetes_api_server | default(api_vip | ipaddr) }}
  KUBERNETES_API_SECURE_PORT: "{{ openshift_master_api_port | default(kubernetes_api_secure_port) }}"
  K8S_TOKEN_FILE: "/tmp/serviceaccount/token"
  KUBERNETES_CLUSTER_NAME: "{{ cluster_name | default('k8s') }}"
  KUBERNETES_CLUSTER_PROJECT: "{{ cluster_project | default('{}') }}"
  KUBERNETES_CLUSTER_NETWORK: "{{ cluster_network | default('{}') }}"
  KUBERNETES_POD_SUBNETS: "{{ pod_subnets | default('10.32.0.0/12') }}"
  KUBERNETES_IP_FABRIC_SUBNETS: "{{ ip_fabric_subnets | default('10.64.0.0/12') }}"
  KUBERNETES_SERVICE_SUBNETS: "{{ service_subnets | default('10.96.0.0/12') }}"
  KUBERNETES_IP_FABRIC_FORWARDING: "{{ ip_fabric_forwarding | default('false') }}"
  KUBERNETES_IP_FABRIC_SNAT: "{{ ip_fabric_snat | default('false') }}"
  KUBERNETES_PUBLIC_FIP_POOL: "{{ public_fip_pool | default('{}') }}"
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: kubernetes-config
  namespace: contrail-system
data:
  KUBERNETES_API_SERVER: {{ kubernetes_api_server | default(api_vip | ipaddr) }}
  KUBERNETES_API_PORT: "{{ openshift_master_api_port | default(kubernetes_api_secure_port) }}"
  K8S_TOKEN_FILE: "/tmp/serviceaccount/token"
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: configzookeeperenv
  namespace: contrail-system
data:
  ZOOKEEPER_PORT: "{{ zookeeper_port }}"
  ZOOKEEPER_PORTS: "{{ zookeeper_ports }}"
  ZOOKEEPER_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: analyticszookeeperenv
  namespace: contrail-system
data:
  ZOOKEEPER_PORT: "{{ zookeeper_port }}"
  ZOOKEEPER_PORTS: "{{ zookeeper_ports }}"
  ZOOKEEPER_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: contrail-analyticsdb-config
  namespace: contrail-system
data:
  CASSANDRA_SEEDS: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  CASSANDRA_CLUSTER_NAME: Contrail
  CASSANDRA_START_RPC: "true"
  CASSANDRA_LISTEN_ADDRESS: auto
  CASSANDRA_PORT: "9163"
  CASSANDRA_CQL_PORT: "9045"
  CASSANDRA_SSL_STORAGE_PORT: "7004"
  CASSANDRA_STORAGE_PORT: "7003"
  CASSANDRA_JMX_LOCAL_PORT: "7203"
  ANALYTICSDB_PORT: "9163"
  ANALYTICSDB_CQL_PORT: "9045"
  CONFIGDB_PORT: "9164"
  CONFIGDB_CQL_PORT: "9044"
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: contrail-configdb-config
  namespace: contrail-system
data:
  CASSANDRA_SEEDS: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  CASSANDRA_CLUSTER_NAME: ContrailConfigDB
  CASSANDRA_START_RPC: "true"
  CASSANDRA_LISTEN_ADDRESS: auto
  CASSANDRA_PORT: "9164"
  CASSANDRA_CQL_PORT: "9044"
  CASSANDRA_SSL_STORAGE_PORT: "7014"
  CASSANDRA_STORAGE_PORT: "7013"
  CASSANDRA_JMX_LOCAL_PORT: "7204"
  ANALYTICSDB_PORT: "9163"
  ANALYTICSDB_CQL_PORT: "9045"
  CONFIGDB_PORT: "9164"
  CONFIGDB_CQL_PORT: "9044"
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: rabbitmq-config
  namespace: contrail-system
data:
  RABBITMQ_NODES: {{ contrail_masters_ip.split() | ipaddr | join(',') }}
  RABBITMQ_NODE_PORT: "{{ rabbitmq_node_port }}"
  RABBITMQ_ERLANG_COOKIE: "47EFF3BB-4786-46E0-A5BB-58455B3C2CB4"
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: nodemgr-config
  namespace: contrail-system
data:
  DOCKER_HOST: "unix://mnt/docker.sock"
---
