Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To incorporate Knative service and Contour in conjunction with Ingress, follow these steps:

  1. Deploy Knative: Knative is a Kubernetes-based platform that offers a set of building blocks to build, deploy, and manage modern serverless workloads. You can deploy Knative on your Kubernetes cluster using the Knative Operator or via a YAML manifest.

  2. Install Contour: Contour is an open-source Kubernetes native ingress controller that works by deploying Envoy as a reverse proxy. You can install Contour on your Kubernetes cluster using the Helm chart or via a YAML manifest.

  3. Enable the Knative Contour integration: To enable the integration of Knative and Contour, you need to create a custom resource definition (CRD) for Knative services to route requests to Contour. You can create this CRD using the following YAML manifest:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: knative-ingress
  namespace: knative-serving
  annotations:
    kubernetes.io/ingress.class: contour
spec:
  rules:
  - host: <HOSTNAME>
    http:
      paths:
      - path: /service
        backend:
          serviceName: <SERVICE-NAME>
          servicePort: 80
  1. Deploy your Knative service: Once you have created the CRD, you can deploy your Knative service using the kn CLI. Your Knative service will now be exposed as an Ingress resource that is routed through Contour.

  2. Verify the Knative Contour integration: To verify the Knative Contour integration, you can send a request to your Knative service using the curl command. The request should be routed through Contour, and you should receive a response from your Knative service.

With this setup, you can leverage the benefits of both Knative and Contour to build and deploy your serverless workloads.