您好
kubectl apply -f - <<EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kube-system-default
labels:
k8s-app: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
apiVersion: v1
kind: Secret
metadata:
name: default
namespace: kube-system
labels:
k8s-app: kube-system
annotations:
kubernetes.io/service-account.name: default
type: kubernetes.io/service-account-token
EOF
想請問上面這段指令應該怎麼輸入到linux裡面呢?
kubectl apply -f - 後面接檔案名嗎?
因為直接輸入kubectl apply -f - <<EOF 會出現錯誤的指令,感謝。
cat <<EOF | kubectl create -f -
apiVersion: rbac.authorization.k8s.io/v1
...
type: kubernetes.io/service-account-token
EOF