From 97f60ed897c8fe01312eff21f707678045000b4b Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Fri, 18 Sep 2020 14:57:33 +0100 Subject: [PATCH] Make KubeZero bootstrap flow work again --- deploy/deploy.sh | 14 ++++++-------- deploy/templates/values.yaml | 18 +++++++++--------- deploy/values-step-6.yaml | 3 +++ 3 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 deploy/values-step-6.yaml diff --git a/deploy/deploy.sh b/deploy/deploy.sh index b1ea4e90..87bc4125 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -8,7 +8,7 @@ function wait_for() { local TRIES=0 while true; do $@ && break - [ $TRIES -eq 100 ] && return 1 + [ $TRIES -eq 200 ] && return 1 let TRIES=$TRIES+1 sleep 3 done @@ -60,12 +60,12 @@ EOF wait_for kubectl get Issuer -n kube-system kubezero-local-ca-issuer 2>/dev/null 1>&2 wait_for kubectl get ClusterIssuer letsencrypt-dns-prod 2>/dev/null 1>&2 kubectl wait --for=condition=Ready -n kube-system Issuer/kubezero-local-ca-issuer - kubectl wait --for=condition=Ready ClusterIssuer/letsencrypt-dns-prod fi # Now that we have the cert-manager webhook, get the kiam certs in place but do NOT deploy kiam yet helm template $DEPLOY_DIR -f values.yaml -f cloudbender.yaml -f $DEPLOY_DIR/values-step-3.yaml > generated-values.yaml helm upgrade -n argocd kubezero kubezero/kubezero-argo-cd -f generated-values.yaml + kubectl wait --for=condition=Ready -n kube-system certificates/kiam-server # Now lets make sure kiam is working helm template $DEPLOY_DIR -f values.yaml -f cloudbender.yaml -f $DEPLOY_DIR/values-step-4.yaml > generated-values.yaml @@ -79,12 +79,10 @@ EOF wait_for kubectl get deployment -n istio-operator istio-operator 2>/dev/null 1>&2 kubectl rollout status deployment -n istio-operator istio-operator - # Todo: Now we need to wait till all is synced and healthy ... argocd cli or kubectl ? - # Wait for aws-ebs or kiam to be all ready, or all pods running ? - - # Todo: - # - integrate Prometheus-Grafana - # - integrate ES based logging + # Metrics + helm template $DEPLOY_DIR -f values.yaml -f cloudbender.yaml -f $DEPLOY_DIR/values-step-6.yaml > generated-values.yaml + helm upgrade -n argocd kubezero kubezero/kubezero-argo-cd -f generated-values.yaml + wait_for kubectl get crds servicemonitors.monitoring.coreos.com 2>/dev/null 1>&2 # Finally we could enable the actual config and deploy all helm template $DEPLOY_DIR -f values.yaml -f cloudbender.yaml > generated-values.yaml diff --git a/deploy/templates/values.yaml b/deploy/templates/values.yaml index 784dc5c8..b971aad5 100644 --- a/deploy/templates/values.yaml +++ b/deploy/templates/values.yaml @@ -8,7 +8,7 @@ kubezero: values: network: {{ default "vxlan" .Values.calico.network }} mtu: {{ default "8941" .Values.calico.mtu }} - prometheus: {{ default .Values.metrics.enabled .Values.metrics.ready }} + prometheus: {{ and .Values.metrics.enabled .Values.metrics.ready }} cert-manager: enabled: {{ index .Values "cert-manager" "enabled" }} values: @@ -56,11 +56,11 @@ kubezero: replicas: {{ ternary 2 1 .Values.HighAvailableControlplane }} prometheus: servicemonitor: - enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} + enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }} agent: prometheus: servicemonitor: - enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} + enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }} {{- if and .Values.kiam.enabled .Values.kiam.ready }} # AWS only components @@ -146,7 +146,7 @@ kubezero: {{- toYaml . | nindent 8 }} {{- end }} {{- end }} - prometheus: {{ default .Values.metrics.enabled .Values.metrics.ready }} + prometheus: {{ and .Values.metrics.enabled .Values.metrics.ready }} {{- if .Values.logging.es.s3Snapshot }} s3Snapshot: @@ -166,7 +166,7 @@ kubezero: fluentd: enabled: {{ .Values.logging.fluentd.enabled }} metrics: - enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} + enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }} url: {{ .Values.logging.fluentd.url }} {{- if and .Values.logging.fluentd.istio .Values.istio.enabled .Values.istio.ready }} istio: @@ -178,7 +178,7 @@ kubezero: fluent-bit: enabled: {{ index .Values.logging "fluent-bit" "enabled" }} metrics: - enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} + enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }} {{- if index .Values.logging "fluent-bit" "config" }} config: {{- with index .Values.logging "fluent-bit" "config" }} @@ -189,13 +189,13 @@ kubezero: argo-cd: controller: metrics: - enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} + enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }} repoServer: metrics: - enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} + enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }} server: metrics: - enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} + enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }} {{- with index .Values "argo-cd" "server" }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/deploy/values-step-6.yaml b/deploy/values-step-6.yaml new file mode 100644 index 00000000..a97799ee --- /dev/null +++ b/deploy/values-step-6.yaml @@ -0,0 +1,3 @@ +metrics: + enabled: true + ready: false