-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: RealAnna <[email protected]>
- Loading branch information
Showing
8 changed files
with
415 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
examples/observability/assets/podtatohead-deployment-evaluation/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/slack-secret.yaml |
5 changes: 5 additions & 0 deletions
5
examples/observability/assets/podtatohead-deployment-evaluation/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### Create Secret for Slack here | ||
|
||
``` | ||
kubectl create secret generic slack-notification --from-literal=SECURE_DATA='{"slack_hook":"<WebHook>","text":"Deployed PodTatoHead Application"}' -n podtato-kubectl -oyaml --dry-run > slack-secret.yaml | ||
``` |
24 changes: 24 additions & 0 deletions
24
examples/observability/assets/podtatohead-deployment-evaluation/app.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.3" | ||
workloads: | ||
- name: podtato-head-left-arm | ||
version: 0.1.0 | ||
- name: podtato-head-left-leg | ||
version: 0.1.0 | ||
- name: podtato-head-entry | ||
version: 0.1.0 | ||
- name: podtato-head-right-arm | ||
version: 0.1.0 | ||
- name: podtato-head-left-arm | ||
version: 0.1.0 | ||
- name: podtato-head-hat | ||
version: 0.1.0 | ||
postDeploymentTasks: | ||
- post-deployment-hello | ||
preDeploymentEvaluations: #Comment out this two lines if you do not have a prometheus installation | ||
- my-prometheus-definition |
12 changes: 12 additions & 0 deletions
12
examples/observability/assets/podtatohead-deployment-evaluation/check_entry.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: lifecycle.keptn.sh/v1alpha1 | ||
kind: KeptnTaskDefinition | ||
metadata: | ||
name: check-entry-service | ||
namespace: podtato-kubectl | ||
spec: | ||
function: | ||
httpRef: | ||
url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/functions-runtime/samples/ts/http.ts | ||
parameters: | ||
map: | ||
url: http://podtato-head-entry.podtato-kubectl.svc.cluster.local:9000 |
15 changes: 15 additions & 0 deletions
15
...les/observability/assets/podtatohead-deployment-evaluation/keptnevaluationdefinition.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: lifecycle.keptn.sh/v1alpha1 | ||
kind: KeptnEvaluationDefinition | ||
metadata: | ||
name: my-prometheus-definition | ||
namespace: podtato-kubectl | ||
spec: | ||
source: prometheus | ||
objectives: | ||
- name: query-1 | ||
query: "sum(prometheus_engine_query_duration_seconds_count)" | ||
evaluationTarget: ">10" #string: can only be starting with < or > | ||
- name: query-2 | ||
query: "sum(kube_pod_container_resource_limits{resource='mem'}) - sum(kube_node_status_capacity{resource='mem'})" | ||
evaluationTarget: "<100000000000000000" #string: can only be starting with < or > | ||
|
8 changes: 8 additions & 0 deletions
8
examples/observability/assets/podtatohead-deployment-evaluation/keptnevaluationprovider.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: lifecycle.keptn.sh/v1alpha1 | ||
kind: KeptnEvaluationProvider | ||
metadata: | ||
name: prometheus | ||
namespace: podtato-kubectl | ||
spec: | ||
targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" #string | ||
secretName: prometheusLoginCredentials #secret name, optional |
306 changes: 306 additions & 0 deletions
306
examples/observability/assets/podtatohead-deployment-evaluation/manifest.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,306 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: podtato-kubectl | ||
annotations: | ||
keptn.sh/lifecycle-controller: "enabled" | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: podtato-head-entry | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
matchLabels: | ||
component: podtato-head-entry | ||
template: | ||
metadata: | ||
labels: | ||
component: podtato-head-entry | ||
annotations: | ||
keptn.sh/app: podtato-head | ||
keptn.sh/workload: podtato-head-entry | ||
keptn.sh/version: 0.1.0 | ||
keptn.sh/post-deployment-tasks: post-deployment-hello | ||
spec: | ||
terminationGracePeriodSeconds: 5 | ||
initContainers: | ||
- name: init-myservice | ||
image: busybox:1.28 | ||
command: ['sh', '-c', 'sleep 30'] | ||
containers: | ||
- name: server | ||
image: ghcr.io/podtato-head/entry:latest | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 9000 | ||
env: | ||
- name: PODTATO_PORT | ||
value: "9000" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: podtato-head-entry | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
component: podtato-head-entry | ||
ports: | ||
- name: http | ||
port: 9000 | ||
protocol: TCP | ||
targetPort: 9000 | ||
type: LoadBalancer | ||
# change to NodePort if no LoadBalancer controller is available | ||
# type: NodePort | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: podtato-head-hat | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
matchLabels: | ||
component: podtato-head-hat | ||
template: | ||
metadata: | ||
labels: | ||
component: podtato-head-hat | ||
keptn.sh/pre-deployment-tasks: check-entry-service | ||
annotations: | ||
keptn.sh/app: podtato-head | ||
keptn.sh/workload: podtato-head-hat | ||
keptn.sh/version: 0.1.0 | ||
spec: | ||
terminationGracePeriodSeconds: 5 | ||
containers: | ||
- name: server | ||
image: ghcr.io/podtato-head/hat:latest | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 9000 | ||
env: | ||
- name: PODTATO_PORT | ||
value: "9000" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: podtato-head-hat | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
component: podtato-head-hat | ||
ports: | ||
- name: http | ||
port: 9001 | ||
protocol: TCP | ||
targetPort: 9000 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: podtato-head-left-leg | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
matchLabels: | ||
component: podtato-head-left-leg | ||
template: | ||
metadata: | ||
labels: | ||
component: podtato-head-left-leg | ||
annotations: | ||
keptn.sh/app: podtato-head | ||
keptn.sh/workload: podtato-head-left-leg | ||
keptn.sh/version: 0.1.0 | ||
keptn.sh/pre-deployment-tasks: check-entry-service | ||
spec: | ||
terminationGracePeriodSeconds: 5 | ||
containers: | ||
- name: server | ||
image: ghcr.io/podtato-head/left-leg:latest | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 9000 | ||
env: | ||
- name: PODTATO_PORT | ||
value: "9000" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: podtato-head-left-leg | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
component: podtato-head-left-leg | ||
ports: | ||
- name: http | ||
port: 9002 | ||
protocol: TCP | ||
targetPort: 9000 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: podtato-head-left-arm | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
matchLabels: | ||
component: podtato-head-left-arm | ||
template: | ||
metadata: | ||
labels: | ||
component: podtato-head-left-arm | ||
annotations: | ||
keptn.sh/app: podtato-head | ||
keptn.sh/workload: podtato-head-left-arm | ||
keptn.sh/version: 0.1.0 | ||
keptn.sh/pre-deployment-tasks: check-entry-service | ||
spec: | ||
terminationGracePeriodSeconds: 5 | ||
containers: | ||
- name: server | ||
image: ghcr.io/podtato-head/left-arm:latest | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 9000 | ||
env: | ||
- name: PODTATO_PORT | ||
value: "9000" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: podtato-head-left-arm | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
component: podtato-head-left-arm | ||
ports: | ||
- name: http | ||
port: 9003 | ||
protocol: TCP | ||
targetPort: 9000 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: podtato-head-right-leg | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
matchLabels: | ||
component: podtato-head-right-leg | ||
template: | ||
metadata: | ||
labels: | ||
component: podtato-head-right-leg | ||
annotations: | ||
keptn.sh/app: podtato-head | ||
keptn.sh/workload: podtato-head-right-leg | ||
keptn.sh/version: 0.1.0 | ||
keptn.sh/pre-deployment-tasks: check-entry-service | ||
spec: | ||
terminationGracePeriodSeconds: 5 | ||
containers: | ||
- name: server | ||
image: ghcr.io/podtato-head/right-leg:latest | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 9000 | ||
env: | ||
- name: PODTATO_PORT | ||
value: "9000" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: podtato-head-right-leg | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
component: podtato-head-right-leg | ||
ports: | ||
- name: http | ||
port: 9004 | ||
protocol: TCP | ||
targetPort: 9000 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: podtato-head-right-arm | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
matchLabels: | ||
component: podtato-head-right-arm | ||
template: | ||
metadata: | ||
labels: | ||
component: podtato-head-right-arm | ||
annotations: | ||
keptn.sh/app: podtato-head | ||
keptn.sh/workload: podtato-head-right-arm | ||
keptn.sh/version: 0.1.0 | ||
keptn.sh/pre-deployment-tasks: check-entry-service | ||
spec: | ||
terminationGracePeriodSeconds: 5 | ||
containers: | ||
- name: server | ||
image: ghcr.io/podtato-head/right-arm:latest | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 9000 | ||
env: | ||
- name: PODTATO_PORT | ||
value: "9000" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: podtato-head-right-arm | ||
namespace: podtato-kubectl | ||
labels: | ||
app: podtato-head | ||
spec: | ||
selector: | ||
component: podtato-head-right-arm | ||
ports: | ||
- name: http | ||
port: 9005 | ||
protocol: TCP | ||
targetPort: 9000 | ||
type: ClusterIP |
Oops, something went wrong.