From a64c1f4593f49dceb770953552ff6b7bad8d5378 Mon Sep 17 00:00:00 2001 From: John Strunk Date: Tue, 13 Nov 2018 13:32:58 -0500 Subject: [PATCH 1/2] Install socat on hosts The lack of `socat` was preventing Helm from running in the GCS Vagrant environment. This patch installs socat on the atomic hosts. It also fetches the kubectl config into the local directory once installation is complete, making it possible to use kubectl on the local machine to access the cluster: `$ kubectl --kubeconfig=kubeconfig get nodes` Signed-off-by: John Strunk --- deploy/.gitignore | 1 + deploy/deploy-k8s.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 deploy/.gitignore diff --git a/deploy/.gitignore b/deploy/.gitignore new file mode 100644 index 0000000..f940e0b --- /dev/null +++ b/deploy/.gitignore @@ -0,0 +1 @@ +kubeconfig diff --git a/deploy/deploy-k8s.yml b/deploy/deploy-k8s.yml index 90e9b6f..2fc0a30 100644 --- a/deploy/deploy-k8s.yml +++ b/deploy/deploy-k8s.yml @@ -1,4 +1,24 @@ --- +- name: Install extra packages + hosts: all + become: true + tasks: + + - name: Install packages + command: "rpm-ostree install {{ item }}" + with_items: + # socat is needed for Helm + - socat + + - name: Reboot to make layered packages available + shell: sleep 2 && systemctl reboot + async: 1 + poll: 0 + + - name: Wait for host to be available + wait_for_connection: + delay: 15 + - name: Deploy K8S import_playbook: "kubespray/cluster.yml" vars: @@ -9,3 +29,13 @@ kubeconfig_localhost: true local_volumes_enabled: true kube_feature_gates: ["VolumeSnapshotDataSource=true","CSINodeInfo=true","CSIDriverRegistry=true"] + +- name: Fetch config + hosts: kube-master[0] + become: true + tasks: + - name: Retrieve kubectl config + fetch: + dest: ./kubeconfig + flat: yes + src: /root/.kube/config From 89d51e45b1a11ed5197412d614551d5909cf08bb Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Tue, 20 Nov 2018 19:51:28 +0530 Subject: [PATCH 2/2] deploy-k8s: Remove kubeconfig_localhost --- deploy/deploy-k8s.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/deploy/deploy-k8s.yml b/deploy/deploy-k8s.yml index 2fc0a30..e769b76 100644 --- a/deploy/deploy-k8s.yml +++ b/deploy/deploy-k8s.yml @@ -26,7 +26,6 @@ docker_mount_flags: "shared" kube_network_plugin: "flannel" kube_version: "v1.12.1" - kubeconfig_localhost: true local_volumes_enabled: true kube_feature_gates: ["VolumeSnapshotDataSource=true","CSINodeInfo=true","CSIDriverRegistry=true"]