繁体   English   中英

Jenkins Kubernetes 插件安全上下文

[英]Jenkins Kubernetes Plugin Security Context

我如何在 Jenkins Kubernetes 插件中更改我的 pod 的 securityContext。 例如,在docker环境中以特权模式在docker镜像中运行docker。

我相信应该有效(根据文档):

def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
apiVersion: v1
kind: Pod
metadata:
  labels:
    some-label: some-label-value
spec:
  containers:
  - name: busybox
    image: busybox
    command:
    - cat
    tty: true
    securityContext:
      allowPrivilegeEscalation: true
"""
) {
    node (label) {
      container('busybox') {
        sh "hostname"
      }
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM