79e32d7e2c253478e3f25868c39000d8cb2d7144
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / templates / tests / test-resources.yaml
1 {{- if  .Values.deployment.test.enabled }}
2 ---
3 apiVersion: v1
4 kind: Pod
5 metadata:
6   name: "{{ .Release.Name }}-httpbin"
7   labels:
8     app: httpbin
9 spec:
10   containers:
11     - name: httpbin
12       image: kennethreitz/httpbin
13       ports:
14       - containerPort: 80
15 ---
16 apiVersion: v1
17 kind: Service
18 metadata:
19   name: "{{ .Release.Name }}-httpbin"
20 spec:
21   ports:
22   - port: 80
23     protocol: TCP
24     targetPort: 80
25   selector:
26     app: httpbin
27   type: ClusterIP
28 ---
29 apiVersion: networking.k8s.io/v1
30 kind: Ingress
31 metadata:
32   name: "{{ .Release.Name }}-httpbin"
33   annotations:
34     httpbin.ingress.kubernetes.io/rewrite-target: /
35     konghq.com/strip-path: "true"
36 spec:
37   ingressClassName: kong
38   rules:
39   - http:
40       paths:
41       - path: /httpbin
42         pathType: Prefix
43         backend:
44           service:
45             name: "{{ .Release.Name }}-httpbin"
46             port:
47               number: 80
48 ---
49 apiVersion: gateway.networking.k8s.io/v1beta1
50 kind: GatewayClass
51 metadata:
52   name: "{{ .Release.Name }}-kong-test"
53 spec:
54   controllerName: konghq.com/kic-gateway-controller
55 ---
56 apiVersion: gateway.networking.k8s.io/v1beta1
57 kind: Gateway
58 metadata:
59   name: "{{ .Release.Name }}-kong-test"
60   annotations:
61     konghq.com/gateway-unmanaged: "true"
62 spec:
63   gatewayClassName: "{{ .Release.Name }}-kong-test"
64   listeners:  # Use GatewayClass defaults for listener definition.
65   - name: http
66     protocol: HTTP
67     port: 80
68 ---
69 apiVersion: gateway.networking.k8s.io/v1beta1
70 kind: HTTPRoute
71 metadata:
72   name: "{{ .Release.Name }}-httpbin"
73 spec:
74   parentRefs:
75     - name: "{{ .Release.Name }}-kong-test"
76   rules:
77     - matches:
78         - path:
79             type: PathPrefix
80             value: "/httproute"
81       backendRefs:
82         - name: "{{ .Release.Name }}-httpbin"
83           port: 80
84 {{- end }}