Configure KubeConfig from Script (#24)

* Configure KubeConfig from Script
This commit is contained in:
Robbie Zhang
2017-12-14 20:32:04 +00:00
committed by GitHub
parent 40128c288b
commit 0c10accf41
2 changed files with 25 additions and 3 deletions

View File

@@ -11,14 +11,13 @@ jobs:
- run:
name: Create the credentials file
command: sh scripts/createCredentials.sh
- run:
name: Get the kube config file
command: sh scripts/getKubeConfig.sh
- run:
name: Build and deploy connector
command: sh scripts/envCreation.sh
- run: |
echo 'export AZURE_AUTH_LOCATION=${outputPathCredsfile}' >> $BASH_ENV
- run: |
echo 'export KUBECONFIG=${outputPathKubeConfigFile}' >> $BASH_ENV
- run:
name: Dependencies
command: go get -v -t -d ./...

View File

@@ -13,4 +13,27 @@ cat <<EOF > ${outputPathCredsfile}
"galleryEndpointUrl": "$galleryEndpointUrl",
"managementEndpointUrl": "$managementEndpointUrl"
}
EOF
# This will build the kubeConfig during the CI
cat <<EOF > ${outputPathKubeConfigFile}
---
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: "$kubeConfigCertificateAuthorityData"
server: $kubeConfigServer
name: "aci-connector-k8s"
contexts:
- context:
cluster: "aci-connector-k8s"
user: "aci-connector-k8s-admin"
name: "aci-connector-k8s"
current-context: "aci-connector-k8s"
kind: Config
users:
- name: "aci-connector-k8s-admin"
user:
client-certificate-data: "$kubeConfigClientCertificateData"
client-key-data: "$kubeConfigClientKeyData"
EOF