Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
**/charts
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
## Bootstrapping

```bash
# Create a cluster
k3d cluster create mycluster --image rancher/k3s:v1.29.6-k3s1

# (Optional) Create a vcluster inside it
vcluster create vc-1

git clone https://github.com/kir-dev/k8s
cd k8s

# Install ArgoCD into the Kubernetes cluster
kubectl apply --kustomize argocd
kubectl apply --kustomize argocd/

# Install this repo as an ArgoCD Application
kubectl apply -f application.yaml
kubectl apply -f application-set/
```

## Documentation

- https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/
- ArgoCD `Application` reference: https://argo-cd.readthedocs.io/en/stable/user-guide/application-specification/
- Manage Argo CD Using Argo CD: https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#manage-argo-cd-using-argo-cd
- Kustomization file documentation: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/
32 changes: 32 additions & 0 deletions application-set/application-set.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
kind: ApplicationSet
apiVersion: argoproj.io/v1alpha1
metadata:
name: apps
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- git:
repoURL: https://github.com/albi005/k8s
revision: HEAD
directories:
- path: "*"
template:
metadata:
name: "{{.path.basename}}"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://github.com/albi005/k8s
path: "{{.path.path}}"
destination:
name: in-cluster
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
19 changes: 0 additions & 19 deletions application.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions argocd/application.yaml

This file was deleted.

50 changes: 46 additions & 4 deletions argocd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,51 @@
# https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#manage-argo-cd-using-argo-cd

resources:
- namespace.yaml
# TODO: Replace `stable` with a git commit hash and let Renovate update it
# automatically to the latest commit of the `stable` branch
- https://github.com/argoproj/argo-cd//manifests/cluster-install?ref=stable
- namespace.yaml
# TODO: Replace `stable` with a git commit hash and let Renovate update it
# automatically to the latest commit of the `stable` branch
- https://github.com/argoproj/argo-cd//manifests/cluster-install?ref=stable

patches:
# https://argo-cd.readthedocs.io/en/stable/user-guide/kustomize/#kustomizing-helm-charts
- target:
kind: ConfigMap
name: argocd-cm
patch: |-
- op: add
path: /data/kustomize.buildOptions
value: "--enable-helm"

# GROUP 1: Heavy Components
# (Repo Server, API Server, App Controller need more RAM/CPU)
- target:
kind: (Deployment|StatefulSet)
name: (argocd-repo-server|argocd-server|argocd-application-controller)
patch: |-
- op: add
path: /spec/template/spec/containers/0/resources
value:
requests:
cpu: "50m"
memory: "128Mi"
limits:
cpu: "1000m"
memory: "1Gi"

# GROUP 2: Light Components
# (Redis, Dex, Notifications, AppSet need very little)
- target:
kind: Deployment
name: (argocd-redis|argocd-dex-server|argocd-notifications-controller|argocd-applicationset-controller)
patch: |-
- op: add
path: /spec/template/spec/containers/0/resources
value:
requests:
cpu: "10m"
memory: "64Mi"
limits:
cpu: "200m"
memory: "256Mi"

namespace: argocd
31 changes: 0 additions & 31 deletions cert-manager/application.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions cert-manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace: cert-manager
resources:
- namespace.yaml
helmCharts:
- name: cert-manager
repo: oci://quay.io/jetstack/charts
version: v1.19.2
releaseName: cert-manager
namespace: cert-manager
includeCRDs: true
valuesInline:
crds:
enabled: true
global:
leaderElection:
namespace: cert-manager
4 changes: 4 additions & 0 deletions cert-manager/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: cert-manager
22 changes: 0 additions & 22 deletions cnpg-barman-cloud-plugin/application.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions cnpg/application.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions cnpg/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace: cnpg-system
resources:
- namespace.yaml
helmCharts:
- name: cloudnative-pg
repo: https://cloudnative-pg.github.io/charts
version: 0.27.0
releaseName: cnpg
namespace: cnpg-system
includeCRDs: true
4 changes: 4 additions & 0 deletions cnpg/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: cnpg-system
39 changes: 0 additions & 39 deletions kube-prometheus-stack/application.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions kube-prometheus-stack/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace: monitoring
helmCharts:
- name: kube-prometheus-stack
repo: https://prometheus-community.github.io/helm-charts
version: 80.13.3
releaseName: kube-prometheus-stack
namespace: monitoring
includeCRDs: true
valuesInline:
grafana:
additionalDataSources:
- name: Loki
type: loki
url: http://loki-gateway.monitoring.svc.cluster.local
- name: Tempo
type: tempo
url: http://tempo.monitoring.svc.cluster.local:3200
prometheus:
prometheusSpec:
serviceMonitorSelectorNilUsesHelmValues: false
selector: {}
16 changes: 0 additions & 16 deletions kustomization.yaml

This file was deleted.

Loading