J release changes
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / templates / tests / test-resources.yaml
diff --git a/helm/infrastructure/subcharts/kong/templates/tests/test-resources.yaml b/helm/infrastructure/subcharts/kong/templates/tests/test-resources.yaml
new file mode 100644 (file)
index 0000000..79e32d7
--- /dev/null
@@ -0,0 +1,84 @@
+{{- if  .Values.deployment.test.enabled }}
+---
+apiVersion: v1
+kind: Pod
+metadata:
+  name: "{{ .Release.Name }}-httpbin"
+  labels:
+    app: httpbin
+spec:
+  containers:
+    - name: httpbin
+      image: kennethreitz/httpbin
+      ports:
+      - containerPort: 80
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: "{{ .Release.Name }}-httpbin"
+spec:
+  ports:
+  - port: 80
+    protocol: TCP
+    targetPort: 80
+  selector:
+    app: httpbin
+  type: ClusterIP
+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: "{{ .Release.Name }}-httpbin"
+  annotations:
+    httpbin.ingress.kubernetes.io/rewrite-target: /
+    konghq.com/strip-path: "true"
+spec:
+  ingressClassName: kong
+  rules:
+  - http:
+      paths:
+      - path: /httpbin
+        pathType: Prefix
+        backend:
+          service:
+            name: "{{ .Release.Name }}-httpbin"
+            port:
+              number: 80
+---
+apiVersion: gateway.networking.k8s.io/v1beta1
+kind: GatewayClass
+metadata:
+  name: "{{ .Release.Name }}-kong-test"
+spec:
+  controllerName: konghq.com/kic-gateway-controller
+---
+apiVersion: gateway.networking.k8s.io/v1beta1
+kind: Gateway
+metadata:
+  name: "{{ .Release.Name }}-kong-test"
+  annotations:
+    konghq.com/gateway-unmanaged: "true"
+spec:
+  gatewayClassName: "{{ .Release.Name }}-kong-test"
+  listeners:  # Use GatewayClass defaults for listener definition.
+  - name: http
+    protocol: HTTP
+    port: 80
+---
+apiVersion: gateway.networking.k8s.io/v1beta1
+kind: HTTPRoute
+metadata:
+  name: "{{ .Release.Name }}-httpbin"
+spec:
+  parentRefs:
+    - name: "{{ .Release.Name }}-kong-test"
+  rules:
+    - matches:
+        - path:
+            type: PathPrefix
+            value: "/httproute"
+      backendRefs:
+        - name: "{{ .Release.Name }}-httpbin"
+          port: 80
+{{- end }}