Skip to content

Commit

Permalink
#1: Initialised cluster 4546B.
Browse files Browse the repository at this point in the history
Signed-off-by: Wim de Groot <[email protected]>
  • Loading branch information
wim-de-groot committed Apr 1, 2024
0 parents commit c34c042
Show file tree
Hide file tree
Showing 17 changed files with 238 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 4546B


70 changes: 70 additions & 0 deletions apps/argocd/argocd/bootstrap-app-set.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: bootstrap
spec:
generators:
- matrix:
generators:
- list:
elements:
- repoURL: https://github.com/wim-de-groot/4546B.git
revision: HEAD
repoPath: apps/*/*
- git:
repoURL: '{{ repoURL }}'
revision: '{{ revision }}'
directories:
- path: '{{ repoPath }}'
syncPolicy:
preserveResourcesOnDeletion: true
template:
metadata:
name: '{{ path[1] }}-{{ path.basenameNormalized }}'
namespace: argocd
spec:
project: default
source:
repoURL: '{{ repoURL }}'
targetRevision: '{{ revision }}'
path: '{{ path }}'
destination:
server: https://kubernetes.default.svc
namespace: '{{ path[1] }}'
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
- RespectIgnoreDifferences=true
- SkipDryRunOnMissingResource=true
retry:
limit: -1 # Infinite retries
backoff:
duration: 30s
factor: 2
maxDuration: 5m
ignoreDifferences:
# Cilium generated certs
- name: cilium-ca
kind: Secret
namespace: kube-system
jsonPointers:
- /data/ca.crt
- /data/ca.key
- name: hubble-server-certs
kind: Secret
namespace: kube-system
jsonPointers:
- /data/ca.crt
- /data/tls.crt
- /data/tls.key
- name: hubble-relay-client-certs
kind: Secret
namespace: kube-system
jsonPointers:
- /data/ca.crt
- /data/tls.crt
- /data/tls.key
18 changes: 18 additions & 0 deletions apps/argocd/argocd/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd
namespace: argocd
spec:
ingressClassName: cilium
rules:
- host: argocd.home.lab
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: argocd-server
port:
number: 80
8 changes: 8 additions & 0 deletions apps/argocd/argocd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace: argocd

resources:
- namespace.yaml
- github.com/argoproj/argo-cd/manifests/cluster-install?ref=v2.9.3
- bootstrap-app-set.yaml
- ingress.yaml

4 changes: 4 additions & 0 deletions apps/argocd/argocd/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: argocd
6 changes: 6 additions & 0 deletions apps/kube-system/address-pool/advertisement.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: default
namespace: kube-system
spec: {}
8 changes: 8 additions & 0 deletions apps/kube-system/address-pool/ip-address-pool.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: default
namespace: kube-system
spec:
addresses:
- 10.0.0.245-10.0.0.250
2 changes: 2 additions & 0 deletions apps/kube-system/address-pool/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- ip-address-pool.yaml
7 changes: 7 additions & 0 deletions apps/kube-system/cilium/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: cilium
version: v1.14.5
dependencies:
- name: cilium
version: v1.14.5
repository: https://helm.cilium.io
41 changes: 41 additions & 0 deletions apps/kube-system/cilium/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
cilium:
kubeProxyReplacement: true
ipam:
mode: kubernetes
securityContext:
capabilities:
ciliumAgent:
- CHOWN
- KILL
- NET_ADMIN
- NET_RAW
- IPC_LOCK
- SYS_ADMIN
- SYS_RESOURCE
- DAC_OVERRIDE
- FOWNER
- SETUID
- SETGID
cleanCiliumState:
- NET_ADMIN
- SYS_ADMIN
- SYS_RESOURCE
cgroup:
hostRoot: /sys/fs/cgroup
autoMount:
enabled: false
# Enable Cilium Ingress Controller
ingressController:
enabled: true
loadbalancerMode: shared
allocateLoadBalancerNodePorts: false
# Use KubePrism to access cluster API
k8sServiceHost: localhost
k8sServicePort: 7445
# Enable Hubble
hubble:
relay:
enabled: true
ui:
enabled: true

7 changes: 7 additions & 0 deletions apps/kube-system/metallb/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: metallb
version: 5.0.2
dependencies:
- name: metallb
version: 5.0.2
repository: https://charts.bitnami.com/bitnami
31 changes: 31 additions & 0 deletions infra/cluster-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
kind: Cluster
name: 4546B
talos:
version: v1.6.1
kubernetes:
version: 1.28.6
features:
enableWorkloadProxy: false
patches:
- name: cni
file: infra/patches/cni.yaml
---
kind: ControlPlane
machineClass:
name: controlplane
size: 3
patches:
- name: scheduling
file: infra/patches/scheduling.yaml
- name: cilium
file: infra/patches/cilium.yaml
- name: argocd
file: infra/patches/argocd.yaml
- name: monitoring
file: infra/patches/monitoring.yaml
---
kind: Workers
name: workers
machineClass:
name: worker
size: unlimited
6 changes: 6 additions & 0 deletions infra/patches/argocd.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions infra/patches/cilium.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions infra/patches/cni.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cluster:
network:
cni:
name: none
proxy:
disabled: true
13 changes: 13 additions & 0 deletions infra/patches/monitoring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cluster:
apiServer:
extraArgs:
bind-address: 0.0.0.0
controllerManager:
extraArgs:
bind-address: 0.0.0.0
etcd:
extraArgs:
listen-metrics-urls: http://0.0.0.0:2381
scheduler:
extraArgs:
bind-address: 0.0.0.0
2 changes: 2 additions & 0 deletions infra/patches/scheduling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cluster:
allowSchedulingOnControlPlanes: true

0 comments on commit c34c042

Please sign in to comment.