From 37bd4363d4c9580dc6590fcf7c6fed83b28fc59d Mon Sep 17 00:00:00 2001 From: Moritz Graf Date: Sat, 4 Apr 2020 13:12:40 +0200 Subject: [PATCH] Running helm-operator,ingress & cert-manager --- k8s/README.md | 45 +++++++++++++++++++++++++++++++ k8s/infrapuzzle/cert-manager.yaml | 16 +++++++++++ k8s/infrapuzzle/ingress.yaml | 18 +++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 k8s/README.md create mode 100644 k8s/infrapuzzle/cert-manager.yaml create mode 100644 k8s/infrapuzzle/ingress.yaml diff --git a/k8s/README.md b/k8s/README.md new file mode 100644 index 0000000..5fa5ad9 --- /dev/null +++ b/k8s/README.md @@ -0,0 +1,45 @@ +# k8s + +This folder holds all the services required for my private infrastructure. Following contraints apply: + +* Order of implementation is top down. +* Every namespace has a subfolder within this subdirectory. +* helm3 + +## namespaces + +```yaml +k create ns flux +k create ns infrapuzzle + +``` + +## [helm-operator](https://github.com/fluxcd/helm-operator/blob/master/chart/helm-operator/README.md) + +As I use helm extensively, using the helm-operator was a logical step. [See documentation for installation.](https://github.com/fluxcd/helm-operator/blob/master/chart/helm-operator/README.md) + +```bash +$ helm repo add fluxcd https://charts.fluxcd.io +$ helm repo update +$ kubectl apply -f https://raw.githubusercontent.com/fluxcd/helm-operator/master/deploy/crds.yaml +$ helm upgrade -i helm-operator fluxcd/helm-operator \ + --namespace flux \ + --set helm.versions=v3 +``` + +## [ingress-controller](https://github.com/helm/charts/tree/master/stable/nginx-ingress) + +Apply with helm-operator: + +```bash +$ kubectl apply -f infrapuzzle/ingress.yaml -n flux +``` + +## [cert-manager](https://cert-manager.io/docs/tutorials/acme/ingress/) + +Apply with helm-operator: + +```bash +$ kubectl apply -f https://raw.githubusercontent.com/jetstack/cert-manager/master/deploy/manifests/00-crds.yaml +$ kubectl apply -f infrapuzzle/cert-manager.yaml -n flux +``` diff --git a/k8s/infrapuzzle/cert-manager.yaml b/k8s/infrapuzzle/cert-manager.yaml new file mode 100644 index 0000000..cf67c15 --- /dev/null +++ b/k8s/infrapuzzle/cert-manager.yaml @@ -0,0 +1,16 @@ +apiVersion: helm.fluxcd.io/v1 +kind: HelmRelease +metadata: + name: helm-cert-manager + namespace: flux +spec: + releaseName: cert-manager + targetNamespace: infrapuzzle + chart: + repository: https://charts.jetstack.io + version: v0.14.1 + name: cert-manager + values: + global: + rbac: + create: true diff --git a/k8s/infrapuzzle/ingress.yaml b/k8s/infrapuzzle/ingress.yaml new file mode 100644 index 0000000..784800b --- /dev/null +++ b/k8s/infrapuzzle/ingress.yaml @@ -0,0 +1,18 @@ +apiVersion: helm.fluxcd.io/v1 +kind: HelmRelease +metadata: + name: helm-nginx-ingress + namespace: flux +spec: + releaseName: nginx-ingress + targetNamespace: infrapuzzle + chart: + repository: https://kubernetes-charts.storage.googleapis.com + version: 1.35.0 + name: nginx-ingress + values: + controller: + #hostNetwork: true + kind: DaemonSet + daemonset: + useHostPort: true \ No newline at end of file