The procedure in this topic describes how to deploy Dex on a Tanzu Kubernetes Grid management cluster that is running in vSphere, and connect it to an LDAP server.
Navigate to the bundle of Tanzu Kubernetes Grid extension manifests and open the file tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/02-certs-selfsigned.yaml
in a text editor.
For example, use vi
to edit the file.
vi tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/02-certs-selfsigned.yaml
Modify 02-certs-selfsigned.yaml
with information about your management cluster.
Replace <MGMT_CLUSTER_IP1>
and <MGMT_CLUSTER_IP2>
with the IP addresses of the control plane nodes for your management cluster. Remove the row for <MGMT_CLUSTER_IP2>
if your management cluster has a single node control plane. Add more rows if your control plane has more than two nodes.
Open the Dex configuration map file tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/03-cm.yaml
in a text editor.
For example, use vi
to edit the file.
vi tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/03-cm.yaml
Modify 03-cm.yaml
with information about your management cluster and LDAP server.
<MGMT_CLUSTER_IP>
with the IP address of one of the control plane nodes of your management cluster.<LDAP_HOST>
with the IP or DNS address of your LDAP server.userSearch
parameters with your LDAP server configuration.Set the focus of kubectl
to the context of your management cluster.
For example, if your cluster is named my-cluster
, run the following command.
kubectl config use-context my-cluster-admin@my-cluster
Apply all of the YAML files in the tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap
folder to your management cluster, in order.
tanzu-system-auth
in your management cluster for the authentication service. kubectl apply -f tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/01-namespace.yaml
kubectl apply -f tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/02-certs-selfsigned.yaml
kubectl apply -f tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/03-cm.yaml
kubectl apply -f tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/04-rbac.yaml
kubectl apply -f tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/05-deployment.yaml
NodePort
service. kubectl apply -f tkg-extensions-v1.0.0/authentication/dex/vsphere/ldap/06-service.yaml
Run kubectl get pods -A
to list all of the pods running in the management cluster.
You should see the Dex service running in a pod with a name similar to dex-6849555c67-bqmpd
.
Deploy an Authentication-Enabled Cluster, that has an embedded OIDC endpoint that can connect to your LDAP server.