Make KubeZero bootstrap flow work again

This commit is contained in:
Stefan Reimer 2020-09-18 14:57:33 +01:00
parent 2c600c2fd0
commit 97f60ed897
3 changed files with 18 additions and 17 deletions

View File

@ -8,7 +8,7 @@ function wait_for() {
local TRIES=0 local TRIES=0
while true; do while true; do
$@ && break $@ && break
[ $TRIES -eq 100 ] && return 1 [ $TRIES -eq 200 ] && return 1
let TRIES=$TRIES+1 let TRIES=$TRIES+1
sleep 3 sleep 3
done 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 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 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 -n kube-system Issuer/kubezero-local-ca-issuer
kubectl wait --for=condition=Ready ClusterIssuer/letsencrypt-dns-prod
fi fi
# Now that we have the cert-manager webhook, get the kiam certs in place but do NOT deploy kiam yet # 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 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 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 # 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 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 wait_for kubectl get deployment -n istio-operator istio-operator 2>/dev/null 1>&2
kubectl rollout status deployment -n istio-operator istio-operator 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 ? # Metrics
# Wait for aws-ebs or kiam to be all ready, or all pods running ? 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
# Todo: wait_for kubectl get crds servicemonitors.monitoring.coreos.com 2>/dev/null 1>&2
# - integrate Prometheus-Grafana
# - integrate ES based logging
# Finally we could enable the actual config and deploy all # Finally we could enable the actual config and deploy all
helm template $DEPLOY_DIR -f values.yaml -f cloudbender.yaml > generated-values.yaml helm template $DEPLOY_DIR -f values.yaml -f cloudbender.yaml > generated-values.yaml

View File

@ -8,7 +8,7 @@ kubezero:
values: values:
network: {{ default "vxlan" .Values.calico.network }} network: {{ default "vxlan" .Values.calico.network }}
mtu: {{ default "8941" .Values.calico.mtu }} mtu: {{ default "8941" .Values.calico.mtu }}
prometheus: {{ default .Values.metrics.enabled .Values.metrics.ready }} prometheus: {{ and .Values.metrics.enabled .Values.metrics.ready }}
cert-manager: cert-manager:
enabled: {{ index .Values "cert-manager" "enabled" }} enabled: {{ index .Values "cert-manager" "enabled" }}
values: values:
@ -56,11 +56,11 @@ kubezero:
replicas: {{ ternary 2 1 .Values.HighAvailableControlplane }} replicas: {{ ternary 2 1 .Values.HighAvailableControlplane }}
prometheus: prometheus:
servicemonitor: servicemonitor:
enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }}
agent: agent:
prometheus: prometheus:
servicemonitor: 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 }} {{- if and .Values.kiam.enabled .Values.kiam.ready }}
# AWS only components # AWS only components
@ -146,7 +146,7 @@ kubezero:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
prometheus: {{ default .Values.metrics.enabled .Values.metrics.ready }} prometheus: {{ and .Values.metrics.enabled .Values.metrics.ready }}
{{- if .Values.logging.es.s3Snapshot }} {{- if .Values.logging.es.s3Snapshot }}
s3Snapshot: s3Snapshot:
@ -166,7 +166,7 @@ kubezero:
fluentd: fluentd:
enabled: {{ .Values.logging.fluentd.enabled }} enabled: {{ .Values.logging.fluentd.enabled }}
metrics: metrics:
enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }}
url: {{ .Values.logging.fluentd.url }} url: {{ .Values.logging.fluentd.url }}
{{- if and .Values.logging.fluentd.istio .Values.istio.enabled .Values.istio.ready }} {{- if and .Values.logging.fluentd.istio .Values.istio.enabled .Values.istio.ready }}
istio: istio:
@ -178,7 +178,7 @@ kubezero:
fluent-bit: fluent-bit:
enabled: {{ index .Values.logging "fluent-bit" "enabled" }} enabled: {{ index .Values.logging "fluent-bit" "enabled" }}
metrics: metrics:
enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }}
{{- if index .Values.logging "fluent-bit" "config" }} {{- if index .Values.logging "fluent-bit" "config" }}
config: config:
{{- with index .Values.logging "fluent-bit" "config" }} {{- with index .Values.logging "fluent-bit" "config" }}
@ -189,13 +189,13 @@ kubezero:
argo-cd: argo-cd:
controller: controller:
metrics: metrics:
enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }}
repoServer: repoServer:
metrics: metrics:
enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }}
server: server:
metrics: metrics:
enabled: {{ default .Values.metrics.enabled .Values.metrics.ready }} enabled: {{ and .Values.metrics.enabled .Values.metrics.ready }}
{{- with index .Values "argo-cd" "server" }} {{- with index .Values "argo-cd" "server" }}
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}

View File

@ -0,0 +1,3 @@
metrics:
enabled: true
ready: false