projectcontour Test with Nginx pod

Contour is an open source Kubernetes ingress controller providing the control plane for the Envoy edge and service proxy.​ Contour supports dynamic configuration updates and multi-team ingress delegation out of the box while maintaining a lightweight profile.

https://projectcontour.io/

Add Contour to your cluster

kubectl apply -f https://projectcontour.io/quickstart/contour.yaml

Test the contour is working

apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  containers:
    - name: nginx
      image: nginx
      ports:
        - containerPort: 80
          protocol: TCP

---
apiVersion: v1
kind: Service
metadata:
  name: nginx

spec:
  type: ClusterIP
  ports:
    - targetPort: 80
      port: 80
  selector:
    app: nginx

---
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
  name: nginx
spec:
  virtualhost:
    fqdn: nginx.test.com
  routes:
    - conditions:
        - prefix: /
      services:
        - name: nginx
          port: 80

add nginx.test.com to your host system

for example

sudo vim /etc/hosts
192.168.64.15 nginx.test.com

Test

curl nginx.test.com

Leave a Reply

Your email address will not be published.

ANOTE.DEV