Permission Denied when adding VCF Package Repository on VKS Workload Cluster
search cancel

Permission Denied when adding VCF Package Repository on VKS Workload Cluster

book

Article ID: 439333

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service VMware vSphere ESXi

Issue/Introduction

Adding a VCF package repository on a VKS Workload cluster fails with authorization errors. The executing user is the namespace owner and possesses a ClusterRoleBinding with cluster-admin privileges.

Error: packagerepositories.packaging.carvel.dev "standard-package-repo" is forbidden: User "sso:[email protected]" cannot get resource "packagerepositories" in API group "packaging.carvel.dev" in the namespace "tkg-system"

Environment

VMware Cloud Foundation 9.0

VMware Kubernetes Service

Cause

The package repository addition command is executed with the sudo elevation prefix. This causes the CLI to execute as the local root user, which lacks a valid Kubernetes context for the session, resulting in API authorization failure for example.

sudo vcf package repository add standard-package-repo --url projects.packages.broadcom.com/vsphere/supervisor/packages/2025.8.19/vks-standard-packages:v2025.8.19  -n tkg-system

Resolution

  1. Verify the current authenticated user has the correct Kubernetes context configured for the target namespace.
  2. Execute the vcf package repository add command without the sudo prefix to ensure the command utilizes the established user context.