You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Configure mTLS for clients (e.g. kube-apiserver).
1722
+
# mTLS should only be enabled for etcd server but not etcd-events. If $1 suffix is empty, it's etcd server.
1723
+
local etcd_listen_metrics_urls=""
1715
1724
if [[ -z"${suffix}"&&-n"${ETCD_APISERVER_CA_KEY:-}"&&-n"${ETCD_APISERVER_CA_CERT:-}"&&-n"${ETCD_APISERVER_SERVER_KEY:-}"&&-n"${ETCD_APISERVER_SERVER_CERT:-}"&&-n"${ETCD_APISERVER_CLIENT_KEY:-}"&&-n"${ETCD_APISERVER_CLIENT_CERT:-}" ]];then
Copy file name to clipboardExpand all lines: cluster/gce/gci/configure-kubeapiserver.sh
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -14,25 +14,34 @@
14
14
# limitations under the License.
15
15
16
16
17
-
# Configures etcd related flags of kube-apiserver.
17
+
# Configures etcd related parameters of kube-apiserver.
18
18
functionconfigure-etcd-params {
19
19
local -n params_ref=$1
20
20
21
+
local host_ip="127.0.0.1"
22
+
# If etcd is configured to listen on host IP,
23
+
# host_ip is set to the primary internal IP of host VM.
24
+
if [[ ${ETCD_LISTEN_ON_HOST_IP:-}=="true" ]] ;then
25
+
host_ip="${HOST_PRIMARY_IP:-$(hostname -i)}"
26
+
fi
27
+
28
+
# Configure the main etcd.
21
29
if [[ -n"${ETCD_APISERVER_CA_KEY:-}"&&-n"${ETCD_APISERVER_CA_CERT:-}"&&-n"${ETCD_APISERVER_SERVER_KEY:-}"&&-n"${ETCD_APISERVER_SERVER_CERT:-}"&&-n"${ETCD_APISERVER_CLIENT_KEY:-}"&&-n"${ETCD_APISERVER_CLIENT_CERT:-}" ]];then
echo"WARNING: ALL of ETCD_APISERVER_CA_KEY, ETCD_APISERVER_CA_CERT, ETCD_APISERVER_SERVER_KEY, ETCD_APISERVER_SERVER_CERT, ETCD_APISERVER_CLIENT_KEY and ETCD_APISERVER_CLIENT_CERT are missing, mTLS between etcd server and kube-apiserver is not enabled."
29
37
else
30
38
echo"ERROR: Some of ETCD_APISERVER_CA_KEY, ETCD_APISERVER_CA_CERT, ETCD_APISERVER_SERVER_KEY, ETCD_APISERVER_SERVER_CERT, ETCD_APISERVER_CLIENT_KEY and ETCD_APISERVER_CLIENT_CERT are missing, mTLS between etcd server and kube-apiserver cannot be enabled. Please provide all mTLS credential."
0 commit comments