diff options
Diffstat (limited to 'roles/calico/templates')
-rw-r--r-- | roles/calico/templates/10-calico.conf.j2 | 18 | ||||
-rw-r--r-- | roles/calico/templates/calico.service.j2 | 32 | ||||
-rw-r--r-- | roles/calico/templates/calicoctl.cfg.j2 | 9 |
3 files changed, 59 insertions, 0 deletions
diff --git a/roles/calico/templates/10-calico.conf.j2 b/roles/calico/templates/10-calico.conf.j2 new file mode 100644 index 000000000..1ec569cff --- /dev/null +++ b/roles/calico/templates/10-calico.conf.j2 @@ -0,0 +1,18 @@ +{ + "name": "calico", + "type": "calico", + "ipam": { + "type": "calico-ipam" + }, + "etcd_endpoints": "{{ calico_etcd_endpoints }}", + "etcd_key_file": "{{ calico_etcd_key_file }}", + "etcd_cert_file": "{{ calico_etcd_cert_file }}", + "etcd_ca_cert_file": "{{ calico_etcd_ca_cert_file }}", + "kubernetes": { + "kubeconfig": "{{ kubeconfig }}" + }, + "hostname": "{{ openshift.common.hostname }}", + "policy": { + "type": "k8s" + } +} diff --git a/roles/calico/templates/calico.service.j2 b/roles/calico/templates/calico.service.j2 new file mode 100644 index 000000000..7653e19b1 --- /dev/null +++ b/roles/calico/templates/calico.service.j2 @@ -0,0 +1,32 @@ +[Unit] +Description=calico +After={{ openshift.docker.service_name }}.service +Requires={{ openshift.docker.service_name }}.service + +[Service] +Restart=always +ExecStartPre=-/usr/bin/docker rm -f calico-node +ExecStart=/usr/bin/docker run --net=host --privileged \ + --name=calico-node \ + -e WAIT_FOR_DATASTORE=true \ + -e FELIX_DEFAULTENDPOINTTOHOSTACTION=ACCEPT \ + -e CALICO_IPV4POOL_IPIP={{ calico_ipv4pool_ipip }} \ + -e CALICO_IPV4POOL_CIDR={{ openshift.master.sdn_cluster_network_cidr }} \ + -e FELIX_IPV6SUPPORT=false \ + -e ETCD_ENDPOINTS={{ calico_etcd_endpoints }} \ + -v {{ calico_etcd_cert_dir }}:{{ calico_etcd_cert_dir }} \ + -e ETCD_CA_CERT_FILE={{ calico_etcd_ca_cert_file }} \ + -e ETCD_CERT_FILE={{ calico_etcd_cert_file }} \ + -e ETCD_KEY_FILE={{ calico_etcd_key_file }} \ + -e CLUSTER_TYPE=origin,bgp \ + -e NODENAME={{ openshift.common.hostname }} \ + -v {{ calico_log_dir }}:/var/log/calico\ + -v /lib/modules:/lib/modules \ + -v /var/run/calico:/var/run/calico \ + {{ calico_node_image }} + + +ExecStop=-/usr/bin/docker stop calico-node + +[Install] +WantedBy=multi-user.target diff --git a/roles/calico/templates/calicoctl.cfg.j2 b/roles/calico/templates/calicoctl.cfg.j2 new file mode 100644 index 000000000..a00ea27dc --- /dev/null +++ b/roles/calico/templates/calicoctl.cfg.j2 @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: calicoApiConfig +metadata: +spec: + datastoreType: "etcdv2" + etcdEndpoints: "{{ calico_etcd_endpoints }}" + etcdKeyFile: "{{ calico_etcd_key_file }}" + etcdCertFile: "{{ calico_etcd_cert_file }}" + etcdCaCertFile: "{{ calico_etcd_ca_cert_file }}" |