Configure KubeConfig from Script (#24)
* Configure KubeConfig from Script
This commit is contained in:
@@ -11,14 +11,13 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Create the credentials file
|
name: Create the credentials file
|
||||||
command: sh scripts/createCredentials.sh
|
command: sh scripts/createCredentials.sh
|
||||||
- run:
|
|
||||||
name: Get the kube config file
|
|
||||||
command: sh scripts/getKubeConfig.sh
|
|
||||||
- run:
|
- run:
|
||||||
name: Build and deploy connector
|
name: Build and deploy connector
|
||||||
command: sh scripts/envCreation.sh
|
command: sh scripts/envCreation.sh
|
||||||
- run: |
|
- run: |
|
||||||
echo 'export AZURE_AUTH_LOCATION=${outputPathCredsfile}' >> $BASH_ENV
|
echo 'export AZURE_AUTH_LOCATION=${outputPathCredsfile}' >> $BASH_ENV
|
||||||
|
- run: |
|
||||||
|
echo 'export KUBECONFIG=${outputPathKubeConfigFile}' >> $BASH_ENV
|
||||||
- run:
|
- run:
|
||||||
name: Dependencies
|
name: Dependencies
|
||||||
command: go get -v -t -d ./...
|
command: go get -v -t -d ./...
|
||||||
|
|||||||
@@ -14,3 +14,26 @@ cat <<EOF > ${outputPathCredsfile}
|
|||||||
"managementEndpointUrl": "$managementEndpointUrl"
|
"managementEndpointUrl": "$managementEndpointUrl"
|
||||||
}
|
}
|
||||||
EOF
|
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