Contrail Kubernetes Setup Installation
Note that the HW/SW requirements and installation steps that are listed here apply to the testbed used to test the theories and examples in this book. Please refer to the Juniper TechLibrary for the official HW/SW requirements and installation steps, especially if you want to build a scalable setup or more practical work.
The hardware and software required for the setup of this book are:
Centos 7.6
32G memory
50G disk space
$ cat /etc/centos-release CentOS Linux release 7.6.1810 (Core) $ free -h total used free shared buff/cache available Mem: 31G 20G 7.0G 72M 3.8G 10G Swap: 0B 0B 0B $ df -h | head Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 47G 40G 7.3G 85% /
Three Node Cluster Only Setup
Three Node Cluster Only Setup Figure 1: Three Node Cluster Only Setup (No External Connections) Here’s the YAML template:
global_configuration: CONTAINER_REGISTRY: ci-repo.englab.juniper.net:5000 REGISTRY_PRIVATE_INSECURE: true provider_config: bms: ssh_pwd: Juniper ssh_user: root ntpserver: ntp.juniper.net domainsuffix: local instances: bms1: provider: bms ip: 10.85.111.26 roles: analytics: analytics_alarm: analytics_database: analytics_snmp: config: config_database: control: k8s_master: kubemanager: webui: bms2: provider: bms ip: 10.85.111.27 roles: k8s_node: vrouter: bms3: provider: bms ip: 10.85.111.28 roles: k8s_node: vrouter: contrail_configuration: CLOUD_ORCHESTRATOR: kubernetes CONTRAIL_VERSION: master-latest RABBITMQ_NODE_PORT: 5673
Note, only the following parameters need to be changed:
ssh_pwd: Juniper ssh_user: root ntpserver: ntp.juniper.net ip: 10.85.111.26 ~ 28
In this book the 3 nodes IPes are changed to 10.85.188.19~21 respectively.
Deploy Setup Based on YAML File
yum -y install epel-release git ansible net-tools yum -y install python-pip python-urllib3 python-requests git clone https://github.com/Juniper/contrail-ansible-deployer.git cp instances.yaml contrail-ansible-deployer/config/instances.yaml cd contrail-ansible-deployer ansible-playbook -i inventory/ playbooks/configure_instances.yml #if it is openstack ansible-playbook -i inventory/ playbooks/install_openstack.yml #if it is k8s ansible-playbook -i inventory/ playbooks/install_k8s.yml ansible-playbook -i inventory/ playbooks/install_contrail.yml verification [root@cent1 ~]# contrail-status Pod Service Original Name State Id Status redis contrail-external-redis running ac7ccf200841 Up 12 hours analytics api contrail-analytics-api running 4d5df940f2c9 Up 12 hours analytics collector contrail-analytics-collector running eede6985b56b Up 12 hours analytics nodemgr contrail-nodemgr running 9a695d3ad116 Up 12 hours analytics-alarm alarm-gen contrail-analytics-alarm-gen running a9a2b63a13e7 Up 12 hours analytics-alarm kafka contrail-external-kafka running f2b8b87e7891 Up 12 hours analytics-alarm nodemgr contrail-nodemgr running 539d41216ec0 Up 12 hours analytics-snmp nodemgr contrail-nodemgr running 3a15390a119f Up 12 hours analytics-snmp snmp-collector contrail-analytics-snmp-collector running 894c8695c8a5 Up 12 hours analytics-snmp topology contrail-analytics-snmp-topology running 1325d917c62b Up 12 hours config api contrail-controller-config-api running 6bdf6530afd5 Up 12 hours config device-manager contrail-controller-config-devicemgr running 2eb24b537089 Up 12 hours config nodemgr contrail-nodemgr running 13c3a8a63597 Up 12 hours config schema contrail-controller-config-schema running 2b571e48b2c1 Up 12 hours config svc-monitor contrail-controller-config-svcmonitor running 79ccd1a6975a Up 12 hours config-database cassandra contrail-external-cassandra running f0fc9e49fab2 Up 12 hours config-database nodemgr contrail-nodemgr running 73fc28f9325e Up 12 hours config-database rabbitmq contrail-external-rabbitmq running d5bb7e78331a Up 12 hours config-database zookeeper contrail-external-zookeeper running cedb14f696d3 Up 12 hours control control contrail-controller-control-control running 7a25b10adb13 Up 12 hours control dns contrail-controller-control-dns running 3b660a355a44 Up 12 hours control named contrail-controller-control-named running eb2eb603cb2d Up 12 hours control nodemgr contrail-nodemgr running 7bb60c059042 Up 12 hours database cassandra contrail-external-cassandra running fcb268d42098 Up 12 hours database nodemgr contrail-nodemgr running 7d44a2334ef3 Up 12 hours database query-engine contrail-analytics-query-engine running 3f4c5a64e7db Up 12 hours device-manager dnsmasq contrail-external-dnsmasq running 3be66d74f44e Up 12 hours kubernetes kube-manager contrail-kubernetes-kube-manager running 804a9badb60a Up 12 hours webui job contrail-controller-webui-job running 786aad4792be Up 12 hours webui web contrail-controller-webui-web running 715ebaa06bb9 Up 12 hours == Contrail control == control: active nodemgr: active named: active dns: active == Contrail analytics-alarm == nodemgr: active kafka: active alarm-gen: active == Contrail Kubernetes == kube-manager: active == Contrail database == nodemgr: initializing (Disk for DB is too low. ) query-engine: active cassandra: active == Contrail analytics == nodemgr: active api: active collector: active == Contrail config-database == nodemgr: initializing (Disk for DB is too low. ) zookeeper: active rabbitmq: active cassandra: active == Contrail webui == web: active job: active == Contrail analytics-snmp == snmp-collector: active nodemgr: active topology: active == Contrail device-manager == == Contrail config == svc-monitor: active nodemgr: active device-manager: active api: active schema: active loadbalancer
The Contrail config node, control node, analytics node, and database node are all active and running. You will see this line if your node’s disk size is lower than 150G:
Nodemgr: initializing (Disk for DB is too low. )
Fortunately, this is a negligible issue in the context of this book, so you can either ignore it, or, allocate a bigger hard disk to your nodes and reinstall everything.