如何在Jenkins Kubernetes插件中更改pod的securityContext。例如,在docker环境中以特权模式在docker镜像中运行docker。
发布于 2018-10-29 11:06:51
我相信this应该可以工作(根据文档):
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"
}
}
}
https://stackoverflow.com/questions/53031914
复制相似问题