feat(kustomization): Add kustomization for deployment

When deploying anything on the cluster, a `kustomization.yaml` is to be used to allow for on-the-fly patches, and autonomous cluster configuration through native k8s file configuration. This commit adds the first iteration for such implementation, essentially fixing the issue of setting up the cluster from a clean base. Now everything is consolidated into one single file, which later applies desired resources. This also fixes having to copy and paste URLs into the console, as Kustomize allows one to put those URLs into the kustomization file.
This commit is contained in:
Tanguy Herbron 2022-12-30 23:48:09 +01:00
parent 19fd875927
commit 99734efe1a
6 changed files with 30 additions and 12 deletions

View File

@ -74,19 +74,10 @@ Add node to the list of available load balancer
`kubectl label node <node-name> svccontroller.k3s.cattle.io/enablelb=true`
NOTE: For development, don't forget to also add the `cp` to the LB list, in order to access local only services
Setup OVH configuration
`kubectl apply -f ovh-config.yaml`
Install longhorn
Setup the cluster's backbone
```
kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/longhorn.yaml
kubectl apply -k .
```
Remove `local-path` from default StorageClass
`kubectl patch storageclass standard -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'`
Add longhorn storage classes
`kubectl apply -f res`
### Convert helm chart to k3s manifest
`helm template chart stable/chart --output-dir ./chart`

10
kustomization.yaml Normal file
View File

@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml
- metallb
- ovh-config.yaml
- res
- https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/longhorn.yaml
- longhorn

View File

@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ingress.yaml

View File

@ -6,4 +6,4 @@ metadata:
spec:
addresses:
- 10.19.66.247/32
- 10.10.0.64-10.10.0.69
- 10.10.0.0/24

View File

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- configmap.yaml
- ipaddresspool.yaml

6
res/kustomization.yaml Normal file
View File

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- flat-sc.yaml
- redundant-sc.yaml