Last active
February 28, 2023 17:43
-
-
Save C1aud3/2280b5a87fc210782c8b9cb8cc38b4aa to your computer and use it in GitHub Desktop.
Echo Service with an Ingress handled by Kong
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: echo | |
name: echo | |
namespace: primavera | |
annotations: | |
ingress.kubernetes.io/service-upstream: "true" | |
spec: | |
ports: | |
- port: 8080 | |
name: high | |
protocol: TCP | |
targetPort: 8080 | |
- port: 80 | |
name: low | |
protocol: TCP | |
targetPort: 8080 | |
selector: | |
app: echo | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: echo | |
name: echo | |
namespace: primavera | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: echo | |
strategy: {} | |
template: | |
metadata: | |
creationTimestamp: null | |
labels: | |
app: echo | |
annotations: | |
kuma.io/mesh: default | |
spec: | |
containers: | |
- image: gcr.io/kubernetes-e2e-test-images/echoserver:2.2 | |
name: echo | |
ports: | |
- containerPort: 8080 | |
env: | |
- name: NODE_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: spec.nodeName | |
- name: POD_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.name | |
- name: POD_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
- name: POD_IP | |
valueFrom: | |
fieldRef: | |
fieldPath: status.podIP | |
resources: {} | |
--- | |
apiVersion: networking.k8s.io/v1beta1 | |
kind: Ingress | |
metadata: | |
name: echo-primavera-api | |
annotations: | |
kubernetes.io/ingress.class: kong | |
kubernetes.io/ingress.allow-http: "true" | |
namespace: primavera | |
spec: | |
rules: | |
- host: "echo-primavera-api.np.platform.telus.digital" | |
http: | |
paths: | |
- backend: | |
serviceName: echo | |
servicePort: 80 | |
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
default
Kubernetes namespace to deploy your artifacts. Use theprimavera
namespace instead.kuma.io/mesh: default
annotation on yourDeployment
's Pod template. That will automatically onboard your service on thedefault
mesh.ingress.kubernetes.io/service-upstream: "true"
basically tells Kong to let Kuma handle the Load Balancing and enables Kuma to apply policies.kubernetes.io/ingress.class: kong
explicitly tells that your Ingress should be handled by Kong.