Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix kubecon examples #1225

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PODTATO_NAMESPACE ?= podtato-kubectl
GRAFANA_PORT_FORWARD ?= 3000

.PHONY: install
install: install-observability install-argo
install: install-observability
@echo "-----------------------------------"
@echo "Create Namespace and install Keptn-lifecycle-toolkit"
@echo "-----------------------------------"
Expand Down Expand Up @@ -46,14 +46,18 @@ deploy-version-3:
kubectl create namespace "$(PODTATO_NAMESPACE)" --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -k sample-app/version-3

.PHONY: undeploy-podtatohead
undeploy-podtatohead:
.PHONY: cleanup
cleanup:
kubectl delete ns "$(PODTATO_NAMESPACE)" --ignore-not-found=true

@echo "######################"
@echo "PodTatoHead undeployed"
@echo "######################"

.PHONY: undeploy-podtatohead
undeploy-podtatohead: cleanup


.PHONY: uninstall-observability
uninstall-observability: undeploy-podtatohead
make -C support/observability uninstall
Expand Down
32 changes: 16 additions & 16 deletions examples/support/observability/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ install: install-cert-manager
@echo "Configure Prometheus"
@echo "------------------"
kubectl create namespace monitoring --dry-run=client -o yaml | kubectl apply -f -
# kubectl apply --server-side -f config/prometheus/setup
# kubectl wait --for=condition=Established --all CustomResourceDefinition --namespace=monitoring
kubectl apply --server-side -f config/prometheus/setup
kubectl wait --for=condition=Established --all CustomResourceDefinition --namespace=monitoring

@echo ""
@echo "-------------------------------"
Expand All @@ -35,23 +35,23 @@ install: install-cert-manager
kubectl wait --for=condition=available deployment/jaeger -n "$(TOOLKIT_NAMESPACE)" --timeout=120s
kubectl wait --for=condition=available deployment/otel-collector -n "$(TOOLKIT_NAMESPACE)" --timeout=120s

# @echo ""
# @echo "------------------"
# @echo "Install Prometheus"
# @echo "------------------"
# kubectl apply -f config/prometheus/
# kubectl wait --for=condition=available deployment/prometheus-operator -n monitoring --timeout=120s
# kubectl wait --for=condition=available deployment/prometheus-adapter -n monitoring --timeout=120s
# kubectl wait --for=condition=available deployment/kube-state-metrics -n monitoring --timeout=120s
# kubectl wait --for=condition=available deployment/grafana -n monitoring --timeout=120s

@echo ""
@echo "------------------"
@echo "Install Prometheus Mockserver"
@echo "Install Prometheus"
@echo "------------------"
kubectl apply -n "$(TOOLKIT_NAMESPACE)" -f config/prometheus-mock/mockserver-config.yaml
helm repo add mockserver "https://www.mock-server.com"
helm upgrade --install -n "$(TOOLKIT_NAMESPACE)" --version 5.13.0 mockserver mockserver/mockserver --set service.type=ClusterIP --wait
kubectl apply -f config/prometheus/
kubectl wait --for=condition=available deployment/prometheus-operator -n monitoring --timeout=120s
kubectl wait --for=condition=available deployment/prometheus-adapter -n monitoring --timeout=120s
kubectl wait --for=condition=available deployment/kube-state-metrics -n monitoring --timeout=120s
kubectl wait --for=condition=available deployment/grafana -n monitoring --timeout=120s

# @echo ""
# @echo "------------------"
# @echo "Install Prometheus Mockserver"
# @echo "------------------"
# kubectl apply -n "$(TOOLKIT_NAMESPACE)" -f config/prometheus-mock/mockserver-config.yaml
# helm repo add mockserver "https://www.mock-server.com"
# helm upgrade --install -n "$(TOOLKIT_NAMESPACE)" --version 5.13.0 mockserver mockserver/mockserver --set service.type=ClusterIP --wait


@echo ""
Expand Down
36 changes: 18 additions & 18 deletions examples/support/observability/config/otel-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,21 @@ spec:
path: otel-collector-config.yaml
name: otel-collector-config-vol
---
# apiVersion: monitoring.coreos.com/v1
# kind: ServiceMonitor
# metadata:
# labels:
# serviceapp: otel-collector
# name: otel-collector
# namespace: keptn-lifecycle-toolkit-system
# spec:
# endpoints:
# - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
# interval: 30s
# port: metrics
# namespaceSelector:
# matchNames:
# - keptn-lifecycle-toolkit-system
# selector:
# matchLabels:
# app: opentelemetry
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
serviceapp: otel-collector
name: otel-collector
namespace: keptn-lifecycle-toolkit-system
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
interval: 30s
port: metrics
namespaceSelector:
matchNames:
- keptn-lifecycle-toolkit-system
selector:
matchLabels:
app: opentelemetry