[英]Kubernetes commands are not running inside the Jenkins container
enter image description here I have deployed Jenkins container inside the k8s cluster successfuly but I can't able to execute "kubectl get pod -A" where as kubectl also installed inside the Jenkins container.在此处输入图像描述我已经在 k8s 集群内成功部署了 Jenkins 容器,但我无法执行“kubectl get pod -A”,因为 kubectl 也安装在 Jenkins 容器内。 How can I run k8s command inside the Jenkins container so I can able to apply CI/CD for k8s.
如何在 Jenkins 容器内运行 k8s 命令,以便能够为 k8s 应用 CI/CD。 Below is the errors when I run k8s command inside the Jenkins container which is running inside the k8s pod.
以下是我在 k8s pod 内运行的 Jenkins 容器内运行 k8s 命令时出现的错误。
You need to create the cluster role binding for the service account jenkins.您需要为服务帐户 jenkins 创建集群角色绑定。
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: jenkins-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: jenkins
namespace: jenkins
kubectl apply -f sa.yaml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.