Application is not working despite pod(s) in healthy running state in a vSphere Kubernetes cluster. This application uses ingress control through contour and envoy installed as a package (pkgi).
While connected to the vSphere Kubernetes cluster where the affected application is running, the following symptoms are present:
kubectl get pods -n <pod namespace>
kubectl logs <pod name> -n <pod namespace>
kubectl get pkgi -A | grep contour
kubectl get pods -A | grep envoy
kubectl get ds -A | grep envoy
kubectl describe ds envoy -n <envoy namespace>
pods \"envoy\" is forbidden: violates PodSecurity \"restricted:latest\": allowPrivilegeEscalation != false
VMware vSphere 8.0 with Tanzu
VMware vSphere 7.0 with Tanzu
This issue can occur on vSphere Kubernetes cluster regardless of whether or not it is managed by Tanzu Mission Control (TMC)
This KB article only applies if the issue is regarding applications using contour-envoy ingress control that is installed in a vSphere Kubernetes Cluster as a package (pkgi)
Ingress control through contour with envoy will not work if envoy pods are not running in the environment.
The envoy daemonset is unable to create pods due to Pod Security Policy (PSP) or Pod Security Admission (PSA) defined in the vSphere Kubernetes cluster.
This issue can occur on first-time setup or after the envoy pods have been restarted. A restart may have been initiated by a change made to the pkgi, manual restart or outage.
The envoy daemonset is responsible for creating the envoy pods on each worker node in the vSphere Kubernetes cluster. In this scenario, the daemonset is unable to create the envoy pods because of the PodSecurity defined in the cluster.
This KB article only applies if the issue is regarding applications using contour-envoy ingress control that is installed in a vSphere Kubernetes Cluster as a package (pkgi)
NOTE: This KB article provides a workaround to bring up the envoy pods by bypassing the PodSecurity rules. It is best practice to define the PodSecurity appropriately to allow contour, envoy and cert-manager (if applicable) pods to deploy according to your security needs.
kubectl describe ds envoy -n <envoy namespace>
pods \"envoy\" is forbidden: violates PodSecurity \"restricted:latest\": allowPrivilegeEscalation != false
kubectl get pkgi -A | grep contour
kubectl describe pkgi <contour pkgi> -n <contour namespace>
kubectl label --overwrite ns <envoy namespace> pod-security.kubernetes.io/enforce-privileged
kubectl get ds envoy -n <envoy namespace>
kubectl get pods -n <envoy namespace> -o wide
kubectl get services -A | grep envoy
kubectl get ds cert-manager -n <cert-manager namespace>
kubectl describe ds cert-manager -n <cert-manager namespace>
kubectl label --overwrite ns <cert-manager namespace> pod-security.kubernetes.io/enforce-privilege
kubectl get ds cert-manager -n <cert-manager namespace>
kubectl get pkgi -A
kubectl get rs contour -n <contour namespace>
kubectl describe rs contour -n <contour namespace>
kubectl get pkgi -A | grep contour
kubectl describe pkgi <contour pkgi> -n <contour namespace>
envoy
pspNames: null
envoy
pspNames: "vmware-system-restricted"
contour
pspNames: "vmware-system-restricted"
kubectl get ds envoy -n <envoy namespace>
kubectl get pods -n <envoy namespace> -o wide
kubectl get services -A | grep envoy
kubectl get pkgi -A
kubectl get rs contour -n <contour namespace>
kubectl describe rs contour -n <contour namespace>
kubectl label --overwrite ns <contour namespace> pod-security.kubernetes.io/enforce-privilege
kubectl get ds cert-manager -n <cert-manager namespace>
kubectl describe ds cert-manager -n <cert-manager namespace>
kubectl label --overwrite ns <cert-manager namespace> pod-security.kubernetes.io/enforce-privilege
kubectl get rs contour -n <contour namespace>
kubectl describe rs contour -n <contour namespace>
kubectl get pkgi -A | grep contour
kubectl describe pkgi <contour pkgi> -n <contour namespace>
Packages managed by Tanzu Mission Control will automatically periodically revert the enforce-privilege label used to bypass the PodSecurity rules set up in the vSphere Kubernetes cluster.