Skip to content

Commit

Permalink
feat: add new fixture for namespace creation
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Apr 30, 2024
1 parent c725fb7 commit 60561e6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
12 changes: 4 additions & 8 deletions fixtures/k8s/kubernetes_resource_ingress_pass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ spec:
interval: 2s
timeout: 5m
staticResources:
- apiVersion: v1
kind: Namespace
metadata:
name: development
- apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: httpbin
namespace: development
namespace: default
spec:
rules:
- host: "httpbin.127.0.0.1.nip.io"
Expand All @@ -43,7 +39,7 @@ spec:
kind: Pod
metadata:
name: httpbin
namespace: development
namespace: default
labels:
app: httpbin
spec:
Expand All @@ -56,7 +52,7 @@ spec:
kind: Service
metadata:
name: httpbin
namespace: development
namespace: default
spec:
selector:
app: httpbin
Expand All @@ -69,7 +65,7 @@ spec:
url: "http://ingress-nginx.ingress-nginx.svc"
headers:
- name: Host
value: "{{(index ((index .staticResources 1).Object.spec.rules) 0).host}}"
value: "{{(index ((index .staticResources 0).Object.spec.rules) 0).host}}"
checkRetries:
delay: 3s
interval: 2s
Expand Down
36 changes: 36 additions & 0 deletions fixtures/k8s/kubernetes_resource_namespace_pass.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: namespace-creation
namespace: default
labels:
"Expected-Fail": "false"
spec:
schedule: "@every 5m"
kubernetesResource:
- name: "namespace creation"
namespace: "default"
description: "create a namespace and pod in it"
waitFor:
timeout: 3m
delete: true
staticResources:
- apiVersion: v1
kind: Namespace
metadata:
name: test
resources:
- apiVersion: v1
kind: Pod
metadata:
name: httpbin
namespace: test
labels:
app: httpbin
spec:
containers:
- name: httpbin
image: "kennethreitz/httpbin:latest"
ports:
- containerPort: 80
1 change: 1 addition & 0 deletions fixtures/k8s/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ resources:
- kubernetes_resource_ingress_pass.yaml
- kubernetes_resource_ingress_fail.yaml
- kubernetes_resource_service_pass.yaml
- kubernetes_resource_namespace_pass.yaml
- kubernetes_resource_pod_exit_code_pass.yaml
- cronjob_monitor_fail.yaml

0 comments on commit 60561e6

Please sign in to comment.