Skip to content
Snippets Groups Projects
Unverified Commit 9e319aca authored by Frederic Branczyk's avatar Frederic Branczyk
Browse files

hack/*: use kubectl apply where possible

There is an issue with kubectl apply and third party resources, so for
the time being we use create for TPRs, but apply for all manifests that
it can handle.
parent 0efaf385
No related branches found
No related tags found
No related merge requests found
......@@ -14,14 +14,26 @@ kctl() {
kubectl --namespace "$NAMESPACE" "$@"
}
kctl create -f manifests/prometheus-operator.yaml
kctl apply -f manifests/prometheus-operator.yaml
# Wait for TPRs to be ready.
until kctl get servicemonitor; do sleep 1; done
until kctl get prometheus; do sleep 1; done
until kctl get alertmanager; do sleep 1; done
kctl create -f manifests/exporters
kctl create -f manifests/grafana
kctl create -f manifests/prometheus
kctl create -f manifests/alertmanager
kctl apply -f manifests/exporters
kctl apply -f manifests/grafana
kctl apply -f manifests/prometheus/prometheus-k8s-cm.yaml
kctl apply -f manifests/prometheus/prometheus-k8s-rules.yaml
kctl apply -f manifests/prometheus/prometheus-k8s-svc.yaml
kctl apply -f manifests/alertmanager/alertmanager-config.yaml
kctl apply -f manifests/alertmanager/alertmanager-service.yaml
# `kubectl apply` is currently not working for third party resources so we are
# using `kubectl create` here for the time being.
# (https://github.com/kubernetes/kubernetes/issues/29542)
kctl create -f manifests/prometheus/prometheus-k8s.yaml
kctl create -f manifests/alertmanager/alertmanager.yaml
......@@ -21,3 +21,4 @@ kctl delete -f manifests/alertmanager
sleep 5
kctl delete -f manifests/prometheus-operator.yaml
......@@ -4,4 +4,8 @@ if [ -z "${KUBECONFIG}" ]; then
KUBECONFIG=~/.kube/config
fi
kubectl --kubeconfig="$KUBECONFIG" create -f manifests/examples/example-app
\ No newline at end of file
kubectl --kubeconfig="$KUBECONFIG" apply -f manifests/examples/example-app/prometheus-frontend-svc.yaml
kubectl --kubeconfig="$KUBECONFIG" apply -f manifests/examples/example-app/example-app.yaml
kubectl --kubeconfig="$KUBECONFIG" create -f manifests/examples/example-app/prometheus-frontend.yaml
kubectl --kubeconfig="$KUBECONFIG" create -f manifests/examples/example-app/servicemonitor-frontend.yaml
......@@ -4,4 +4,5 @@ if [ -z "${KUBECONFIG}" ]; then
KUBECONFIG=~/.kube/config
fi
kubectl --kubeconfig="$KUBECONFIG" delete -f manifests/examples/example-app
\ No newline at end of file
kubectl --kubeconfig="$KUBECONFIG" delete -f manifests/examples/example-app
......@@ -8,3 +8,4 @@ kubectl create configmap --dry-run=true prometheus-k8s-rules --from-file=assets/
# Generate Dashboard ConfigMap
kubectl create configmap --dry-run=true grafana-dashboards --from-file=assets/grafana/ -oyaml > manifests/grafana/grafana-cm.yaml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment