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

docs: Add KubeCon NA 22 Demo #308

Merged
merged 3 commits into from
Nov 7, 2022
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
43 changes: 43 additions & 0 deletions examples/kubecon-na-22-demo/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
JAEGER_VERSION ?= v1.38.0
LFC_NAMESPACE ?= keptn-lifecycle-controller-system
PODTATO_NAMESPACE ?= podtato-kubectl

.PHONY: install
install:
make -C ../observability install
make -C ../observability import-grafana-dashboard

.PHONY: port-forward-jaeger
port-forward-jaeger:
make -C ../observability port-forward-jaeger

.PHONY: port-forward-grafana
port-forward-grafana:
make -C ../observability port-forward-grafana

.PHONY: deploy-version-1
deploy-version-1:
kubectl create namespace "$(PODTATO_NAMESPACE)" --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -k version-1

.PHONY: deploy-version-2
deploy-version-2:
kubectl create namespace "$(PODTATO_NAMESPACE)" --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -k version-2

.PHONY: deploy-version-3
deploy-version-3:
kubectl create namespace "$(PODTATO_NAMESPACE)" --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -k version-3

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

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

.PHONY: uninstall
uninstall: undeploy-podtatohead
make -C ../observability uninstall
39 changes: 39 additions & 0 deletions examples/kubecon-na-22-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# KubeCon 2022 NA Demo

This demonstration is based on the [Observability Example](../observability) and should do the following:

![img.png](assets/big-picture.png)

## Prepare Secret for Slack Notification
> kubectl create secret generic slack-notification --from-literal=SECURE_DATA='{"slack_hook":"HOOK","text":"Deployed PodTatoHead Application"}' -n podtato-kubectl -oyaml --dry-run > base/slack-secret.yaml

## Deploy the Observability Part
> make install

## Port-Forward Grafana
> make port-forward-grafana

## Port-Forward Jaeger
> make port-forward-jaeger

## Deploy Version 1 of the PodTatoHead
> 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/Grafana. You can find the Context ID in the "TraceId" Field of the KeptnAppVersion

The deployment should fail because of too few cpu resources

## Deploy Version 2 of the PodTatoHead
> make deploy-version-2

* Watch the progress of the deployments
* After some time, you should see that everything is successful

## Deploy Version 3
> make deploy-version-3

* This should only change one service, you can see that only this changed in the trace
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/kubecon-na-22-demo/base/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
slack-secret.yaml
11 changes: 11 additions & 0 deletions examples/kubecon-na-22-demo/base/app-post-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnTaskDefinition
metadata:
name: post-deployment-notification
namespace: podtato-kubectl
spec:
function:
httpRef:
url: https://raw.githubusercontent.com/keptn/lifecycle-controller/main/functions-runtime/samples/ts/slack.ts
secureParameters:
secret: slack-secret
24 changes: 24 additions & 0 deletions examples/kubecon-na-22-demo/base/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: lifecycle.keptn.sh/v1alpha1
kind: KeptnApp
metadata:
name: podtato-head
namespace: podtato-kubectl
spec:
version: "1.0.0"
workloads:
- name: podtato-head-left-arm
version: 0.2.7
- name: podtato-head-left-leg
version: 0.2.7
- name: podtato-head-entry
version: 0.2.7
- name: podtato-head-right-arm
version: 0.1.0
- name: podtato-head-left-arm
version: 0.2.7
- name: podtato-head-hat
version: 0.1.0
postDeploymentTasks:
- post-deployment-notification


6 changes: 6 additions & 0 deletions examples/kubecon-na-22-demo/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resources:
- app.yaml
- manifest.yaml
- app-post-deploy.yaml
- slack-secret.yaml
- provider.yaml
Loading