mirror of https://github.com/k3s-io/k3s
Merge pull request #76792 from dekkagaijin/insecure-port
add option to disable the apiserver's insecure port via env vark3s-v1.15.3
commit
06bc7e3e00
|
@ -1593,6 +1593,10 @@ function start-kube-apiserver {
|
|||
params+=" --etcd-servers-overrides=${ETCD_SERVERS_OVERRIDES:-}"
|
||||
fi
|
||||
params+=" --secure-port=443"
|
||||
if [[ "${ENABLE_APISERVER_INSECURE_PORT:-true}" != "true" ]]; then
|
||||
# Default is :8080
|
||||
params+=" --insecure-port=0"
|
||||
fi
|
||||
params+=" --tls-cert-file=${APISERVER_SERVER_CERT_PATH}"
|
||||
params+=" --tls-private-key-file=${APISERVER_SERVER_KEY_PATH}"
|
||||
params+=" --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname"
|
||||
|
@ -1878,7 +1882,6 @@ function start-kube-apiserver {
|
|||
sed -i -e "s@{{pillar\['allow_privileged'\]}}@true@g" "${src_file}"
|
||||
sed -i -e "s@{{liveness_probe_initial_delay}}@${KUBE_APISERVER_LIVENESS_PROBE_INITIAL_DELAY_SEC:-15}@g" "${src_file}"
|
||||
sed -i -e "s@{{secure_port}}@443@g" "${src_file}"
|
||||
sed -i -e "s@{{secure_port}}@8080@g" "${src_file}"
|
||||
sed -i -e "s@{{additional_cloud_config_mount}}@@g" "${src_file}"
|
||||
sed -i -e "s@{{additional_cloud_config_volume}}@@g" "${src_file}"
|
||||
sed -i -e "s@{{webhook_authn_config_mount}}@${webhook_authn_config_mount}@g" "${src_file}"
|
||||
|
|
|
@ -32,8 +32,9 @@
|
|||
{{container_env}}
|
||||
"livenessProbe": {
|
||||
"httpGet": {
|
||||
"scheme": "HTTPS",
|
||||
"host": "127.0.0.1",
|
||||
"port": 8080,
|
||||
"port": {{secure_port}},
|
||||
"path": "/healthz?exclude=etcd"
|
||||
},
|
||||
"initialDelaySeconds": {{liveness_probe_initial_delay}},
|
||||
|
@ -41,8 +42,9 @@
|
|||
},
|
||||
"readinessProbe": {
|
||||
"httpGet": {
|
||||
"scheme": "HTTPS",
|
||||
"host": "127.0.0.1",
|
||||
"port": 8080,
|
||||
"port": {{secure_port}},
|
||||
"path": "/healthz"
|
||||
},
|
||||
"periodSeconds": 1,
|
||||
|
|
Loading…
Reference in New Issue