mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-24 07:16:26 +00:00
➕ Add exercises with remote clusters
This commit is contained in:
9
slides/exercises/remotecluster-brief.md
Normal file
9
slides/exercises/remotecluster-brief.md
Normal file
@@ -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
|
||||
62
slides/exercises/remotecluster-details.md
Normal file
62
slides/exercises/remotecluster-details.md
Normal file
@@ -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`)
|
||||
Reference in New Issue
Block a user