break: switch from k0s to k3s (in docker)

- replace k0s with k3s in docker-compose.yml
- remove k0s-config.yaml
  - remove metallb-address-pool
- update .renovaterc.json to match new file structure
- add new argocd-init files for k3s
- update README to reflect changes

🤖
This commit is contained in:
Sebastian Mark 2024-09-02 22:10:32 +02:00
parent 844c77e7a9
commit 5421b15d4e
8 changed files with 98 additions and 128 deletions

View file

@ -8,16 +8,19 @@
"customType": "regex",
"description": "ArgoCD",
"fileMatch": [
"k0s-config\\.yaml$"
"^argocd-bootstrap/.*\\.yml$"
],
"matchStrings": [
"\\s+version:\\s(?<currentValue>.*)\\s+#\\s+depName=(?<depName>.*)\\s+repoUrl=(?<registryUrl>.*)"
"\\s+chart:\\s(?<depName>.*)",
"\\s+repo:\\s(?<registryUrl>.*)",
"\\s+version:\\s(?<currentValue>.*)"
],
"matchStringsStrategy": "combination",
"datasourceTemplate": "helm"
},
{
"customType": "regex",
"description": "Baseline",
"description": "Baseline Manifests",
"fileMatch": [
"\\.jsonnet$"
],

View file

@ -1,6 +1,6 @@
# k0s Kubernetes + Baseline
# k3s Kubernetes + Baseline
* [k0s](https://docs.k0sproject.io/stable/)
* [k3s](https://docs.k3s.io/)
* [ArgoCD](https://argoproj.github.io/cd/)
* [NGINX Ingress Controller](https://kubernetes.github.io/ingress-nginx/)
* [cert-manager](https://cert-manager.io/)
@ -10,13 +10,13 @@
* [keel](https://keel.sh)
* [reloader](https://github.com/stakater/Reloader)
## Run (k0s + baseline)
## Run (k3s + baseline)
`docker compose up`
### Get kubeconfig
`docker compose exec -it k0s k0s kubeconfig admin`
`docker compose exec -it k3s kubectl config view --flatten`
## Notes

View file

@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: argocd

View file

@ -0,0 +1,21 @@
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: argocd
namespace: kube-system
spec:
# do not change order! (needed for renovate)
chart: argo-cd
repo: https://argoproj.github.io/argo-helm
version: 7.5.2
targetNamespace: argocd
valuesContent: |-
server:
replicas: 1
applicationSet:
enabled: false
notifications:
enabled: false
dex:
enabled: false

View file

@ -0,0 +1,50 @@
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: argocd-apps
namespace: kube-system
spec:
# do not change order! (needed for renovate)
chart: argocd-apps
repo: https://argoproj.github.io/argo-helm
version: 2.0.0
targetNamespace: argocd
valuesContent: |-
projects:
baseline:
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
sourceRepos:
- '*'
destinations:
- namespace: '*'
server: '*'
clusterResourceWhitelist:
- group: '*'
kind: '*'
applications:
baseline:
project: baseline
finalizers:
- resources-finalizer.argocd.argoproj.io
source:
repoURL: 'https://git.smsvc.net/k8s/baseline.git'
targetRevision: HEAD
path: manifests/
directory:
recurse: true
destination:
server: 'https://kubernetes.default.svc'
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 5m

View file

@ -1,22 +1,20 @@
services:
k0s:
image: docker.io/k0sproject/k0s:v1.30.4-k0s.0
command: k0s controller --config=/etc/k0s/config.yaml --enable-worker --no-taints
restart: always
stop_grace_period: 15s
k3s:
image: rancher/k3s:v1.30.4-k3s1
command:
- server
- --disable=traefik
- --tls-san=k8s.smsvc.net
hostname: k8s.smsvc.net
restart: always
privileged: true
cgroup: host
network_mode: host
volumes:
- k0s-data:/var/lib/k0s/
- k0s-run:/run/
- k0s-storage:/var/openebs/
- k0s-run-udev:/run/udev
- ./k0s-config.yaml:/etc/k0s/config.yaml
- k3s-data:/var/lib/rancher/k3s/
- k3s-run:/run/
- ./argocd-init/:/var/lib/rancher/k3s/server/manifests/argocd-init/
volumes:
k0s-data:
k0s-run:
k0s-storage:
k0s-run-udev:
k3s-data:
k3s-run:

View file

@ -1,97 +0,0 @@
---
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
metadata:
name: k0s
spec:
api:
sans:
- k8s.smsvc.net
telemetry:
enabled: false
extensions:
helm:
repositories:
- name: argocd
url: https://argoproj.github.io/argo-helm
- name: metallb
url: https://metallb.github.io/metallb
- name: openebs-internal
url: https://openebs.github.io/charts
charts:
- name: openebs
chartname: openebs-internal/openebs
version: 3.10.0 # depName=openebs repoUrl=https://openebs.github.io/charts
namespace: openebs
order: 0
values: |
localprovisioner:
hostpathClass:
enabled: true
isDefaultClass: true
- name: metallb
chartname: metallb/metallb
version: 0.14.8 # depName=metallb repoUrl=https://metallb.github.io/metallb
namespace: metallb
order: 0
- name: argocd
chartname: argocd/argo-cd
version: 7.5.0 # depName=argo-cd repoUrl=https://argoproj.github.io/argo-helm
namespace: argocd
order: 1
values: |
applicationSet:
enabled: false
notifications:
enabled: false
dex:
enabled: false
- name: argocd-apps
chartname: argocd/argocd-apps
version: 2.0.0 # depName=argocd-apps repoUrl=https://argoproj.github.io/argo-helm
namespace: argocd
order: 2
values: |
projects:
baseline:
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
sourceRepos:
- '*'
destinations:
- namespace: '*'
server: '*'
clusterResourceWhitelist:
- group: '*'
kind: '*'
applications:
baseline:
project: baseline
finalizers:
- resources-finalizer.argocd.argoproj.io
source:
repoURL: 'https://git.smsvc.net/k8s/baseline.git'
targetRevision: HEAD
path: manifests/
directory:
recurse: true
destination:
server: 'https://kubernetes.default.svc'
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 5m

View file

@ -1,10 +0,0 @@
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: metallb-address-pool
namespace: metallb
annotations:
spec:
addresses:
- 194.55.14.183/32