Deploying a dind cluster on a vm provisioned by vagrant will be
assured of having KUBECONFIG and PATH set correctly in the vm. For
manual dind deployment (e.g. to an arbitrary docker instance), this
change adds an rc file that can be sourced to configure the
environment for accessing the cluster with the openshift cli.
| ... | ... |
@@ -232,6 +232,21 @@ ${DEPLOYED_CONFIG_ROOT}"
|
| 232 | 232 |
${DOCKER_CMD} exec -t "${cid}" systemctl start sshd
|
| 233 | 233 |
fi |
| 234 | 234 |
done |
| 235 |
+ |
|
| 236 |
+ local rc_file="dind-${INSTANCE_PREFIX}.rc"
|
|
| 237 |
+ local admin_config=$(os::provision::get-admin-config ${CONFIG_ROOT})
|
|
| 238 |
+ echo "export KUBECONFIG=${admin_config}
|
|
| 239 |
+export PATH=\$PATH:${ORIGIN_ROOT}/_output/local/bin/linux/amd64" > "${rc_file}"
|
|
| 240 |
+ |
|
| 241 |
+ if [ "${KUBECONFIG:-}" != "${admin_config}" ]; then
|
|
| 242 |
+ echo "" |
|
| 243 |
+ echo "Before invoking the openshift cli, make sure to source the |
|
| 244 |
+cluster's rc file to configure the bash environment: |
|
| 245 |
+ |
|
| 246 |
+ $ . ${rc_file}
|
|
| 247 |
+ $ oc get nodes |
|
| 248 |
+" |
|
| 249 |
+ fi |
|
| 235 | 250 |
} |
| 236 | 251 |
|
| 237 | 252 |
function stop() {
|