Skip to content

Commit 3e4ee9a

Browse files
committed
fix: accidently commited kup.sh changes used for debugging
Signed-off-by: Suraj Banakar <[email protected]>
1 parent ff81cd5 commit 3e4ee9a

File tree

1 file changed

+78
-73
lines changed

1 file changed

+78
-73
lines changed

examples/kup.sh

Lines changed: 78 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,14 @@ INGRESS_HOST=localhost
151151
INGRESS_PORT=5000
152152

153153
# Datadog does not work with the docker driver
154-
minikube start --cpus=2 --memory=5GB --driver=virtualbox
154+
# Note: you might need less cpu and memory than this
155+
# The numbers below are to be on the safe side.
156+
# If you are low on resources,
157+
# Try:
158+
# minikube start --cpus='2' --memory='5g' --driver=virtualbox
159+
# ^ you might have to remove services you don't need or
160+
# reduce cpu and memory requests for some services
161+
minikube start --cpus='4' --memory='10g' --driver=virtualbox
155162

156163
check_if_keptn_cli_is_installed
157164
# TODO: This might work without any `--use-case` flag
@@ -162,14 +169,13 @@ helm repo add keptn https://charts.keptn.sh
162169
echo "Installing keptn"
163170
kubectl create ns keptn
164171
kubectl config set-context --current --namespace=keptn
165-
helm upgrade --install keptn keptn/keptn -f examples/keptn-values.yaml --version 0.19.0
166-
minikube tunnel &> /dev/null &
167-
# helm install jmeter-service keptn/jmeter-service --version 0.19.0
168-
# helm install helm-service keptn/helm-service --version 0.19.0
172+
helm install keptn keptn/keptn -f examples/keptn-values.yaml --version 0.19.0
173+
helm install jmeter-service keptn/jmeter-service --version 0.19.0
174+
helm install helm-service keptn/helm-service --version 0.19.0
169175

170-
# check_if_istioctl_cli_is_installed
176+
check_if_istioctl_cli_is_installed
171177
# Install Istio
172-
# istioctl install -y
178+
istioctl install -y
173179

174180
check_if_kubectl_cli_is_installed
175181
# Kill an existing port-forward if it exists
@@ -193,53 +199,53 @@ kubectl config set-context --current --namespace=keptn
193199
# Password: Get it by running 'kubectl get secret bridge-credentials -o=jsonpath='{.data.BASIC_AUTH_PASSWORD}' -nkeptn | base64 -d'
194200
kubectl delete secret bridge -nkeptn
195201

196-
# # ---------------------------------------------- #
197-
198-
# # This block of code
199-
# # 1. Creates a Keptn project
200-
# # 2. Creates a Keptn service (with helm charts as resources)
201-
# # 3. Adds loadtests
202-
# # 4. Adds endpoints
203-
# PROJECT="podtatohead"
204-
# SERVICE="helloservice"
205-
# IMAGE="docker.io/jetzlstorfer/helloserver"
206-
# VERSION=0.1.1
207-
# SLOW_VERSION=0.1.2
202+
# ---------------------------------------------- #
208203

209-
# check_if_helm_cli_is_installed
204+
# This block of code
205+
# 1. Creates a Keptn project
206+
# 2. Creates a Keptn service (with helm charts as resources)
207+
# 3. Adds loadtests
208+
# 4. Adds endpoints
209+
PROJECT="podtatohead"
210+
SERVICE="helloservice"
211+
IMAGE="docker.io/jetzlstorfer/helloserver"
212+
VERSION=0.1.1
213+
SLOW_VERSION=0.1.2
214+
215+
check_if_helm_cli_is_installed
210216
cd ./examples
211217

212-
# print_headline "Create a Keptn project"
213-
# echo "keptn create project $PROJECT --shipyard=./quickstart/shipyard.yaml"
214-
# keptn create project $PROJECT --shipyard=./quickstart/shipyard.yaml
215-
# verify_test_step $? "keptn create project command failed."
218+
print_headline "Create a Keptn project"
219+
echo "keptn create project $PROJECT --shipyard=./quickstart/shipyard.yaml"
220+
keptn create project $PROJECT --shipyard=./quickstart/shipyard.yaml
221+
verify_test_step $? "keptn create project command failed."
216222

217-
# print_headline "Create a Keptn service"
218-
# echo "keptn create service $SERVICE --project=${PROJECT} "
219-
# keptn create service $SERVICE --project="${PROJECT}"
223+
print_headline "Create a Keptn service"
224+
echo "keptn create service $SERVICE --project=${PROJECT} "
225+
keptn create service $SERVICE --project="${PROJECT}"
220226

221-
# print_headline "Add Helm chart for $SERVICE"
222-
# keptn add-resource --project=$PROJECT --service=$SERVICE --all-stages --resource=./quickstart/helm/helloservice.tgz --resourceUri=helm/helloservice.tgz
227+
print_headline "Add Helm chart for $SERVICE"
228+
keptn add-resource --project=$PROJECT --service=$SERVICE --all-stages --resource=./quickstart/helm/helloservice.tgz --resourceUri=helm/helloservice.tgz
223229

224-
# print_headline "Add endpoints file"
225-
# keptn add-resource --project=$PROJECT --service=$SERVICE --stage=hardening --resource=./quickstart/helm/hardening_endpoints.yaml --resourceUri=helm/endpoints.yaml
226-
# keptn add-resource --project=$PROJECT --service=$SERVICE --stage=production --resource=./quickstart/helm/production_endpoints.yaml --resourceUri=helm/endpoints.yaml
230+
print_headline "Add endpoints file"
231+
keptn add-resource --project=$PROJECT --service=$SERVICE --stage=hardening --resource=./quickstart/helm/hardening_endpoints.yaml --resourceUri=helm/endpoints.yaml
232+
keptn add-resource --project=$PROJECT --service=$SERVICE --stage=production --resource=./quickstart/helm/production_endpoints.yaml --resourceUri=helm/endpoints.yaml
227233

228-
# # adding tests to the service
229-
# print_headline "Adding some load tests"
230-
# keptn add-resource --project=$PROJECT --service=$SERVICE --stage=hardening --resource=./quickstart/jmeter/jmeter.conf.yaml --resourceUri=jmeter/jmeter.conf.yaml
231-
# keptn add-resource --project=$PROJECT --service=$SERVICE --stage=hardening --resource=./quickstart/jmeter/load.jmx --resourceUri=jmeter/load.jmx
234+
# adding tests to the service
235+
print_headline "Adding some load tests"
236+
keptn add-resource --project=$PROJECT --service=$SERVICE --stage=hardening --resource=./quickstart/jmeter/jmeter.conf.yaml --resourceUri=jmeter/jmeter.conf.yaml
237+
keptn add-resource --project=$PROJECT --service=$SERVICE --stage=hardening --resource=./quickstart/jmeter/load.jmx --resourceUri=jmeter/load.jmx
232238

233-
# # to tell lighthouse to use Datadog for podtatohead project
234-
# keptn configure monitoring datadog --project $PROJECT --service $SERVICE
239+
# to tell lighthouse to use Datadog for podtatohead project
240+
keptn configure monitoring datadog --project $PROJECT --service $SERVICE
235241

236242

237-
# # ---------------------------------------------- #
243+
# ---------------------------------------------- #
238244

239-
# # This block of code
240-
# # 1. Installs Datadog
241-
# # 2. Sets it up with the API keys in a K8s Secret
242-
# # 3. Installs datadog integration for Keptn
245+
# This block of code
246+
# 1. Installs Datadog
247+
# 2. Sets it up with the API keys in a K8s Secret
248+
# 3. Installs datadog integration for Keptn
243249

244250
helm repo add datadog https://helm.datadoghq.com
245251

@@ -254,53 +260,52 @@ helm repo add datadog https://helm.datadoghq.com
254260
# # Install datadog using the Datadog helm chart
255261
# helm install datadog --set datadog.apiKey=${DD_API_KEY} datadog/datadog --set datadog.appKey=${DD_APP_KEY} --set datadog.site=${DD_SITE} --set clusterAgent.enabled=true --set clusterAgent.metricsProvider.enabled=true --set clusterAgent.createPodDisruptionBudget=true --set clusterAgent.replicas=2
256262

257-
helm install datadog --set datadog.apiKey=${DD_API_KEY} datadog/datadog --set datadog.appKey=${DD_APP_KEY} --set datadog.site=${DD_SITE} --set clusterAgent.enabled=true --set clusterAgent.metricsProvider.enabled=true --set clusterAgent.createPodDisruptionBudget=true --set clusterAgent.replicas=1
263+
helm install datadog --set datadog.apiKey=${DD_API_KEY} datadog/datadog --set datadog.appKey=${DD_APP_KEY} --set datadog.site=${DD_SITE} --set clusterAgent.enabled=true --set clusterAgent.metricsProvider.enabled=true --set clusterAgent.createPodDisruptionBudget=true --set clusterAgent.replicas=2
258264

259265

260266
# Install datadog-service integration for Keptn
261267
# kubectl apply -f ~/sandbox/datadog-service/deploy/service.yaml
262268
helm install datadog-service ../helm --set datadogservice.ddApikey=${DD_API_KEY} --set datadogservice.ddAppKey=${DD_APP_KEY} --set datadogservice.ddSite=${DD_SITE}
263269

264-
# # Add datadog sli and slo
265-
# keptn add-resource --project="podtatohead" --stage="hardening" --service="helloservice" --resource=./quickstart/sli.yaml --resourceUri=datadog/sli.yaml
266-
# keptn add-resource --project="podtatohead" --stage="hardening" --service="helloservice" --resource=./quickstart/slo.yaml --resourceUri=slo.yaml
270+
# Add datadog sli and slo
271+
keptn add-resource --project="podtatohead" --stage="hardening" --service="helloservice" --resource=./quickstart/sli.yaml --resourceUri=datadog/sli.yaml
272+
keptn add-resource --project="podtatohead" --stage="hardening" --service="helloservice" --resource=./quickstart/slo.yaml --resourceUri=slo.yaml
267273

268274

269-
# # ---------------------------------------------- #
275+
# ---------------------------------------------- #
270276

271-
# # This block of code triggers delivery sequence for the service
277+
# This block of code triggers delivery sequence for the service
272278

273-
# print_headline "Trigger the delivery sequence with Keptn"
274-
# echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$VERSION"
275-
# keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$VERSION
276-
# verify_test_step $? "Trigger delivery for helloservice failed"
279+
print_headline "Trigger the delivery sequence with Keptn"
280+
echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$VERSION"
281+
keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$VERSION
282+
verify_test_step $? "Trigger delivery for helloservice failed"
277283

278-
# print_headline "Trigger a new delivery sequence with Keptn"
279-
# echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$SLOW_VERSION"
280-
# keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$SLOW_VERSION
281-
# verify_test_step $? "Trigger delivery for helloservice failed"
284+
print_headline "Trigger a new delivery sequence with Keptn"
285+
echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$SLOW_VERSION"
286+
keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$SLOW_VERSION
287+
verify_test_step $? "Trigger delivery for helloservice failed"
282288

283289

284-
# echo "Following the multi stage delivery in Keptn Bridge here: http://$INGRESS_HOST:$INGRESS_PORT/bridge/project/$PROJECT/sequence"
290+
echo "Following the multi stage delivery in Keptn Bridge here: http://$INGRESS_HOST:$INGRESS_PORT/bridge/project/$PROJECT/sequence"
285291

286292

287-
# print_headline "Have a look at the Keptn Bridge and explore the demo project"
288-
# echo "You can run a new delivery sequence with the following command"
289-
# echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$VERSION"
293+
print_headline "Have a look at the Keptn Bridge and explore the demo project"
294+
echo "You can run a new delivery sequence with the following command"
295+
echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$VERSION"
290296

291-
# print_headline "Multi-stage delviery demo with SLO-based quality gates for Datadog Keptn integration has been successfully set up"
297+
print_headline "Multi-stage delviery demo with SLO-based quality gates for Datadog Keptn integration has been successfully set up"
292298

293-
# echo "You can run a new delivery sequence with the following command"
294-
# echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$VERSION"
295-
# echo "or by deploying a slow version that will not pass the quality gate"
296-
# echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$SLOW_VERSION"
299+
echo "You can run a new delivery sequence with the following command"
300+
echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$VERSION"
301+
echo "or by deploying a slow version that will not pass the quality gate"
302+
echo "keptn trigger delivery --project=$PROJECT --service=$SERVICE --image=$IMAGE:$SLOW_VERSION"
297303

298-
# # ---------------------------------------------- #
304+
# ---------------------------------------------- #
299305

300-
# # Cleanup
306+
# Cleanup
301307

302-
# # Kill the port-forward started in the background
303-
# # If you want to port-forward again, just run
304-
# # kubectl port-forward svc/api-gateway-nginx 5000:80 -nkeptn
305-
ps aux | grep 'kubectl port-forward svc/api-gateway-nginx 5000' | grep -v 'grep' | awk '{print $2}' | xargs -I{} kill -9 {}
306-
ps aux | grep 'minikube tunnel' | grep -v 'grep' | awk '{print $2}' | xargs -I{} kill -9 {}
308+
# Kill the port-forward started in the background
309+
# If you want to port-forward again, just run
310+
# kubectl port-forward svc/api-gateway-nginx 5000:80 -nkeptn
311+
ps aux | grep 'kubectl port-forward svc/api-gateway-nginx 5000' | grep -v 'grep' | awk '{print $2}' | xargs -I{} kill -9 {}

0 commit comments

Comments
 (0)