vSphere Kubernetes Service (VKS)
Big picture
Install Calico Enterprise as a Supervisor Service on vSphere Kubernetes Service (VKS), and deploy it to guest clusters.
Before you begin
This guide requires:
- Versions: VKS 3.8 or later, and vCenter 9.1.1 or later.
- VM images: Ubuntu or Photon OVA images registered for a supported Tanzu Kubernetes release (TKR), with the TKR in a healthy state. For Windows node pools, you also need Windows Server OVA images.
- vSphere resources: Enough capacity to provision guest clusters with at least:
- 1 control plane node
- 3 Linux worker nodes
- OCI registry: An OCI-compliant registry configured in vSphere to store package manifests and container images.
- Tigera registry credentials to pull from the Tigera container registry. Contact the Tigera team to get them.
Networking
| Configuration | Dataplane | Encapsulation | BGP |
|---|---|---|---|
| Linux only (default) | IPTables | IPIP | Enabled |
How to
Setting up Calico Enterprise on VKS has two main phases:
- Part 1: Set up Calico Enterprise as a Supervisor Service in the vSphere Client. You do this once.
- Part 2: Deploy Calico Enterprise to a guest cluster.
For air-gapped environments, also follow the steps in Air-gapped environments.
Part 1: Set up the Supervisor Service (one-time cluster admin setup)
-
In the vSphere Client, on the Container Registries page, add the Tigera container registry so that the Supervisor can pull Calico Enterprise images:
- Registry host URL:
quay.io - Username and Password: the Tigera registry credentials
For air-gapped installs, add the private registry that holds the Calico Enterprise images instead. See Copy the images to the private registry.
- Registry host URL:
-
In the vSphere Client, on the Supervisor Management page, create a new Supervisor Service, or add a new version to an existing one.
-
Upload the following
PackageandPackageMetadataresources, and complete the setup workflow:---apiVersion: data.packaging.carvel.dev/v1alpha1kind: Packagemetadata:name: calico-enterprise-svs.tigera.io.3.23.4spec:refName: calico-enterprise-svs.tigera.ioversion: 3.23.4template:spec:fetch:- imgpkgBundle:image: quay.io/tigera/calico-enterprise-svs:v3.23.4 # For air-gapped installs, change this to the private registrytemplate:- ytt:paths:- service- kapp- kbld:paths:- "-"- .imgpkg/images.yml- kbld/deploy:- kapp: {}---apiVersion: data.packaging.carvel.dev/v1alpha1kind: PackageMetadatametadata:name: calico-enterprise-svs.tigera.iospec:displayName: "Calico Enterprise SVS"shortDescription: "Manages Calico Enterprise Addon Repository and Installation" -
Register the Supervisor Service. In the service YAML configuration, set
registryNameto the name you gave the Tigera container registry in step 1:registryName: <registered-registry-name>For air-gapped installs, also set
chartRepositoryto the private registry path that holds the Calico Enterprise Helm chart. See Copy the add-on to the private registry.chartRepository: oci://<private-registry>/<path>
Part 2: Deploy a guest cluster with Calico Enterprise
Guest cluster prerequisites
- Tigera license file. Contact the Tigera team to get one.
- Dynamic PV provisioning through a StorageClass. Elasticsearch needs it for storage.
Step 1 (optional): Apply the AddonConfig
You need an AddonConfig only to change the default Calico Enterprise configuration, for example to create a cluster with Windows nodes. A Linux-only cluster that uses the defaults doesn't need one.
The following example AddonConfig enables the Windows dataplane and disables policy recommendation. Before you apply it, update the following fields:
metadata.nameandmetadata.namespace. The name must use the format<cluster-name>-calico-enterprise. If it doesn't, the add-on framework ignores your AddonConfig and creates one with default values instead.- For air-gapped installs,
spec.values.helmValues.installation.registry. Set it to the private registry that holds the Calico Enterprise images. See Copy the images to the private registry.
apiVersion: addons.kubernetes.vmware.com/v1alpha1
kind: AddonConfig
metadata:
name: <cluster-name>-calico-enterprise
namespace: <cluster-namespace>
spec:
values:
helmValues:
# You can set any option from tigera-helm-charts/tigera-operator/values.yaml here.
# Options you don't set use the defaults from the AddonConfigDefinition schema.
# The following fields are examples.
installation:
calicoWindowsDataplane:
enabled: true
policyRecommendation:
enabled: false
kubectl apply -f ./addon-config.yaml
All Calico Enterprise features (logCollector, logStorage, manager, monitor, and policyRecommendation) are optional.
Only apiServer is required.
To turn off a feature, set its enabled field to false.
Step 2 (optional): Apply a custom AddonInstall resource
You need a custom AddonInstall resource only to control which clusters get upgraded.
In spec.clusters.selector.matchLabels, set the labels that a cluster must have.
Then add those labels to the Cluster resources that you want to upgrade.
apiVersion: addons.kubernetes.vmware.com/v1alpha1
kind: AddonInstall
metadata:
labels:
addon.kubernetes.vmware.com/addon-name: calico-enterprise
addon.kubernetes.vmware.com/addon-namespace: vmware-system-vks-public
addons.kubernetes.vmware.com/category: cni
name: <addon-install-name>
namespace: <cluster-namespace>
spec:
addonRef:
name: calico-enterprise
namespace: vmware-system-vks-public
clusters:
- selector:
matchLabels:
<addon-install-label-key>: <addon-install-label-value> # For example, cluster-group: calico-group-1
constraints:
expression: cluster.cniRefName() = "calico-enterprise" && cluster.kubeProxyConfiguration().enabled == true
releaseFilter:
ref:
name: calico-enterprise.tigera.io.3.23.4
stopMatchingBehavior: Retain
kubectl apply -f ./addon-install.yaml
Step 3: Apply the Cluster resource
The following example creates a cluster with Linux and Windows node pools.
For a Linux-only cluster, remove the Windows node pool (windows-pool).
Before you apply it, update the following fields:
metadata.nameandmetadata.namespace.cniRefin thebootstrapAddonsvariable, if the Calico Enterprise add-on has a different name or namespace.metadata.labels, if you applied a custom AddonInstall in Step 2. Add the<addon-install-label-key>: <addon-install-label-value>label from the AddonInstall.- The node pool configuration, such as the VM class, storage class, and number of replicas, to suit your environment.
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: <cluster-name>
namespace: <cluster-namespace>
spec:
clusterNetwork:
pods: {cidrBlocks: [100.96.0.0/11]}
services: {cidrBlocks: [100.64.0.0/13]} # required for Windows (becomes serviceCIDRs)
serviceDomain: cluster.local
topology:
classRef: {name: builtin-generic-v3.8.0, namespace: vmware-system-vks-public}
version: v1.36.4+vmware.2-vkr.3
controlPlane:
replicas: 1
metadata: &ubuntu
annotations: {run.tanzu.vmware.com/resolve-os-image: "os-name=ubuntu,os-version=24.04"}
workers:
machineDeployments:
- {class: node-pool, name: linux-pool-1, replicas: 3, metadata: *ubuntu,
variables: {overrides: [{name: vmClass, value: best-effort-large}]}}
- {class: node-pool, name: linux-pool-2, replicas: 2, metadata: *ubuntu}
- class: node-pool
name: windows-pool
replicas: 2
metadata:
annotations: {run.tanzu.vmware.com/resolve-os-image: "os-name=windows,os-version=2022"}
variables: {overrides: [{name: vmClass, value: best-effort-xlarge}]}
variables:
- {name: bootstrapAddons, value: {cniRef: {name: calico-enterprise, namespace: vmware-system-vks-public}}}
- {name: vmClass, value: best-effort-xlarge}
- {name: storageClass, value: vsan-esa-default-policy-raid5}
- {name: vsphereOptions, value: {persistentVolumes: {defaultStorageClass: vsan-esa-default-policy-raid5}}}
- {name: kubernetes, value: {certificateRotation: {enabled: true, renewalDaysBeforeExpiry: 90}}}
# Must be cluster-level: the Calico ACD only reads spec.topology.variables.
- {name: osConfiguration, value: {windowsToolsConfig: {excludeNICs: ["cali*"]}}}
- name: node
value:
firewall:
inboundRules:
- {protocol: tcp, fromPort: 179, toPort: 179} # BGP
- {protocol: udp, fromPort: 4789, toPort: 4789} # VXLAN
- {protocol: tcp, fromPort: 5473, toPort: 5473} # Typha
- {protocol: udp, fromPort: 51820, toPort: 51820} # WireGuard
- {protocol: tcp, fromPort: 8444, toPort: 8444} # Linseed
- {protocol: tcp, fromPort: 9090, toPort: 9090} # Prometheus
- {protocol: tcp, fromPort: 9200, toPort: 9200} # Elasticsearch
- {protocol: tcp, fromPort: 9300, toPort: 9300} # Elasticsearch transport
- {protocol: tcp, fromPort: 9443, toPort: 9443} # Manager UI
kubectl apply -f ./cluster.yaml
Step 4: Retrieve the guest cluster kubeconfig
Copy the guest cluster's kubeconfig from the Supervisor. Run the remaining steps against the guest cluster.
Step 5: Wait for the core components
Monitor the Tigera status until calico and apiserver show as Available:
kubectl get tigerastatus
All nodes are now in the Ready state.
Step 6 (Windows only): Configure Windows nodes
Skip this step for Linux-only clusters.
-
Set
strictAffinitytotruein the IPAM configuration:kubectl patch ipamconfigurations default --type merge -p '{"spec":{"strictAffinity":true}}'If the IPAM configuration doesn't exist yet, create it:
kubectl apply -f - <<EOFapiVersion: projectcalico.org/v3kind: IPAMConfigurationmetadata: {name: default}spec: {strictAffinity: true}EOF -
Get the Kubernetes version of the guest cluster:
kubectl version -o json | jq -r '.serverVersion.gitVersion'If the version has a VMware suffix, such as
v1.36.4+vmware.2, remove the suffix (v1.36.4). Keep the suffix only if thesigwindowstools/kube-proxyrepository has a kube-proxy image for that VMware version. -
Install kube-proxy for Windows:
curl -L https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/hostprocess/calico/kube-proxy/kube-proxy.yml | sed "s/KUBE_PROXY_VERSION/<kubernetes-version>/g" | kubectl apply -f -Replace
<kubernetes-version>with the version from the previous step.In an air-gapped environment, download
kube-proxy.ymlon a host with internet access, and copy it into the environment. Then run the samesedandkubectl applycommands on the local file.
Step 7: Apply the Tigera license
kubectl apply -f <path-to-license-file>
Replace <path-to-license-file> with the path to the Tigera license file.
Step 8: Verify the installation
Wait for all remaining components to become available:
kubectl get tigerastatus
kubectl get pods -A | grep -E 'tigera|calico'
When every component in tigerastatus shows Available, the installation is complete.
You can now deploy workloads to test networking.
Air-gapped environments
An air-gapped environment has no internet access, or very limited access. Clusters in such an environment can't pull the Calico Enterprise add-on or the Calico Enterprise images directly from Tigera's registries. Instead, you copy these artifacts from Tigera's registries to a private registry that the environment can reach.
This involves two tasks:
- Copy the add-on to the private registry, so that the Supervisor can install the Calico Enterprise Supervisor Service.
- Copy the images to the private registry, so that guest clusters can run Calico Enterprise.
Air-gapped prerequisites
imgpkg,helm, andyqinstalled locally.- Network access to both Tigera's registry and the private registry. If no single host can reach both, you can copy the artifacts through a tarball instead.
- Credentials to push to the private registry.
imgpkguses your local Docker configuration, or prompts you for credentials.
Copy the add-on to the private registry
The Calico Enterprise add-on consists of a Helm chart and a Supervisor Service (SVS) bundle. Copy both to the private registry, then point the Supervisor Service at them.
Step 1: Copy the Helm chart
On a host that can reach quay.io, pull the Calico Enterprise add-on Helm chart and push it to the private registry:
helm pull oci://quay.io/tigera/calico-enterprise --version 3.23.4
helm push calico-enterprise-3.23.4.tgz oci://<private-registry>/<path>
Replace <private-registry>/<path> with the registry and path that will hold the chart.
Don't include the chart name (calico-enterprise) in the path.
You use the same value for chartRepository when you register the Supervisor Service in Step 5.
Step 2: Copy the SVS bundle to a tarball
On a host that can reach quay.io, copy the SVS bundle to a tarball:
imgpkg copy --bundle quay.io/tigera/calico-enterprise-svs:v3.23.4 --to-tar calico-enterprise-svs.tar
If one host can reach both registries, you can copy the bundle directly to the private registry and skip Step 3.
Replace --to-tar calico-enterprise-svs.tar with --to-repo <private-registry>/calico-enterprise-svs.
Step 3: Push the SVS bundle to the private registry
On a host that can reach the private registry, push the tarball:
imgpkg copy --tar calico-enterprise-svs.tar --to-repo <private-registry>/calico-enterprise-svs
Use imgpkg to copy the bundle.
Don't copy individual images with docker pull and docker push.
Re-tagging images can change their manifest digests, and the bundle's images.yml lock file isn't updated to match.
kapp-controller then fails to fetch the images, with a manifest unknown error.
Step 4: Update the package to use the private registry
The Package resource in calico-enterprise-svs.yaml is the only registry reference outside the bundles.
Update it to point to the SVS bundle in the private registry:
yq eval '
(select(.kind == "Package") | .spec.template.spec.fetch[0].imgpkgBundle.image)
= "<private-registry>/calico-enterprise-svs:v3.23.4"
' -i calico-enterprise-svs.yaml
To make the reference immutable, pin it to a digest.
The last line of the imgpkg copy --to-repo output shows the digest of the copied bundle.
In the yq command, replace :v3.23.4 with @sha256:<digest>.
Step 5: Upload the package to the Supervisor
Upload the updated Package and PackageMetadata resources from calico-enterprise-svs.yaml on the vSphere Client Supervisor Management page, as described in Part 1.
When you register the Supervisor Service, set these values in the service YAML configuration:
chartRepository: the Helm chart path from Step 1.registryName: the name you registered the private registry under on the Container Registries page.
You can set chartRepository only once for each version of the Supervisor Service.
You can't change it later.
Copy the images to the private registry
Before you create guest clusters, copy the Calico Enterprise images to the private registry, and configure the cluster to pull them from there.
-
Copy the Calico Enterprise images from
quay.io/tigerato the private registry. Follow the steps in Push Calico Enterprise images to your private registry. Don't push Calico Enterprise images to a public registry. -
If the private registry requires authentication, register it with its credentials on the vSphere Client Container Registries page. Use the name you register it under as
registryNamewhen you register the Supervisor Service. See Step 5: Upload the package to the Supervisor. -
Add the private registry to the
installationsection of the AddonConfig. For more about the AddonConfig, see Step 1 (optional): Apply the AddonConfig.apiVersion: addons.kubernetes.vmware.com/v1alpha1kind: AddonConfigmetadata:name: <cluster-name>-calico-enterprisenamespace: <cluster-namespace>spec:values:helmValues:installation:registry: registry.example.internal:5000/ # mirror host[:port]# imagePath: tigera # optional; only if you pushed all images under one path# imagePrefix: "" # optional; only if your mirror renames images
Next steps
Recommended
- Configure access to the Calico Enterprise web console
- Get started with Calico Enterprise tiered network policy
Recommended - Networking
- For all networking options, see Determine best networking option.