mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #26596 from jcrugzz/ALLOW-PRIVILEGED
Automatic merge from submit-queue [fix] allow ALLOW_PRIVILEGED to be passed to kubelet and kube-api This is something that we need for running docker in docker. Please let me know if you would consider this change. Thanks :)
This commit is contained in:
commit
50d58f4437
@ -112,5 +112,8 @@ ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
|
|||||||
# Add environment variable separated with blank space like "http_proxy=http://10.x.x.x:8080 https_proxy=https://10.x.x.x:8443"
|
# Add environment variable separated with blank space like "http_proxy=http://10.x.x.x:8080 https_proxy=https://10.x.x.x:8443"
|
||||||
PROXY_SETTING=${PROXY_SETTING:-""}
|
PROXY_SETTING=${PROXY_SETTING:-""}
|
||||||
|
|
||||||
|
# Optional: Allows kublet/kube-api to be run in privileged mode
|
||||||
|
ALLOW_PRIVILEGED=${ALLOW_PRIVILEGED:-"false"}
|
||||||
|
|
||||||
DEBUG=${DEBUG:-"false"}
|
DEBUG=${DEBUG:-"false"}
|
||||||
|
|
||||||
|
@ -234,6 +234,7 @@ EOF
|
|||||||
# $2: Admission Controllers to invoke in the API server.
|
# $2: Admission Controllers to invoke in the API server.
|
||||||
# $3: A port range to reserve for services with NodePort visibility.
|
# $3: A port range to reserve for services with NodePort visibility.
|
||||||
# $4: The IP address on which to advertise the apiserver to members of the cluster.
|
# $4: The IP address on which to advertise the apiserver to members of the cluster.
|
||||||
|
# $5: Tells kube-api to run in privileged mode
|
||||||
function create-kube-apiserver-opts() {
|
function create-kube-apiserver-opts() {
|
||||||
cat <<EOF > ~/kube/default/kube-apiserver
|
cat <<EOF > ~/kube/default/kube-apiserver
|
||||||
KUBE_APISERVER_OPTS="\
|
KUBE_APISERVER_OPTS="\
|
||||||
@ -245,6 +246,7 @@ KUBE_APISERVER_OPTS="\
|
|||||||
--admission-control=${2}\
|
--admission-control=${2}\
|
||||||
--service-node-port-range=${3}\
|
--service-node-port-range=${3}\
|
||||||
--advertise-address=${4}\
|
--advertise-address=${4}\
|
||||||
|
--allow-privileged=${5}\
|
||||||
--client-ca-file=/srv/kubernetes/ca.crt\
|
--client-ca-file=/srv/kubernetes/ca.crt\
|
||||||
--tls-cert-file=/srv/kubernetes/server.cert\
|
--tls-cert-file=/srv/kubernetes/server.cert\
|
||||||
--tls-private-key-file=/srv/kubernetes/server.key"
|
--tls-private-key-file=/srv/kubernetes/server.key"
|
||||||
@ -279,9 +281,10 @@ EOF
|
|||||||
# $3: If non-empty then the DNS server IP to configure in each pod.
|
# $3: If non-empty then the DNS server IP to configure in each pod.
|
||||||
# $4: If non-empty then added to each pod's domain search list.
|
# $4: If non-empty then added to each pod's domain search list.
|
||||||
# $5: Pathname of the kubelet config file or directory.
|
# $5: Pathname of the kubelet config file or directory.
|
||||||
# $6: If empty then flannel is used otherwise CNI is used.
|
# $6: Whether or not we run kubelet in priviliged mode
|
||||||
|
# $7: If empty then flannel is used otherwise CNI is used.
|
||||||
function create-kubelet-opts() {
|
function create-kubelet-opts() {
|
||||||
if [ -n "$6" ] ; then
|
if [ -n "$7" ] ; then
|
||||||
cni_opts=" --network-plugin=cni --network-plugin-dir=/etc/cni/net.d"
|
cni_opts=" --network-plugin=cni --network-plugin-dir=/etc/cni/net.d"
|
||||||
else
|
else
|
||||||
cni_opts=""
|
cni_opts=""
|
||||||
@ -294,6 +297,7 @@ KUBELET_OPTS="\
|
|||||||
--cluster-dns=${3} \
|
--cluster-dns=${3} \
|
||||||
--cluster-domain=${4} \
|
--cluster-domain=${4} \
|
||||||
--config=${5} \
|
--config=${5} \
|
||||||
|
--allow-privileged=${6}
|
||||||
$cni_opts"
|
$cni_opts"
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@ -472,7 +476,8 @@ function provision-master() {
|
|||||||
'${SERVICE_CLUSTER_IP_RANGE}' \
|
'${SERVICE_CLUSTER_IP_RANGE}' \
|
||||||
'${ADMISSION_CONTROL}' \
|
'${ADMISSION_CONTROL}' \
|
||||||
'${SERVICE_NODE_PORT_RANGE}' \
|
'${SERVICE_NODE_PORT_RANGE}' \
|
||||||
'${MASTER_IP}'
|
'${MASTER_IP}' \
|
||||||
|
'${ALLOW_PRIVILIGED}'
|
||||||
create-kube-controller-manager-opts '${NODE_IPS}'
|
create-kube-controller-manager-opts '${NODE_IPS}'
|
||||||
create-kube-scheduler-opts
|
create-kube-scheduler-opts
|
||||||
create-flanneld-opts '127.0.0.1' '${MASTER_IP}'
|
create-flanneld-opts '127.0.0.1' '${MASTER_IP}'
|
||||||
@ -553,6 +558,7 @@ function provision-node() {
|
|||||||
'${DNS_SERVER_IP}' \
|
'${DNS_SERVER_IP}' \
|
||||||
'${DNS_DOMAIN}' \
|
'${DNS_DOMAIN}' \
|
||||||
'${KUBELET_CONFIG}' \
|
'${KUBELET_CONFIG}' \
|
||||||
|
'${ALLOW_PRIVILEGED}' \
|
||||||
'${CNI_PLUGIN_CONF}'
|
'${CNI_PLUGIN_CONF}'
|
||||||
create-kube-proxy-opts \
|
create-kube-proxy-opts \
|
||||||
'${1#*@}' \
|
'${1#*@}' \
|
||||||
@ -644,7 +650,8 @@ function provision-masterandnode() {
|
|||||||
'${SERVICE_CLUSTER_IP_RANGE}' \
|
'${SERVICE_CLUSTER_IP_RANGE}' \
|
||||||
'${ADMISSION_CONTROL}' \
|
'${ADMISSION_CONTROL}' \
|
||||||
'${SERVICE_NODE_PORT_RANGE}' \
|
'${SERVICE_NODE_PORT_RANGE}' \
|
||||||
'${MASTER_IP}'
|
'${MASTER_IP}' \
|
||||||
|
'${ALLOW_PRIVILEGED}'
|
||||||
create-kube-controller-manager-opts '${NODE_IPS}'
|
create-kube-controller-manager-opts '${NODE_IPS}'
|
||||||
create-kube-scheduler-opts
|
create-kube-scheduler-opts
|
||||||
create-kubelet-opts \
|
create-kubelet-opts \
|
||||||
@ -653,6 +660,7 @@ function provision-masterandnode() {
|
|||||||
'${DNS_SERVER_IP}' \
|
'${DNS_SERVER_IP}' \
|
||||||
'${DNS_DOMAIN}' \
|
'${DNS_DOMAIN}' \
|
||||||
'${KUBELET_CONFIG}' \
|
'${KUBELET_CONFIG}' \
|
||||||
|
'${ALLOW_PRIVILEGED}' \
|
||||||
'${CNI_PLUGIN_CONF}'
|
'${CNI_PLUGIN_CONF}'
|
||||||
create-kube-proxy-opts \
|
create-kube-proxy-opts \
|
||||||
'${MASTER_IP}' \
|
'${MASTER_IP}' \
|
||||||
|
Loading…
Reference in New Issue
Block a user