|
| 1 | +#!/usr/bin/env bash |
| 2 | +set -ex |
| 3 | +if [ -d secrets ]; then |
| 4 | + echo "secrets directory already exists" |
| 5 | + exit 1 |
| 6 | +fi |
| 7 | +echo "secrets*" >> .gitignore |
| 8 | +echo "!secrets.enc" >> .gitignore |
| 9 | +mkdir -p secrets |
| 10 | +talosctl gen secrets -o ./secrets/secrets.yaml |
| 11 | +talosctl gen config --with-secrets ./secrets/secrets.yaml secrets https://10.10.0.42:6443 -o secrets |
| 12 | +./save-secrets.sh |
| 13 | +cd secrets |
| 14 | +talosctl apply-config --insecure --file "./controlplane.yaml" --nodes 10.10.8.188 |
| 15 | +talosctl apply-config --insecure --file "./controlplane.yaml" --nodes 10.10.15.105 |
| 16 | +talosctl apply-config --insecure --file "./controlplane.yaml" --nodes 10.10.4.92 |
| 17 | +talosctl bootstrap --talosconfig=talosconfig --endpoints 10.10.8.188 --nodes 10.10.8.188 |
| 18 | + |
| 19 | +# is this right? |
| 20 | +talosctl --talosconfig=talosconfig config endpoint 10.10.0.42 10.10.8.188 10.10.15.105 10.10.4.92 |
| 21 | + |
| 22 | +talosctl apply-config --insecure --file "./worker.yaml" --nodes 10.10.18.178 |
| 23 | + |
| 24 | +# is this right? |
| 25 | +talosctl --talosconfig=talosconfig config node 10.10.0.42 10.10.8.188 10.10.15.105 10.10.4.92 10.10.18.178 |
| 26 | +# talosctl --talosconfig=talosconfig config node 10.10.0.42 |
| 27 | + |
| 28 | +talosctl --talosconfig=talosconfig kubeconfig ./kubeconfig -n 10.10.0.42 |
| 29 | +# talosctl --talosconfig=talosconfig kubeconfig -n 10.10.0.42 |
| 30 | +kubectl --kubeconfig=kubeconfig get nodes |
| 31 | +kubectl --kubeconfig=kubeconfig get nodes -o wide |
| 32 | +kubectl --kubeconfig=kubeconfig get deployments |
| 33 | +kubectl --kubeconfig=kubeconfig get pods |
| 34 | + |
| 35 | +kubectl --kubeconfig=kubeconfig create deployment hello-world --image=kicbase/echo-server:1.0 --dry-run=client -o yaml | kubectl --kubeconfig=kubeconfig apply -f - |
| 36 | +kubectl --kubeconfig=kubeconfig get service hello-world |
| 37 | +kubectl --kubeconfig=kubeconfig describe deployment hello-world |
| 38 | +kubectl --kubeconfig=kubeconfig describe service hello-world |
| 39 | +kubectl --kubeconfig=kubeconfig get service hello-world |
| 40 | +kubectl --kubeconfig=kubeconfig expose deployment hello-world --type=LoadBalancer --port=8080 |
| 41 | +kubectl --kubeconfig=kubeconfig describe deployment hello-world |
| 42 | +kubectl --kubeconfig=kubeconfig describe service hello-world |
| 43 | +kubectl --kubeconfig=kubeconfig get service hello-world |
| 44 | + |
| 45 | +kubectl --kubeconfig=kubeconfig get nodes -o wide |
| 46 | + |
| 47 | +kubectl --kubeconfig=kubeconfig apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml |
| 48 | +kubectl --kubeconfig=kubeconfig -n metallb-system get pods |
| 49 | +kubectl --kubeconfig=kubeconfig apply -f ../kubernetes/infrastructure/networking/metallb/config.yaml |
| 50 | + |
| 51 | +kubectl --kubeconfig=kubeconfig get nodes |
| 52 | +kubectl --kubeconfig=kubeconfig get nodes -o wide |
| 53 | +kubectl --kubeconfig=kubeconfig get deployments |
| 54 | +kubectl --kubeconfig=kubeconfig get pods |
| 55 | +kubectl --kubeconfig=kubeconfig get nodes -o wide |
| 56 | + |
| 57 | +kubectl --kubeconfig=kubeconfig describe deployment hello-world |
| 58 | +kubectl --kubeconfig=kubeconfig describe service hello-world |
| 59 | +kubectl --kubeconfig=kubeconfig get service hello-world -o yaml |
| 60 | +kubectl --kubeconfig=kubeconfig get service hello-world |
| 61 | + |
| 62 | +EXTERNAL_IP=$(kubectl --kubeconfig=kubeconfig get service hello-world -o jsonpath='{.status.loadBalancer.ingress[0].ip}') |
| 63 | + |
| 64 | +echo "EXTERNAL_IP for hello-world is: $EXTERNAL_IP" |
| 65 | + |
| 66 | +PORTS=$(kubectl --kubeconfig=kubeconfig get service hello-world -o jsonpath='{.spec.ports[*].port}') |
| 67 | +echo "PORTS for hello-world are: $PORTS" |
| 68 | +for port in $PORTS; do |
| 69 | + echo "Curling $EXTERNAL_IP:$port" |
| 70 | + curl $EXTERNAL_IP:$port |
| 71 | +done |
| 72 | + |
| 73 | +cd .. |
| 74 | +./save-secrets.sh |
0 commit comments