This example should demonstrate the capabilities of the lifecycle toolkit as illustrated here:
This section describes how to prepare and enable post-deployment tasks to send notifications to slack using webhooks.
In the first step, create an incoming slack webhook. Necessary information is available in the slack api page. Once you create the webhook, you will get a URL similar to below example.
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
is the secret part of the webhook which we would need in the next step.
Create a slack-secret.yaml
definition using the following command.
This will create a kubernetes secret named slack-secret.yaml
in the base directory.
kubectl create secret generic slack-secret --from-literal=SECURE_DATA='{"slack_hook":<YOUR_HOOK_SECRET>,"text":"Deployed PodTatoHead Application"}' -n podtato-kubectl -oyaml --dry-run=client > base/slack-secret.yaml
To enable Slack notification add post-deployment-notification
in as a postDeploymentTasks in the
app.yaml file as shown below.
postDeploymentTasks:
- post-deployment-notification
make install
make port-forward-grafana
If you want to port-forward to a different port, please execute:
make port-forward-grafana GRAFANA_PORT_FORWARD=<port>
make deploy-version-1
Now watch the progress on the cluster
kubectl get keptnworkloadinstances
kubectl get keptnappversions
You could also open up a browser and watch the progress in Jaeger. You can find the Context ID in the "TraceId" Field of the KeptnAppVersion
The deployment should fail because of too few cpu resources
make deploy-version-2
- Watch the progress of the deployments
- After some time, you should see that everything is successful
make deploy-version-3
- This should only change one service, you can see that only this changed in the trace