Creating a user for TKG monitoring using vROPS, you see a token authentication expiration issue.
Prior to Kubernetes version 1.24, Secrets were automatically created with the Service Account. From Kubernetes version 1.24 and above, you must manually create Secrets.
Bearer tokens allow you to control access to resources in a cluster that requires the creation of the following:
Prior to Kubernetes version 1.24, Secrets were automatically created with the Service Account. From Kubernetes version 1.24 and above, you must manually create Secrets.
Prior to Kubernetes version 1.24, Secrets were automatically created with the Service Account. From Kubernetes version 1.24 and above, you must manually create Secrets.
Sample YAML file for kubernetes version 1.24 and above:
kind: ClusterRoleapiVersion: rbac.authorization.k8s.io/v1metadata: namespace: '*' name: vrops-read-onlyrules: - apiGroups: ["*"] resources: ["*"] verbs: ["get", "list", "watch"] - nonResourceURLs: - / verbs: - get---apiVersion: v1kind: ServiceAccountmetadata: name: vrops-mp-read-only-user namespace: default---apiVersion: v1kind: Secrettype: kubernetes.io/service-account-tokenmetadata: name: vrops-mp-read-only-user-token namespace: default annotations: kubernetes.io/service-account.name: "vrops-mp-read-only-user"---apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: name: vrops-mp-read-only-userroleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: vrops-read-onlysubjects: - kind: ServiceAccount name: vrops-mp-read-only-user namespace: default
After applying the yaml file with kubectl apply -f <file>.yaml, the following token provides the bearer token:
$(kubectl get secret vrops-mp-read-only-user-token -o jsonpath='{.data.token}' | base64 --decode )
For detailed information see: https://techdocs.broadcom.com/us/en/vmware-cis/aria/aria-operations-for-integrations/2-2/vrealize--operations-management-pack--for-pack-for-kubernetes-2-2/configuring-vrealize-operations-management-pack-for-kubernetes.html