Compare commits

...

30 Commits

Author SHA1 Message Date
keptn 763dc1aee6 Updated resource 2023-11-15 15:55:06 +00:00
keptn 98629c5b1a Updated resource 2023-11-15 14:35:44 +00:00
keptn 7022ca76e9 Updated resource 2023-11-15 11:56:53 +00:00
keptn 328e655855 Updated resource 2023-11-15 07:32:48 +00:00
keptn 9353c3c71a Updated resource 2023-11-15 07:24:30 +00:00
keptn f3342655f8 Updated resource 2023-11-14 22:20:47 +00:00
keptn e32abf7b03 Updated resource 2023-11-14 22:17:16 +00:00
keptn 277d0a15d5 Updated resource 2023-11-14 20:10:10 +00:00
keptn cb9e4d56dd Updated resource 2023-11-14 19:29:03 +00:00
keptn b267f66694 Updated resource 2023-11-14 18:43:35 +00:00
keptn c75b9c6f51 Updated resource 2023-11-14 18:32:48 +00:00
keptn fd32abf397 Updated resource 2023-11-14 16:09:27 +00:00
keptn 5bf16fb32a Updated resource 2023-11-14 16:07:28 +00:00
keptn 1f9785d918 Added service: carts-db 2023-11-14 16:06:48 +00:00
keptn d0cb1dba85 Updated resource 2023-11-14 15:59:22 +00:00
keptn 7d1d0e0c1e Updated resource 2023-11-14 15:56:55 +00:00
keptn c788c0dafd Updated resource 2023-11-14 13:24:31 +00:00
keptn 52c4ddd546 Updated resource 2023-11-14 13:17:22 +00:00
keptn a70ea8e899 Updated resource 2023-11-14 13:08:02 +00:00
keptn ff8dadc6f5 Updated resource 2023-11-14 12:20:21 +00:00
keptn be06d311f2 Updated resource 2023-11-14 11:58:27 +00:00
keptn 7295149e87 Updated resource 2023-11-14 11:46:29 +00:00
keptn 378346e754 Updated resource 2023-11-14 10:45:49 +00:00
keptn beb9c738a2 Updated resource 2023-11-14 10:41:46 +00:00
keptn 5565aa8483 Updated resource 2023-11-14 10:33:38 +00:00
keptn 808823f422 Updated resource 2023-11-13 19:50:02 +00:00
keptn 841e000a5e Updated resource 2023-11-13 19:48:42 +00:00
keptn 3b510f20ad Updated resource 2023-11-13 18:32:42 +00:00
keptn 0fedf2701c Added service: carts 2023-11-13 18:27:48 +00:00
keptn c7df62fb8c created stage 2023-11-13 18:26:47 +00:00
9 changed files with 120 additions and 0 deletions

Binary file not shown.

58
carts-db/job/config.yaml Normal file
View File

@ -0,0 +1,58 @@
apiVersion: v2
actions:
- name: "Deploy using helm"
events:
- name: "sh.keptn.event.deployment.triggered"
tasks:
- name: "Run helm"
files:
- /charts
env:
- name: IMAGE
value: "$.data.configurationChange.values.image"
valueFrom: event
image: "alpine/helm:3.7.2"
serviceAccount: "jes-deploy-using-helm"
cmd: ["helm"]
args: ["upgrade", "--create-namespace", "--install", "-n", "$(KEPTN_PROJECT)-$(KEPTN_STAGE)", "$(KEPTN_SERVICE)", "/keptn/charts/$(KEPTN_SERVICE).tgz", "--set", "image=$(IMAGE)", "--set", "keptn.service=$(KEPTN_SERVICE)", "--set", "keptn.deployment=$(KEPTN_STAGE)", "--wait"]
- name: "Rollback using helm"
events:
- name: "sh.keptn.event.rollback.triggered"
tasks:
- name: "Run helm"
serviceAccount: "jes-deploy-using-helm"
image: "alpine/helm:3.7.2"
cmd: ["helm"]
args: ["rollback", "-n", "$(KEPTN_PROJECT)-$(KEPTN_STAGE)", "$(KEPTN_SERVICE)", "--wait"]
- name: "Scale using kubectl"
events:
- name: "sh.keptn.event.action.triggered"
jsonpath:
property: "$.data.action.action"
match: "scaling"
tasks:
- name: "Run kubectl"
serviceAccount: "jes-deploy-using-helm"
env:
- name: SCALING
value: $.data.action.value
valueFrom: event
image: "alpine/k8s:1.20.15"
cmd: ["sh"]
# Note: Hardcoded kubernetes namespace & KEPTN_SERVICE does most likely not match the deployment name
args: ["-c", "REPLICAS=$(kubectl -n ${KEPTN_PROJECT}-${KEPTN_STAGE} get deployment/${KEPTN_SERVICE} -o go-template='{{.spec.replicas}}');DESIRED=$((${SCALING}+${REPLICAS}));echo Scaling deployment to ${DESIRED} && kubectl -n ${KEPTN_PROJECT}-${KEPTN_STAGE} scale --replicas=${DESIRED} deployment/${KEPTN_SERVICE}"]
- name: "Run tests using locust"
events:
- name: "sh.keptn.event.test.triggered"
tasks:
- name: "Run locust"
files:
- locust/basic.py
- locust/locust.conf
image: "locustio/locust:2.8.6"
cmd: ["locust"]
args: ["--config", "/keptn/locust/locust.conf", "-f", "/keptn/locust/basic.py", "--host", "http://$(KEPTN_SERVICE).$(KEPTN_PROJECT)-$(KEPTN_STAGE)", "--only-summary"]

2
carts-db/metadata.yaml Normal file
View File

@ -0,0 +1,2 @@
servicename: carts-db
creationtimestamp: 2023-11-14 16:06:48.551336247 +0000 UTC

BIN
carts/carts.tgz Normal file

Binary file not shown.

Binary file not shown.

BIN
carts/charts/carts.tgz Normal file

Binary file not shown.

58
carts/job/config.yaml Normal file
View File

@ -0,0 +1,58 @@
apiVersion: v2
actions:
- name: "Deploy using helm"
events:
- name: "sh.keptn.event.deployment.triggered"
tasks:
- name: "Run helm"
files:
- /charts
env:
- name: IMAGE
value: "$.data.configurationChange.values.image"
valueFrom: event
image: "alpine/helm:3.7.2"
serviceAccount: "jes-deploy-using-helm"
cmd: ["helm"]
args: ["upgrade", "--force", "--create-namespace", "--install", "-n", "$(KEPTN_PROJECT)-$(KEPTN_STAGE)", "$(KEPTN_SERVICE)", "/keptn/charts/$(KEPTN_SERVICE).tgz", "--set", "image=$(IMAGE)", "--set", "keptn.service=$(KEPTN_SERVICE)", "--set", "keptn.deployment=$(KEPTN_STAGE)", "--set", "keptn.project=$(KEPTN_PROJECT)","--set", "keptn.stage=$(KEPTN_STAGE)", "--wait"]
- name: "Rollback using helm"
events:
- name: "sh.keptn.event.rollback.triggered"
tasks:
- name: "Run helm"
serviceAccount: "jes-deploy-using-helm"
image: "alpine/helm:3.7.2"
cmd: ["helm"]
args: ["rollback", "-n", "$(KEPTN_PROJECT)-$(KEPTN_STAGE)", "$(KEPTN_SERVICE)", "--wait"]
- name: "Scale using kubectl"
events:
- name: "sh.keptn.event.action.triggered"
jsonpath:
property: "$.data.action.action"
match: "scaling"
tasks:
- name: "Run kubectl"
serviceAccount: "jes-deploy-using-helm"
env:
- name: SCALING
value: $.data.action.value
valueFrom: event
image: "alpine/k8s:1.20.15"
cmd: ["sh"]
# Note: Hardcoded kubernetes namespace & KEPTN_SERVICE does most likely not match the deployment name
args: ["-c", "REPLICAS=$(kubectl -n ${KEPTN_PROJECT}-${KEPTN_STAGE} get deployment/${KEPTN_SERVICE} -o go-template='{{.spec.replicas}}');DESIRED=$((${SCALING}+${REPLICAS}));echo Scaling deployment to ${DESIRED} && kubectl -n ${KEPTN_PROJECT}-${KEPTN_STAGE} scale --replicas=${DESIRED} deployment/${KEPTN_SERVICE}"]
- name: "Run tests using locust"
events:
- name: "sh.keptn.event.test.triggered"
tasks:
- name: "Run locust"
files:
- locust/basic.py
- locust/locust.conf
image: "locustio/locust:2.8.6"
cmd: ["locust"]
args: ["--config", "/keptn/locust/locust.conf", "-f", "/keptn/locust/basic.py", "--host", "http://$(KEPTN_SERVICE)-$(KEPTN_STAGE).nttdata-xlabs.com", "--only-summary"]

Binary file not shown.

2
carts/metadata.yaml Normal file
View File

@ -0,0 +1,2 @@
servicename: carts
creationtimestamp: 2023-11-13 18:27:48.297161439 +0000 UTC