第一种方式:
kubectl -n kubesphere-system get sa kubesphere -oyaml
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
meta.helm.sh/release-name: ks-core
meta.helm.sh/release-namespace: kubesphere-system
creationTimestamp: "2023-07-24T07:42:22Z"
labels:
app.kubernetes.io/instance: ks-core
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: ks-core
app.kubernetes.io/version: v3.1.0
helm.sh/chart: ks-core-0.1.0
name: kubesphere
namespace: kubesphere-system
resourceVersion: "6605"
selfLink: /api/v1/namespaces/kubesphere-system/serviceaccounts/kubesphere
uid: 87471ddc-3d88-4baf-b05b-e86dee6dc9db
secrets:
- name: kubesphere-token-fcjqp
# 查看secret
kubectl -n kubesphere-system describe secret kubesphere-token-fcjqp
Name: kubesphere-token-fcjqp
Namespace: kubesphere-system
Labels: <none>
Annotations: kubernetes.io/service-account.name: kubesphere
kubernetes.io/se