Docsright arrowTelepresenceright arrow2.13right arrowInstall the Traffic Manager with Helm

6 min • read

Install the Traffic Manager with Helm

Helm is a package manager for Kubernetes that automates the release and management of software on Kubernetes. The Telepresence Traffic Manager can be installed via a Helm chart with a few simple steps.

For more details on what the Helm chart installs and what can be configured, see the Helm chart README.

Before you begin

Before you begin you need to have helm, and either the Kubernetes command-line tool, kubectl, or the OpenShift Container Platform command-line interface, oc. This document uses kubectl in all example commands. OpenShift users can substitute oc commands instead.

The Telepresence Helm chart is hosted by Ambassador Labs and published at https://app.getambassador.io.

Start by adding this repo to your Helm client with the following command:

Install with Helm

When you run the Helm chart, it installs all the components required for the Telepresence Traffic Manager.

  1. If you are installing the Telepresence Traffic Manager for the first time on your cluster, create the ambassador namespace in your cluster:

  2. Install the Telepresence Traffic Manager with the following command:

Install into custom namespace

The Helm chart supports being installed into any namespace, not necessarily ambassador. Simply pass a different namespace argument to helm install. For example, if you wanted to deploy the traffic manager to the staging namespace:

Note that users of Telepresence will need to configure their kubeconfig to find this installation of the Traffic Manager:

See the kubeconfig documentation for more information.

Upgrading the Traffic Manager.

Versions of the Traffic Manager Helm chart are coupled to the versions of the Telepresence CLI that they are intended for. Thus, for example, if you wish to use Telepresence v2.4.0, you'll need to install version v2.4.0 of the Traffic Manager Helm chart.

Upgrading the Traffic Manager is the same as upgrading any other Helm chart; for example, if you installed the release into the ambassador namespace, and you just wished to upgrade it to the latest version without changing any configuration values:

If you want to upgrade the Traffic-Manager to a specific version, add a --version flag with the version number to the upgrade command. For example: --version v2.4.1

RBAC

Installing a namespace-scoped traffic manager

You might not want the Traffic Manager to have permissions across the entire kubernetes cluster, or you might want to be able to install multiple traffic managers per cluster (for example, to separate them by environment). In these cases, the traffic manager supports being installed with a namespace scope, allowing cluster administrators to limit the reach of a traffic manager's permissions.

For example, suppose you want a Traffic Manager that only works on namespaces dev and staging. To do this, create a values.yaml like the following:

This can then be installed via:

NOTE Do not install namespace-scoped Traffic Managers and a global Traffic Manager in the same cluster, as it could have unexpected effects.

Namespace collision detection

The Telepresence Helm chart will try to prevent namespace-scoped Traffic Managers from managing the same namespaces. It will do this by creating a ConfigMap, called traffic-manager-claim, in each namespace that a given install manages.

So, for example, suppose you install one Traffic Manager to manage namespaces dev and staging, as:

You might then attempt to install another Traffic Manager to manage namespaces staging and prod:

This would fail with an error:

To fix this error, fix the overlap either by removing staging from the first install, or from the second.

Namespace scoped user permissions

Optionally, you can also configure user rbac to be scoped to the same namespaces as the manager itself. You might want to do this if you don't give your users permissions throughout the cluster, and want to make sure they only have the minimum set required to perform telepresence commands on certain namespaces.

Continuing with the dev and staging example from the previous section, simply add the following to values.yaml (make sure you set the subjects!):

Namespace-scoped webhook

If you wish to use the traffic-manager's mutating webhook with a namespace-scoped traffic manager, you will have to ensure that each namespace has an app.kubernetes.io/name label that is identical to its name:

You can also use kubectl label to add the label to an existing namespace, e.g.:

This is required because the mutating webhook will use the name label to find namespaces to operate on.

NOTE This labelling happens automatically in kubernetes >= 1.21.

Installing RBAC only

Telepresence Traffic Manager does require some RBAC for the traffic-manager deployment itself, as well as for users. To make it easier for operators to introspect / manage RBAC separately, you can use rbac.only=true to only create the rbac-related objects. Additionally, you can use clientRbac.create=true and managerRbac.create=true to toggle which subset(s) of RBAC objects you wish to create.