diff options
Diffstat (limited to 'danneri')
-rw-r--r-- | danneri/README.md | 60 | ||||
-rw-r--r-- | danneri/cilium.yaml | 44 | ||||
-rw-r--r-- | danneri/config.yaml | 18 | ||||
-rw-r--r-- | danneri/futar-deployment.yml | 60 |
4 files changed, 182 insertions, 0 deletions
diff --git a/danneri/README.md b/danneri/README.md new file mode 100644 index 0000000..26a9e85 --- /dev/null +++ b/danneri/README.md @@ -0,0 +1,60 @@ +# Installing k3s + +Create `/etc/rancher/k3s/config.yaml`. Must be done before installation. + +Run: `curl -sfL https://get.k3s.io | bash` + +Copy /etc/rancher/k3s/k3s.yaml to ~/.kube/config. Adjust `server:` url. + +Reinstalling: + + k3s-uninstall.sh + +Reboot + + cd /etc + git restore rancher/k3s/config.yaml + cd + curl -sfL https://get.k3s.io | bash + +# Get kubeconfig + + ssh danneri.dn42.trygvis.io sudo cat /etc/rancher/k3s/k3s.yaml |\ + sed s,https://.*,https://danneri.dn42.trygvis.io:6443, > ~/.kube/config + +# Installing Cilium: + + cilium install -f cilium.yaml + +old: + + cilium install \ + --set routingMode=native \ + --set ipv4.enabled=true \ + --set ipam.operator.clusterPoolIPv4PodCIDRList=10.0.0.0/8 \ + --set ipv4NativeRoutingCIDR=10.0.0.0/8 \ + --set ipv6.enabled=true \ + --set enableIPv6Masquerade=false \ + --set k8s.requireIPv6PodCIDR=true \ + --set ipam.operator.clusterPoolIPv6PodCIDRList=fdb1:4242:3538:2008:aaaa:aaaa:aaaa::/96 \ + --set ipam.operator.clusterPoolIPv6MaskSize=112 \ + --set ipv6NativeRoutingCIDR=fdb1:4242:3538:2008::/64 \ + --set kubeProxyReplacement=true \ + --set k8sServiceHost=fdb1:4242:3538:2008:9422:d355:95b7:f170 \ + --set k8sServicePort=6443 + +TODO: check `kubeProxyReplacement=true` / `kube-proxy-replacement`. + +# Uninstalling + +Run: `k3s-uninstall.sh`. Note that this will delete everything, including `/etc/rancher/k3s/config.yaml`. + + rm -rf \ + /var/lib/cni \ + /etc/cni \ + /var/lib/rancher \ + /run/cilium \ + /run/containerd \ + /etc/sysctl.d/99-zzz-override_cilium.conf + +and then do a reboot to really stop Cilium from running. diff --git a/danneri/cilium.yaml b/danneri/cilium.yaml new file mode 100644 index 0000000..144e819 --- /dev/null +++ b/danneri/cilium.yaml @@ -0,0 +1,44 @@ +# https://yolops.net/k3s-at-home.html +# https://yolops.net/k8s-dualstack-cilium.html +# https://www.jeffgeerling.com/blog/2022/quick-hello-world-http-deployment-testing-k3s-and-traefik +# https://www.redpill-linpro.com/techblog/2024/01/03/cilium-dual-stack-k3s-pi-setup.html +--- +k8sServiceHost: fdb1:4242:3538:2008:9422:d355:95b7:f170 +k8sServicePort: 6443 +ipv4: + enabled: false +ipv6: + enabled: true +ipam: + mode: cluster-pool + operator: + # clusterPoolIPv4PodCIDRList: "10.96.0.0/16" + # clusterPoolIPv4MaskSize: 24 + clusterPoolIPv6PodCIDRList: "fdb1:4242:3538:2008:cccc:cccc::/96" + clusterPoolIPv6MaskSize: 112 +bpf: + masquerade: false + +enableIPv6Masquerade: false +kubeProxyReplacement: true + +# new +ipv6NativeRoutingCIDR: fdb1:4242:3538:2008::/64 + +extraConfig: + enable-ipv6-ndp: "true" + ipv6-mcast-device: "enp1s0" + ipv6-service-range: "fdb1:4242:3538:2008:5555:5555:5555::/112" + routing-mode: "native" +operator: + replicas: 1 + +# enable-bpf-masquerade true +# enable-endpoint-health-checking true +# enable-health-check-loadbalancer-ip false +# enable-health-check-nodeport true +# enable-health-checking true +# enable-hubble true +# enable-ipv4 false +# enable-ipv4-big-tcp false +# enable-ipv4-masquerade diff --git a/danneri/config.yaml b/danneri/config.yaml new file mode 100644 index 0000000..198d09f --- /dev/null +++ b/danneri/config.yaml @@ -0,0 +1,18 @@ +tls-san: + - "danneri.dn42.trygvis.io" + - "fdb1:4242:3538:2008:9422:d355:95b7:f170" + - "2a06:2240:f00d:b500:9422:d355:95b7:f170" + +node-ip: "fdb1:4242:3538:2008:9422:d355:95b7:f170" +cluster-cidr: "fdb1:4242:3538:2008:aaaa:aaaa:aaaa::/96" +service-cidr: "fdb1:4242:3538:2008:bbbb:bbbb:bbbb::/112" +# This https://docs.cilium.io/en/stable/network/kubernetes/requirements/#enable-automatic-node-cidr-allocation-recommended recommends that --allocate-node-cidrs is added to kube-controller-manager +kube-controller-manager-arg: node-cidr-mask-size-ipv6=112 +flannel-backend: none +disable: +# - traefik + - servicelb +disable-network-policy: true +disable-kube-proxy: true + +# default-local-storage-path: /srv/k3s-local-storage diff --git a/danneri/futar-deployment.yml b/danneri/futar-deployment.yml new file mode 100644 index 0000000..00a07ca --- /dev/null +++ b/danneri/futar-deployment.yml @@ -0,0 +1,60 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: futar-deployment + labels: + app: futar +spec: + selector: + matchLabels: + app: futar + replicas: 2 + template: + metadata: + labels: + app: futar + spec: + containers: + - name: futar + image: ghcr.io/trygvis/futar:main + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: futar-np +spec: + selector: + app: futar + ports: + - protocol: TCP + port: 80 + targetPort: 8080 + nodePort: 30000 + type: NodePort + +--- +apiVersion: v1 +kind: Service +metadata: + name: futar +spec: + selector: + app: futar + ports: + - protocol: TCP + port: 8080 + +--- +apiVersion: v1 +kind: Service +metadata: + name: futar-lb +spec: + selector: + app: futar + type: LoadBalancer + ports: + - protocol: TCP + port: 8080 |