File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 265
265
fi
266
266
267
267
# write karmada api server config to kubeconfig file
268
- util::append_client_kubeconfig " ${HOST_CLUSTER_KUBECONFIG} " " ${CERT_DIR} /client.crt" " ${CERT_DIR} /client.key" " ${KARMADA_APISERVER_IP} " " ${KARMADA_APISERVER_SECURE_PORT} " karmada-apiserver
268
+ util::append_client_kubeconfig " ${HOST_CLUSTER_KUBECONFIG} " " ${ROOT_CA_FILE} " " ${ CERT_DIR} /client.crt" " ${CERT_DIR} /client.key" " ${KARMADA_APISERVER_IP} " " ${KARMADA_APISERVER_SECURE_PORT} " karmada-apiserver
269
269
270
270
# deploy kube controller manager
271
271
cp " ${REPO_ROOT} " /artifacts/deploy/kube-controller-manager.yaml " ${TEMP_PATH_APISERVER} " /kube-controller-manager.yaml
Original file line number Diff line number Diff line change @@ -258,13 +258,14 @@ EOF
258
258
# util::append_client_kubeconfig creates a new context including a cluster and a user to the existed kubeconfig file
259
259
function util::append_client_kubeconfig {
260
260
local kubeconfig_path=$1
261
- local client_certificate_file=$2
262
- local client_key_file=$3
263
- local api_host=$4
264
- local api_port=$5
265
- local client_id=$6
266
- local token=${7:- }
267
- kubectl config set-cluster " ${client_id} " --server=https://" ${api_host} :${api_port} " --insecure-skip-tls-verify=true --kubeconfig=" ${kubeconfig_path} "
261
+ local ca_file=$2
262
+ local client_certificate_file=$3
263
+ local client_key_file=$4
264
+ local api_host=$5
265
+ local api_port=$6
266
+ local client_id=$7
267
+ local token=${8:- }
268
+ kubectl config set-cluster " ${client_id} " --server=https://" ${api_host} :${api_port} " --embed-certs --certificate-authority=" ${ca_file} " --kubeconfig=" ${kubeconfig_path} "
268
269
kubectl config set-credentials " ${client_id} " --token=" ${token} " --client-certificate=" ${client_certificate_file} " --client-key=" ${client_key_file} " --embed-certs=true --kubeconfig=" ${kubeconfig_path} "
269
270
kubectl config set-context " ${client_id} " --cluster=" ${client_id} " --user=" ${client_id} " --kubeconfig=" ${kubeconfig_path} "
270
271
}
You can’t perform that action at this time.
0 commit comments