This topic describes how to configure Cloud Native Runtimes for Tanzu with your existing Contour instance. Cloud Native Runtimes uses Contour to manage internal and external access to the services in a cluster.

If you see an error about an existing Contour installation when you run the install.sh script, then follow the procedures on this page to install Cloud Native Runtimes.

About Using Contour with Cloud Native Runtimes

Cloud Native Runtimes needs two instances of Contour. By default, Cloud Native Runtimes deploys an instance of Contour to the contour-external namespace and a second instance to the contour-internal namespace. One instance exposes services outside the cluster, and the other is for services that are private in your network.

The instructions on this page assume that, in your cluster, you have an existing Contour installation that you manage. To install Cloud Native Runtimes, you must allow it to use your existing Contour CustomResourceDefinitions.

If you already use a Contour instance to route requests from clients outside the cluster and you want to share resources with Knative, then you can choose to use your Contour for external services. Similarly, if you use a Contour instance to route requests from clients inside the cluster and want to share resources with Knative, choose to use your Contour for internal services.

If you do not have or do not want to reuse Contour instances for services, then Cloud Native Runtimes will create them.

Prerequisites

The following prerequisites are required to configure Cloud Native Runtimes with an existing Contour installation:

  • Contour v1.14. To identify your cluster’s Contour version, see Identify Your Contour Version below.
  • Contour CustomResourceDefinitions versions:

    Resource Name Version
    extensionservices.projectcontour.io v1alpha1
    httpproxies.projectcontour.io v1
    tlscertificatedelegations.projectcontour.io v1

Identify Your Contour Version

To identify your cluster's Contour version:

  1. Run:

    export CONTOUR_NAMESPACE=contour-namespace
    export CONTOUR_DEPLOYMENT=$(kubectl get deployment --namespace $CONTOUR_NAMESPACE --output name)
    kubectl get $CONTOUR_DEPLOYMENT --namespace $CONTOUR_NAMESPACE --output jsonpath="{.spec.template.spec.containers[].image}"
    kubectl get crds extensionservices.projectcontour.io --output jsonpath="{.status.storedVersions}"
    kubectl get crds httpproxies.projectcontour.io --output jsonpath="{.status.storedVersions}"
    kubectl get crds tlscertificatedelegations.projectcontour.io --output jsonpath="{.status.storedVersions}"
    

    Where CONTOUR-NAMESPACE is the namespace where Contour is installed on your Kubernetes cluster.

Install Cloud Native Runtimes on a Cluster with Your Existing Contour Instances

To install Cloud Native Runtimes on a cluster with an existing Contour instance, you customize the installation script to reuse the CustomResourceDefinitions from your cluster. The variables that you set depend on whether or not you want Cloud Native Runtimes to reuse your existing Contour instance.

If you chose not to use your existing Contour installations, the script installs new instances of Contour to the namespaces contour-external and/or contour-internal using your cluster’s CustomResourceDefinitions.

Note: If your Contour instance is removed or configured incorrectly, apps running on Cloud Native Runtimes will lose connectivity.

To install Cloud Native Runtimes on a cluster with existing Contour instances:

  1. Decide if you want to reuse your Contour instance(s). See About Using Contour with Cloud Native Runtimes above.

  2. Run the appropriate install command given below:

    Use your Contour for external services? Use your Contour for internal services? Run:
    No No cnr_ingress__reuse_crds=true ./bin/install.sh
    Yes No cnr_ingress__reuse_crds=true cnr_ingress__external__namespace=EXTERNAL-CONTOUR ./bin/install.sh
    No Yes cnr_ingress__reuse_crds=true cnr_ingress__internal__namespace=INTERNAL-CONTOUR ./bin/install.sh
    Yes Yes cnr_ingress__reuse_crds=true cnr_ingress__external__namespace=EXTERNAL-CONTOUR cnr_ingress__internal__namespace=INTERNAL-CONTOUR ./bin/install.sh

    Where EXTERNAL-CONTOUR and INTERNAL-CONTOUR are the namespaces where Contour is installed on your Kubernetes cluster.

    Make sure you type two underscore symbols ( _ ) after ingress, external, and internal.

check-circle-line exclamation-circle-line close-line
Scroll to top icon