parent 7f92375a
...@@ -8,8 +8,15 @@ export CI_REGISTRY_TAG="$CI_BUILD_REF_NAME" ...@@ -8,8 +8,15 @@ export CI_REGISTRY_TAG="$CI_BUILD_REF_NAME"
create_kubeconfig() { create_kubeconfig() {
echo "Generating kubeconfig..." echo "Generating kubeconfig..."
export KUBECONFIG="$(pwd)/kubeconfig" export KUBECONFIG="$(pwd)/kubeconfig"
kubectl config set-cluster gitlab-deploy --server="$KUBE_URL" export KUBE_CLUSTER_OPTIONS=
kubectl config set-credentials gitlab-deploy --token="$KUBE_TOKEN" if [[ -n "$KUBE_CA_PEM" ]]; then
cat "$KUBE_CA_PEM" > "$(pwd)/"
export KUBE_CLUSTER_OPTIONS=--certificate-authority=KUBE_CA_PEM
kubectl config set-cluster gitlab-deploy --server="$KUBE_URL" \
kubectl config set-credentials gitlab-deploy --token="$KUBE_TOKEN" \
kubectl config set-context gitlab-deploy \ kubectl config set-context gitlab-deploy \
--cluster=gitlab-deploy --user=gitlab-deploy \ --cluster=gitlab-deploy --user=gitlab-deploy \
--namespace="$KUBE_NAMESPACE" --namespace="$KUBE_NAMESPACE"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment