Configure KubeConfig from Script (#24)
* Configure KubeConfig from Script
This commit is contained in:
@@ -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 ./...
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user