Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

Commit

Permalink
Merge pull request #27 from oracle/jlamillan/issue_26
Browse files Browse the repository at this point in the history
Put Docker overrides in the package-installed docker.service file.
  • Loading branch information
jlamillan authored Oct 26, 2017
2 parents ca6a6ea + 4780053 commit 309e62a
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 77 deletions.
6 changes: 0 additions & 6 deletions instances/k8smaster/cloud_init/bootstrap.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,11 @@ write_files:
encoding: b64
content: |
${kube_dashboard_template_content}
- path: "/root/services/docker.service"
- path: "/etc/kubernetes/manifests/kube-rbac-role-binding.yaml"
permissions: "0755"
encoding: b64
content: |
${kube_rbac_content}
- path: "/root/services/docker.service"
permissions: "0600"
encoding: b64
content: |
${docker_service_content}
- path: "/root/services/flannel.service"
permissions: "0600"
encoding: b64
Expand Down
5 changes: 0 additions & 5 deletions instances/k8smaster/datasources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ data "template_file" "kube-rbac" {
template = "${file("${path.module}/manifests/kube-rbac-role-binding.yaml")}"
}

data "template_file" "docker-service" {
template = "${file("${path.module}/scripts/docker.service")}"
}

data "template_file" "flannel-service" {
template = "${file("${path.module}/scripts/flannel.service")}"
}
Expand Down Expand Up @@ -139,7 +135,6 @@ data "template_file" "kube_master_cloud_init_file" {
api-server-key-content = "${base64encode(var.api_server_private_key_pem)}"
api-server-cert-content = "${base64encode(var.api_server_cert_pem)}"
api-token_auth_template_content = "${base64encode(data.template_file.token_auth_file.rendered)}"
docker_service_content = "${base64encode(data.template_file.docker-service.rendered)}"
flannel_service_content = "${base64encode(data.template_file.flannel-service.rendered)}"
cnibridge_service_content = "${base64encode(data.template_file.cnibridge-service.rendered)}"
cnibridge_sh_content = "${base64encode(data.template_file.cnibridge-sh.rendered)}"
Expand Down
25 changes: 0 additions & 25 deletions instances/k8smaster/scripts/docker.service

This file was deleted.

1 change: 0 additions & 1 deletion instances/k8smaster/scripts/flannel.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Documentation=https://github.com/coreos/flannel
[Service]
Type=notify
ExecStart=/usr/local/bin/flanneld \
-ip-masq=true \
-iface $IP_LOCAL \
-etcd-endpoints $ETCD_SERVER \
-etcd-prefix /flannel/network
Expand Down
6 changes: 4 additions & 2 deletions instances/k8smaster/scripts/setup.template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ systemctl enable cni-bridge && systemctl start cni-bridge
######################################
until yum -y install docker-engine-${docker_ver}; do sleep 1 && echo -n "."; done

# Configure Docker to use flannel
rm -f /lib/systemd/system/docker.service && cat /root/services/docker.service >/lib/systemd/system/docker.service
cat <<EOF > /etc/sysconfig/docker-network
DOCKER_NETWORK_OPTIONS="--bridge=cni0 --iptables=false --ip-masq=false"
EOF

systemctl daemon-reload
systemctl enable docker
systemctl start docker
Expand Down
6 changes: 0 additions & 6 deletions instances/k8sworker/cloud_init/bootstrap.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ write_files:
${worker_kubeconfig_template_content}
# systemd services
- path: "/root/services/docker.service"
permissions: "0600"
encoding: b64
content: |
${docker_service_content}
- path: "/root/services/flannel.service"
permissions: "0600"
encoding: b64
Expand Down
5 changes: 0 additions & 5 deletions instances/k8sworker/datasources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ data "template_file" "worker-kubeconfig" {
}
}

data "template_file" "docker-service" {
template = "${file("${path.module}/scripts/docker.service")}"
}

data "template_file" "flannel-service" {
template = "${file("${path.module}/scripts/flannel.service")}"
}
Expand Down Expand Up @@ -90,7 +86,6 @@ data "template_file" "kube_worker_cloud_init_file" {
setup_template_sh_content = "${base64encode(data.template_file.setup-template.rendered)}"
kube_proxy_template_content = "${base64encode(data.template_file.kube-proxy.rendered)}"
worker_kubeconfig_template_content = "${base64encode(data.template_file.worker-kubeconfig.rendered)}"
docker_service_content = "${base64encode(data.template_file.docker-service.rendered)}"
flannel_service_content = "${base64encode(data.template_file.flannel-service.rendered)}"
cnibridge_service_content = "${base64encode(data.template_file.cnibridge-service.rendered)}"
cnibridge_sh_content = "${base64encode(data.template_file.cnibridge-sh.rendered)}"
Expand Down
24 changes: 0 additions & 24 deletions instances/k8sworker/scripts/docker.service

This file was deleted.

1 change: 0 additions & 1 deletion instances/k8sworker/scripts/flannel.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Documentation=https://github.com/coreos/flannel
[Service]
Type=notify
ExecStart=/usr/local/bin/flanneld \
-ip-masq=true \
-iface $IP_LOCAL \
-etcd-endpoints $ETCD_SERVER \
-etcd-prefix /flannel/network
Expand Down
6 changes: 4 additions & 2 deletions instances/k8sworker/scripts/setup.template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ systemctl enable cni-bridge && systemctl start cni-bridge
######################################
until yum -y install docker-engine-${docker_ver}; do sleep 1 && echo -n "."; done

# Configure Docker to use flannel
rm -f /lib/systemd/system/docker.service && cat /root/services/docker.service >/lib/systemd/system/docker.service
cat <<EOF > /etc/sysconfig/docker-network
DOCKER_NETWORK_OPTIONS="--bridge=cni0 --iptables=false --ip-masq=false"
EOF

systemctl daemon-reload
systemctl enable docker
systemctl start docker
Expand Down

0 comments on commit 309e62a

Please sign in to comment.