Skip to content

Commit f9db5b0

Browse files
committed
refactor
1 parent d2bf1df commit f9db5b0

15 files changed

Lines changed: 114 additions & 58 deletions

File tree

infra/talos/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

infra/talos/01b.us-init.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

infra/talos/01b.us-load.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

infra/talos/01b.us-save.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

infra/talos/01b.us.enc

Lines changed: 0 additions & 20 deletions
This file was deleted.

infra/talos/01b.us/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
secret*
2+
!secrets.enc

infra/talos/01b.us/TODO

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
investigate talhelper
2+
https://github.com/joeypiccola/k8s_home/tree/main?tab=readme-ov-file#talos-configs
3+
4+
argo/helm setup
5+
6+
use terraform
7+
8+
??? other things ???

infra/talos/01b.us/init-cluster.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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

infra/talos/metallb-config.yaml renamed to infra/talos/01b.us/kubernetes/infrastructure/networking/metallb/config.yaml

File renamed without changes.

infra/talos/01b.us/load-secrets.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
if [ -d secrets ]; then
3+
echo "secrets directory already exists"
4+
exit 1
5+
fi
6+
sops --decrypt secrets.enc | base64 -d | tar xzf -

0 commit comments

Comments
 (0)