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

add example workload (with syn attack) #111

Merged
merged 2 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions .mk/development.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ undeploy-grafana: ## Undeploy grafana.
-pkill --oldest --full "3000:3000"

.PHONY: deploy-all
deploy-all: manifests generate fmt lint deploy-loki deploy-grafana install deploy-sample-cr
deploy-all: manifests generate fmt lint deploy-loki deploy-grafana install deploy-sample-cr deploy-sample-workload

.PHONY: undeploy-all
undeploy-all: undeploy-loki undeploy-grafana uninstall undeploy-sample-cr
undeploy-all: undeploy-loki undeploy-grafana uninstall undeploy-sample-cr undeploy-sample-workload
3 changes: 3 additions & 0 deletions .mk/ocp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ ocp-expose:
oc expose service loki || true
@loki_url=$$(oc get route loki -o jsonpath='{.spec.host}'); \
echo -e "\nAccess loki on OCP using: http://"$$loki_url"\n"
oc expose -n sample-workload service frontend-external || true
Copy link
Member

@jotak jotak Jun 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to use make ocp-expose just to create grafana/loki routes. Can you split in two different targets then? (maybe ocp-expose and ocp-expose-all, similarly to the deploy-all that deploys more than just the infra ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed (@jotak please review again that this fits your needs )

@sample_workload_url=$$(oc get -n sample-workload route frontend-external -o jsonpath='{.spec.host}'); \
echo -e "\nAccess sample workload on OCP using: http://"$$sample_workload_url"\n"

.PHONY: ocp-deploy
ocp-deploy: deploy-all ocp-expose ## OCP deploy (loki, grafana and example-cr excluding the operator)
Expand Down
19 changes: 19 additions & 0 deletions .mk/sample.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
# Deploy the sample FlowCollector CR
.PHONY: deploy-sample-cr
deploy-sample-cr:
@echo -e "\n==> Deploy sample CR"
sed -e 's~:main~:$(VERSION)~' ./config/samples/flows_v1alpha1_flowcollector.yaml | kubectl apply -f - || true

# Undeploy the sample FlowCollector CR
.PHONY: undeploy-sample-cr
undeploy-sample-cr:
@echo -e "\n==> Undeploy sample CR"
sed -e 's~:main~:$(VERSION)~' ./config/samples/flows_v1alpha1_flowcollector.yaml | kubectl --ignore-not-found=true delete -f - || true

# Deploy sample workload
.PHONY: deploy-sample-workload
deploy-sample-workload:
@echo -e "\n==> Deploy sample workload"
-kubectl create namespace sample-workload
kubectl -n sample-workload apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/main/release/kubernetes-manifests.yaml
kubectl -n sample-workload run syn-flood --privileged --image=bilalcaliskan/syn-flood:latest --restart=Never -- --host frontend-external.sample-workload.svc.cluster.local --port 80 --floodType syn

# undeploy sample workload
.PHONY: undeploy-sample-workload
undeploy-sample-workload:
@echo -e "\n==> Undeploy sample workload"
kubectl -n sample-workload delete --ignore-not-found=true -f https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/main/release/kubernetes-manifests.yaml
-kubectl -n sample-workload delete --ignore-not-found=true pod syn-flood
-kubectl delete --ignore-not-found=true namespace sample-workload