From a52920d835ad40fe5d5362f8fedec3497aeb7aac Mon Sep 17 00:00:00 2001 From: Andrey Kartashov Date: Fri, 15 Nov 2019 23:21:40 +0700 Subject: [PATCH] move namespaces to main app --- Bootstrap.md | 16 +++++++++++++++- .../templates/namespace-argocd.yaml | 0 .../templates/namespace-cert-manager.yaml | 0 .../templates/namespace-nginx-ingress.yaml | 0 .../templates/namespace-oauth2-proxy.yaml | 0 .../namespace-prometheus-operator.yaml | 0 main/templates/namespaces.yaml | 19 ------------------- 7 files changed, 15 insertions(+), 20 deletions(-) rename apps/namespaces/argocd.yaml => main/templates/namespace-argocd.yaml (100%) rename apps/namespaces/cert-manager.yaml => main/templates/namespace-cert-manager.yaml (100%) rename apps/namespaces/nginx-ingress.yaml => main/templates/namespace-nginx-ingress.yaml (100%) rename apps/namespaces/oauth2-proxy.yaml => main/templates/namespace-oauth2-proxy.yaml (100%) rename apps/namespaces/prometheus-operator.yaml => main/templates/namespace-prometheus-operator.yaml (100%) delete mode 100644 main/templates/namespaces.yaml diff --git a/Bootstrap.md b/Bootstrap.md index 16ea7db..0576476 100644 --- a/Bootstrap.md +++ b/Bootstrap.md @@ -1,36 +1,49 @@ create namespaces -$ kubectl --context=gullfaxi apply -R apps/namespaces +``` +$ kubectl --context=gullfaxi apply main/templates/namespace-*.yaml +``` install nginx-ingress +``` $ helm dep update apps/system/nginx-ingress $ helm template --name nginx-ingress --namespace nginx-ingress apps/system/nginx-ingress | kubectl --context=gullfaxi --namespace nginx-ingress apply -f - +``` install cert-manager with cluster issuer +``` $ helm repo add jetstack https://charts.jetstack.io $ helm dep update apps/system/cert-manager $ helm template --name cert-manager --namespace cert-manager apps/system/cert-manager | kubectl --context=gullfaxi --namespace cert-manager apply -f - +``` install argocd +``` $ kubectl --context=gullfaxi apply -k apps/argocd +``` add dex.github.clientId and dex.github.clientSecret into argo-secret add gitPrivateKey +``` $ kubectl --context=gullfaxi -n argocd edit secret argocd-secret +``` add argocd public key as deploy key to gf-k8s repo log into argocd +``` $ argocd login argocd-grpc.gorilych.ru +``` create main app +``` $ argocd app create main \ --dest-namespace argocd \ --dest-server https://kubernetes.default.svc \ @@ -38,3 +51,4 @@ $ argocd app create main \ --path main \ --sync-policy automated \ --self-heal --auto-prune +``` diff --git a/apps/namespaces/argocd.yaml b/main/templates/namespace-argocd.yaml similarity index 100% rename from apps/namespaces/argocd.yaml rename to main/templates/namespace-argocd.yaml diff --git a/apps/namespaces/cert-manager.yaml b/main/templates/namespace-cert-manager.yaml similarity index 100% rename from apps/namespaces/cert-manager.yaml rename to main/templates/namespace-cert-manager.yaml diff --git a/apps/namespaces/nginx-ingress.yaml b/main/templates/namespace-nginx-ingress.yaml similarity index 100% rename from apps/namespaces/nginx-ingress.yaml rename to main/templates/namespace-nginx-ingress.yaml diff --git a/apps/namespaces/oauth2-proxy.yaml b/main/templates/namespace-oauth2-proxy.yaml similarity index 100% rename from apps/namespaces/oauth2-proxy.yaml rename to main/templates/namespace-oauth2-proxy.yaml diff --git a/apps/namespaces/prometheus-operator.yaml b/main/templates/namespace-prometheus-operator.yaml similarity index 100% rename from apps/namespaces/prometheus-operator.yaml rename to main/templates/namespace-prometheus-operator.yaml diff --git a/main/templates/namespaces.yaml b/main/templates/namespaces.yaml deleted file mode 100644 index b554f05..0000000 --- a/main/templates/namespaces.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: namespaces - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io -spec: - destination: - namespace: default - server: https://kubernetes.default.svc - project: default - source: - path: apps/namespaces - repoURL: git@github.com:gorilych/gf-k8s - syncPolicy: - automated: - prune: true - selfHeal: true