cozystack configmap

This commit is contained in:
Andrei Kvapil
2024-01-03 12:37:42 +01:00
parent 0abb3f9130
commit 76c93639d8
30 changed files with 139 additions and 143 deletions

View File

@@ -141,6 +141,20 @@ cluster:
etcd:
advertisedSubnets:
- 192.168.100.0/24
inlineManifests:
- name: cozystack
contents: |
apiVersion: v1
kind: ConfigMap
metadata:
name: cozystack
namespace: cozy-system
data:
ipv4-pod-cidr: "10.244.0.0/16"
ipv4-pod-gateway: "10.244.0.1"
ipv4-svc-cidr: "10.96.0.0/16"
ipv4-join-cidr: "100.64.0.0/16"
EOT
```

2
TODO
View File

@@ -16,3 +16,5 @@ flux policies
talos linux firmware
replace reconcile.sh
trigger reinstall when more nodes added
metallb-configuration
docs: each chart should be self sufficient

View File

@@ -1,3 +1,2 @@
apply show diff repo:
make -C core $@
repo:
make -C system $@

View File

@@ -1,16 +1,2 @@
REPO=core
apply show diff:
make -C namespaces $@
make -C cilium $@
make -C kubeovn $@
make -C fluxcd $@
repo: fix-chartnames
rm -rf ../repos/$(REPO)
mkdir -p ../repos/$(REPO)
cd ../repos/$(REPO) && helm package $$(find ../../$(REPO) -mindepth 2 -maxdepth 2 -name Chart.yaml | awk 'sub("/Chart.yaml", "")')
cd ../repos/$(REPO) && helm repo index .
fix-chartnames:
find . -name Chart.yaml -maxdepth 2 | awk -F/ '{print $$2}' | while read i; do printf "name: cozy-%s\nversion: 1.0.0\n" "$$i" > "$$i/Chart.yaml"; done

View File

@@ -1,25 +1,17 @@
NAMESPACE=cozy-system
NAME=fluxcd-releases
NAME=platform
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server
apply:
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server | kubectl apply -f-
namespaces-show:
helm template -n $(NAMESPACE) $(NAME) . -s templates/namespaces.yaml
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server . -s templates/namespaces.yaml
namespaces-apply:
helm template -n $(NAMESPACE) $(NAME) . -s templates/namespaces.yaml | kubectl apply -f-
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server . -s templates/namespaces.yaml | kubectl apply -f-
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts
helm repo add cilium https://helm.cilium.io/
helm repo update cilium
helm pull cilium/cilium --untar --untardir charts
sed -i -e '/Used in iptables/d' -e '/SYS_MODULE/d' charts/cilium/values.yaml
patch -p3 < patches/fix-cgroups.patch

View File

@@ -0,0 +1,18 @@
{{/*
Get IP-addresses of master nodes
*/}}
{{- define "master.nodeIPs" -}}
{{- $nodes := lookup "v1" "Node" "" "" -}}
{{- $ips := list -}}
{{- range $node := $nodes.items -}}
{{- if eq (index $node.metadata.labels "node-role.kubernetes.io/control-plane") "" -}}
{{- range $address := $node.status.addresses -}}
{{- if eq $address.type "InternalIP" -}}
{{- $ips = append $ips $address.address -}}
{{- break -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ join "," $ips }}
{{- end -}}

View File

@@ -1,55 +0,0 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: cilium
namespace: cozy-cilium
spec:
interval: 1m
releaseName: cilium
chart:
spec:
chart: cozy-cilium
sourceRef:
kind: HelmRepository
name: cozystack-system
namespace: cozy-system
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: kubeovn
namespace: cozy-kubeovn
spec:
interval: 1m
releaseName: kubeovn
chart:
spec:
chart: cozy-kubeovn
sourceRef:
kind: HelmRepository
name: cozystack-system
namespace: cozy-system
dependsOn:
- name: cilium
namespace: cozy-cilium
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: cozy-fluxcd
namespace: cozy-fluxcd
spec:
interval: 1m
releaseName: fluxcd
chart:
spec:
chart: cozy-fluxcd
sourceRef:
kind: HelmRepository
name: cozystack-system
namespace: cozy-system
dependsOn:
- name: cilium
namespace: cozy-cilium
- name: kubeovn
namespace: cozy-kubeovn

View File

@@ -1,3 +1,62 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: cilium
namespace: cozy-cilium
spec:
interval: 1m
releaseName: cilium
chart:
spec:
chart: cozy-cilium
sourceRef:
kind: HelmRepository
name: cozystack-system
namespace: cozy-system
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: kubeovn
namespace: cozy-kubeovn
spec:
interval: 1m
releaseName: kubeovn
chart:
spec:
chart: cozy-kubeovn
sourceRef:
kind: HelmRepository
name: cozystack-system
namespace: cozy-system
values:
cozystack:
configHash: {{ index (lookup "v1" "ConfigMap" "cozy-system" "cozystack") "data" | toJson | sha256sum }}
nodesHash: {{ include "master.nodeIPs" . | sha256sum }}
dependsOn:
- name: cilium
namespace: cozy-cilium
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: cozy-fluxcd
namespace: cozy-fluxcd
spec:
interval: 1m
releaseName: fluxcd
chart:
spec:
chart: cozy-fluxcd
sourceRef:
kind: HelmRepository
name: cozystack-system
namespace: cozy-system
dependsOn:
- name: cilium
namespace: cozy-cilium
- name: kubeovn
namespace: cozy-kubeovn
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease

View File

@@ -1,24 +1,5 @@
REPO=system
apply show diff:
make -C cert-manager $@
make -C cert-manager-issuers $@
make -C victoria-metrics-operator $@
make -C monitoring $@
make -C kubevirt-operator $@
make -C kubevirt $@
make -C metallb $@
make -C grafana-operator $@
make -C mariadb-operator $@
make -C postgres-operator $@
make -C rabbitmq-operator $@
make -C redis-operator $@
make -C piraeus-operator $@
make -C linstor $@
make -C telepresence $@
make -C ingress-nginx $@
make -C kubeapps $@
repo: fix-chartnames
rm -rf ../repos/$(REPO)
mkdir -p ../repos/$(REPO)

View File

@@ -2,10 +2,10 @@ NAME=cert-manager-issuers
NAMESPACE=cozy-cert-manager
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .

View File

@@ -2,13 +2,13 @@ NAME=cert-manager
NAMESPACE=cozy-cert-manager
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAMESPACE=cozy-cilium
NAME=cilium
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAMESPACE=cozy-fluxcd
NAME=fluxcd
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAME=grafana-operator
NAMESPACE=cozy-grafana-operator
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAME=ingress-nginx
NAMESPACE=cozy-ingress-nginx
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAME=kubeapps
NAMESPACE=cozy-kubeapps
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update: update-chart update-dockerfiles
image: image-dashboard image-kubeapps-apis

View File

@@ -8,7 +8,7 @@ apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --dry-run --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts && mkdir -p charts/kube-ovn

View File

@@ -2,13 +2,13 @@ NAME=kubevirt-operator
NAMESPACE=cozy-kubevirt
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf templates

View File

@@ -2,13 +2,13 @@ NAME=kubevirt
NAMESPACE=cozy-kubevirt
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf templates

View File

@@ -2,10 +2,10 @@ NAME=linstor
NAMESPACE=cozy-linstor
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .

View File

@@ -2,13 +2,13 @@ NAME=mariadb-operator
NAMESPACE=cozy-mariadb-operator
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,10 +2,10 @@ NAME=metallb-addresses
NAMESPACE=cozy-metallb
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .

View File

@@ -2,13 +2,13 @@ NAME=metallb
NAMESPACE=cozy-metallb
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAME=monitoring
NAMESPACE=cozy-monitoring
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAME=piraeus-operator
NAMESPACE=cozy-linstor
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAME=postgres-operator
NAMESPACE=cozy-postgres-operator
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAME=rabbitmq-operator
NAMESPACE=cozy-rabbitmq-operator
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf templates/cluster-operator.yml

View File

@@ -2,13 +2,13 @@ NAME=redis-operator
NAMESPACE=cozy-redis-operator
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAME=traffic-manager
NAMESPACE=cozy-telepresence
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts

View File

@@ -2,13 +2,13 @@ NAME=victoria-metrics-operator
NAMESPACE=cozy-victoria-metrics-operator
show:
helm template -n $(NAMESPACE) $(NAME) .
helm template --dry-run=server -n $(NAMESPACE) $(NAME) .
apply:
helm upgrade -i -n $(NAMESPACE) $(NAME) .
diff:
helm diff upgrade --allow-unreleased -n $(NAMESPACE) $(NAME) .
helm diff upgrade --allow-unreleased --normalize-manifests -n $(NAMESPACE) $(NAME) .
update:
rm -rf charts