From 74947e8265658f11228ce6c56d9108ffa72e7c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Mon, 6 Dec 2021 15:16:38 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9E=95=20Add=20exercises=20with=20remote=20c?= =?UTF-8?q?lusters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- slides/exercises/remotecluster-brief.md | 9 ++++ slides/exercises/remotecluster-details.md | 62 +++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 slides/exercises/remotecluster-brief.md create mode 100644 slides/exercises/remotecluster-details.md diff --git a/slides/exercises/remotecluster-brief.md b/slides/exercises/remotecluster-brief.md new file mode 100644 index 00000000..49ac50af --- /dev/null +++ b/slides/exercises/remotecluster-brief.md @@ -0,0 +1,9 @@ +## Exercise — Remote Cluster + +- Install kubectl locally + +- Retrieve the kubeconfig file of our remote cluster + +- Deploy dockercoins on that cluster + +- Access an internal service without exposing it diff --git a/slides/exercises/remotecluster-details.md b/slides/exercises/remotecluster-details.md new file mode 100644 index 00000000..9b7fb2af --- /dev/null +++ b/slides/exercises/remotecluster-details.md @@ -0,0 +1,62 @@ +# Exercise — Remote Cluster + +- We want to control a remote cluster + +- Then we want to run a copy of dockercoins on that cluster + +- We want to be able to connect to an internal service + +--- + +## Goal + +- Be able to access e.g. hasher, rng, or webui + + (without exposing them with a NodePort or LoadBalancer service) + +--- + +## Getting access to the cluster + +- If you don't have `kubectl` on your machine, install it + +- Download the kubeconfig file from the remote cluster + + (you can use `scp` or even copy-paste it) + +- If you already have a kubeconfig file on your machine: + + - save the remote kubeconfig with another name (e.g. `~/.kube/config.remote`) + + - set the `KUBECONFIG` environment variable to point to that file name + + - ...or use the `--kubeconfig=...` option with `kubectl` + +- Check that you can access the cluster (e.g. `kubectl get nodes`) + +--- + +## If you get an error... + +⚠️ The following applies to clusters deployed with `kubeadm` + +- If you have a cluster where the nodes are named `node1`, `node2`, etc. + +- `kubectl` commands might show connection errors with internal IP addresses + + (e.g. 10.10... or 172.17...) + +- In that case, you might need to edit the `kubeconfig` file: + + - find the server address + + - update it to put the *external* address of the first node of the cluster + +--- + + +## Deploying an app + +- Deploy another copy of dockercoins from your local machine + +- Access internal services (e.g. with `kubectl port-forward`)