Browse code

change OPENSHIFTCONFIG to KUBECONFIG

deads2k authored on 2015/06/12 02:06:18
Showing 16 changed files
... ...
@@ -74,7 +74,7 @@ If it's not running, you will instead see:
74 74
 
75 75
 If it's not running, you can launch it via:
76 76
 
77
-    $ oadm registry --create --credentials="${OPENSHIFTCONFIG}"
77
+    $ oadm registry --create --credentials="${KUBECONFIG}"
78 78
 
79 79
 Probing Containers
80 80
 ------------------
... ...
@@ -32,8 +32,8 @@ Once it is pulled it will start and be visible in the `docker ps` list of contai
32 32
     [vagrant@openshiftdev origin]$ sudo /data/src/github.com/openshift/origin/_output/local/bin/linux/amd64/openshift start &
33 33
 
34 34
     If running in https mode, ensure oc can authenticate to the master
35
-    [vagrant@openshiftdev origin]$ export OPENSHIFTCONFIG=/data/src/github.com/openshift/origin/openshift.local.config/master/admin.kubeconfig
36
-    [vagrant@openshiftdev origin]$ sudo chmod a+r "$OPENSHIFTCONFIG"
35
+    [vagrant@openshiftdev origin]$ export KUBECONFIG=/data/src/github.com/openshift/origin/openshift.local.config/master/admin.kubeconfig
36
+    [vagrant@openshiftdev origin]$ sudo chmod a+r "$KUBECONFIG"
37 37
     [vagrant@openshiftdev origin]$ sudo chmod a+r openshift.local.config/master/openshift-router.kubeconfig
38 38
     [vagrant@openshiftdev origin]$ oadm router --create --credentials="openshift.local.config/master/openshift-router.kubeconfig"
39 39
     [vagrant@openshiftdev origin]$ oc get pods
... ...
@@ -44,7 +44,7 @@ Once it is pulled it will start and be visible in the `docker ps` list of contai
44 44
     $ export OPENSHIFT_DEV_CLUSTER=true
45 45
     $ vagrant up
46 46
     $ vagrant ssh master
47
-    [vagrant@openshift-master ~]$ oadm router --create --credentials="${OPENSHIFTCONFIG}"
47
+    [vagrant@openshift-master ~]$ oadm router --create --credentials="${KUBECONFIG}"
48 48
 
49 49
 
50 50
 
... ...
@@ -33,7 +33,7 @@ items:
33 33
           - name: AUTOLINK_HOOK
34 34
             value: null
35 35
           - name: REQUIRE_GIT_AUTH
36
-          - name: OPENSHIFTCONFIG
36
+          - name: KUBECONFIG
37 37
             value: /var/lib/gitsecrets/admin.kubeconfig
38 38
           image: openshift/origin-gitserver
39 39
           name: gitserver
... ...
@@ -40,8 +40,8 @@ users:
40 40
   <builders>
41 41
     <hudson.tasks.Shell>
42 42
       <command>
43
-export OPENSHIFTCONFIG=.kubeconfig
44
-echo "${KUBECONFIG_CREDENTIALS}" > "${OPENSHIFTCONFIG}"
43
+export KUBECONFIG=.kubeconfig
44
+echo "${KUBECONFIG_CREDENTIALS}" > "${KUBECONFIG}"
45 45
 
46 46
 TEST_ENDPOINT=`oc get services -n test | grep frontend-test | awk '{print $4":"$5}'`
47 47
 
... ...
@@ -173,7 +173,7 @@ This section covers how to perform all the steps of building, deploying, and upd
173 173
 
174 174
         $ oc login --certificate-authority=openshift.local.config/master/ca.crt
175 175
 
176
-       **VAGRANT USERS**: If subsequent commands fail because of a config validation error, log out, unset the $OPENSHIFTCONFIG environment variable (if it is set) and then log in again.
176
+       **VAGRANT USERS**: If subsequent commands fail because of a config validation error, log out, unset the $KUBECONFIG environment variable (if it is set) and then log in again.
177 177
 
178 178
 
179 179
 
... ...
@@ -65,7 +65,7 @@ step #3.
65 65
 
66 66
 ## Deploy the private docker registry
67 67
 
68
-    $ oadm registry --create --credentials="${OPENSHIFTCONFIG}"
68
+    $ oadm registry --create --credentials="${KUBECONFIG}"
69 69
     $ cd examples/sample-app
70 70
 
71 71
 For more information on this step, see [Application Build, Deploy, and Update
... ...
@@ -45,7 +45,7 @@ trap "cleanup" EXIT
45 45
 set -e
46 46
 
47 47
 # Prevent user environment from colliding with the test setup
48
-unset OPENSHIFTCONFIG
48
+unset KUBECONFIG
49 49
 
50 50
 USE_LOCAL_IMAGES=${USE_LOCAL_IMAGES:-true}
51 51
 
... ...
@@ -215,7 +215,7 @@ oc project project-foo
215 215
 oc get services --config="${MASTER_CONFIG_DIR}/admin.kubeconfig"
216 216
 
217 217
 # test config files from env vars
218
-OPENSHIFTCONFIG="${MASTER_CONFIG_DIR}/admin.kubeconfig" oc get services
218
+KUBECONFIG="${MASTER_CONFIG_DIR}/admin.kubeconfig" oc get services
219 219
 
220 220
 # test config files in the home directory
221 221
 mkdir -p ${HOME}/.config/openshift
... ...
@@ -223,9 +223,9 @@ cp ${MASTER_CONFIG_DIR}/admin.kubeconfig ${HOME}/.config/openshift/config
223 223
 oc get services
224 224
 mv ${HOME}/.config/openshift/config ${HOME}/.config/openshift/non-default-config
225 225
 echo "config files: ok"
226
-export OPENSHIFTCONFIG="${HOME}/.config/openshift/non-default-config"
226
+export KUBECONFIG="${HOME}/.config/openshift/non-default-config"
227 227
 
228
-# from this point every command will use config from the OPENSHIFTCONFIG env var
228
+# from this point every command will use config from the KUBECONFIG env var
229 229
 
230 230
 oc get templates
231 231
 oc create -f examples/sample-app/application-template-dockerbuild.json
... ...
@@ -370,7 +370,7 @@ oc create -f test/integration/fixtures/test-image-stream.json
370 370
 # make sure stream.status.dockerImageRepository isn't set (no registry)
371 371
 [ -z "$(oc get imageStreams test -t "{{.status.dockerImageRepository}}")" ]
372 372
 # create the registry
373
-oadm registry --create --credentials="${OPENSHIFTCONFIG}"
373
+oadm registry --create --credentials="${KUBECONFIG}"
374 374
 # make sure stream.status.dockerImageRepository IS set
375 375
 [ -n "$(oc get imageStreams test -t "{{.status.dockerImageRepository}}")" ]
376 376
 # ensure the registry rc has been created
... ...
@@ -645,15 +645,15 @@ echo "new-project: ok"
645 645
 
646 646
 # Test running a router
647 647
 [ ! "$(oadm router --dry-run | grep 'does not exist')" ]
648
-[ "$(oadm router -o yaml --credentials="${OPENSHIFTCONFIG}" | grep 'openshift/origin-haproxy-')" ]
649
-oadm router --create --credentials="${OPENSHIFTCONFIG}"
648
+[ "$(oadm router -o yaml --credentials="${KUBECONFIG}" | grep 'openshift/origin-haproxy-')" ]
649
+oadm router --create --credentials="${KUBECONFIG}"
650 650
 [ "$(oadm router | grep 'service exists')" ]
651 651
 echo "router: ok"
652 652
 
653 653
 # Test running a registry
654 654
 [ ! "$(oadm registry --dry-run | grep 'does not exist')"]
655
-[ "$(oadm registry -o yaml --credentials="${OPENSHIFTCONFIG}" | grep 'openshift/origin-docker-registry')" ]
656
-oadm registry --create --credentials="${OPENSHIFTCONFIG}"
655
+[ "$(oadm registry -o yaml --credentials="${KUBECONFIG}" | grep 'openshift/origin-docker-registry')" ]
656
+oadm registry --create --credentials="${KUBECONFIG}"
657 657
 [ "$(oadm registry | grep 'service exists')" ]
658 658
 echo "registry: ok"
659 659
 
... ...
@@ -247,7 +247,7 @@ export HOME="${FAKE_HOME_DIR}"
247 247
 # This directory must exist so Docker can store credentials in $HOME/.dockercfg
248 248
 mkdir -p ${FAKE_HOME_DIR}
249 249
 
250
-export OPENSHIFTCONFIG="${MASTER_CONFIG_DIR}/admin.kubeconfig"
250
+export KUBECONFIG="${MASTER_CONFIG_DIR}/admin.kubeconfig"
251 251
 CLUSTER_ADMIN_CONTEXT=$(oc config view --flatten -o template -t '{{index . "current-context"}}')
252 252
 
253 253
 if [[ "${API_SCHEME}" == "https" ]]; then
... ...
@@ -256,8 +256,8 @@ if [[ "${API_SCHEME}" == "https" ]]; then
256 256
 	export CURL_KEY="${MASTER_CONFIG_DIR}/admin.key"
257 257
 
258 258
 	# Make oc use ${MASTER_CONFIG_DIR}/admin.kubeconfig, and ignore anything in the running user's $HOME dir
259
-	sudo chmod -R a+rwX "${OPENSHIFTCONFIG}"
260
-	echo "[INFO] To debug: export OPENSHIFTCONFIG=$OPENSHIFTCONFIG"
259
+	sudo chmod -R a+rwX "${KUBECONFIG}"
260
+	echo "[INFO] To debug: export KUBECONFIG=$KUBECONFIG"
261 261
 fi
262 262
 
263 263
 
... ...
@@ -35,7 +35,7 @@ export NODE_CONFIG_DIR="${SERVER_CONFIG_DIR}/node-127.0.0.1"
35 35
 export CURL_CA_BUNDLE="${MASTER_CONFIG_DIR}/ca.crt"
36 36
 export CURL_CERT="${MASTER_CONFIG_DIR}/admin.crt"
37 37
 export CURL_KEY="${MASTER_CONFIG_DIR}/admin.key"
38
-export OPENSHIFTCONFIG="${MASTER_CONFIG_DIR}/admin.kubeconfig"
38
+export KUBECONFIG="${MASTER_CONFIG_DIR}/admin.kubeconfig"
39 39
 export OPENSHIFT_ON_PANIC=crash
40 40
 
41 41
 cleanup() {
... ...
@@ -105,11 +105,11 @@ oadm create-bootstrap-policy-file --filename="${MASTER_CONFIG_DIR}/policy.json"
105 105
 start_docker_registry() {
106 106
   mkdir -p ${BASETMPDIR}/.registry
107 107
   echo "[INFO] Creating Router ..."
108
-  oadm router --create --credentials="${OPENSHIFTCONFIG}" \
108
+  oadm router --create --credentials="${KUBECONFIG}" \
109 109
     --images='openshift/origin-${component}:latest' &>/dev/null
110 110
 
111 111
   echo "[INFO] Creating Registry ..."
112
-  oadm registry --create --credentials="${OPENSHIFTCONFIG}" \
112
+  oadm registry --create --credentials="${KUBECONFIG}" \
113 113
     --mount-host="${BASETMPDIR}/.registry" \
114 114
     --images='openshift/origin-${component}:latest' &>/dev/null
115 115
 }
... ...
@@ -40,7 +40,7 @@ mkdir -p "${SWAGGER_ROOT_DIR}"
40 40
 SWAGGER_API_PATH="${HOST}/swaggerapi/"
41 41
 
42 42
 # Prevent user environment from colliding with the test setup
43
-unset OPENSHIFTCONFIG
43
+unset KUBECONFIG
44 44
 
45 45
 # set path so OpenShift is available
46 46
 GO_OUT="${OS_ROOT}/_output/local/go/bin"
... ...
@@ -27,12 +27,12 @@ Pre-requisites/Prep Time
27 27
    with two (_2_) replicas.
28 28
 
29 29
         $ vagrant ssh minion-1  # (or master or minion-2).
30
-        #  Ensure OPENSHIFTCONFIG is set or else set it.
31
-        [ -n "$OPENSHIFTCONFIG" ] ||  \
32
-           export OPENSHIFTCONFIG=/openshift.local.config/master/admin.kubeconfig
30
+        #  Ensure KUBECONFIG is set or else set it.
31
+        [ -n "$KUBECONFIG" ] ||  \
32
+           export KUBECONFIG=/openshift.local.config/master/admin.kubeconfig
33 33
         #  openshift kube get dc,rc,pods,se,mi,routes
34 34
         oadm router arparp --create --replicas=2  \
35
-                                   --credentials="${OPENSHIFTCONFIG}"
35
+                                   --credentials="${KUBECONFIG}"
36 36
 
37 37
 
38 38
 3. Wait for the Router pods to get into running state (I'm just sitting
... ...
@@ -19,6 +19,6 @@ RUN ln -s /usr/bin/openshift /usr/bin/oc && \
19 19
     ln -s /usr/bin/openshift /usr/bin/openshift-router
20 20
 
21 21
 ENV HOME /root
22
-ENV OPENSHIFTCONFIG /var/lib/openshift/openshift.local.config/master/admin.kubeconfig
22
+ENV KUBECONFIG /var/lib/openshift/openshift.local.config/master/admin.kubeconfig
23 23
 WORKDIR /var/lib/openshift
24 24
 ENTRYPOINT ["/usr/bin/openshift"]
... ...
@@ -14,7 +14,7 @@ import (
14 14
 )
15 15
 
16 16
 const (
17
-	OpenShiftConfigPathEnvVar      = "OPENSHIFTCONFIG"
17
+	OpenShiftConfigPathEnvVar      = "KUBECONFIG"
18 18
 	OpenShiftConfigFlagName        = "config"
19 19
 	OpenShiftConfigHomeDir         = ".config/openshift"
20 20
 	OpenShiftConfigHomeFileName    = "config"
... ...
@@ -26,7 +26,7 @@ var RecommendedHomeFile = path.Join(os.Getenv("HOME"), OpenShiftConfigHomeDirFil
26 26
 
27 27
 // NewOpenShiftClientConfigLoadingRules returns file priority loading rules for OpenShift.
28 28
 // 1. --config value
29
-// 2. if OPENSHIFTCONFIG env var has a value, use it. Otherwise, ~/.config/openshift/config file
29
+// 2. if KUBECONFIG env var has a value, use it. Otherwise, ~/.config/openshift/config file
30 30
 func NewOpenShiftClientConfigLoadingRules() *clientcmd.ClientConfigLoadingRules {
31 31
 	chain := []string{}
32 32
 	migrationRules := map[string]string{}
... ...
@@ -16,7 +16,7 @@ const (
16 16
 	certificateAuthorityUnknownMsg = "The server uses a certificate signed by unknown authority. You may need to use the --certificate-authority flag to provide the path to a certificate file for the certificate authority, or --insecure-skip-tls-verify to bypass the certificate check and use insecure connections."
17 17
 	notConfiguredMsg               = `OpenShift is not configured. You need to run the login command in order to create a default config for your server and credentials:
18 18
   oc login
19
-You can also run this command again providing the path to a config file directly, either through the --config flag of the OPENSHIFTCONFIG environment variable.
19
+You can also run this command again providing the path to a config file directly, either through the --config flag of the KUBECONFIG environment variable.
20 20
 `
21 21
 )
22 22
 
... ...
@@ -105,6 +105,6 @@ if [ "${OPENSHIFT_SDN}" != "ovs-gre" ]; then
105 105
   $(dirname $0)/provision-master-sdn.sh $@
106 106
 fi
107 107
 
108
-# Set up the OPENSHIFTCONFIG environment variable for use by oc
109
-echo 'export OPENSHIFTCONFIG=/vagrant/openshift.local.config/master/admin.kubeconfig' >> /root/.bash_profile
110
-echo 'export OPENSHIFTCONFIG=/vagrant/openshift.local.config/master/admin.kubeconfig' >> /home/vagrant/.bash_profile
108
+# Set up the KUBECONFIG environment variable for use by oc
109
+echo 'export KUBECONFIG=/vagrant/openshift.local.config/master/admin.kubeconfig' >> /root/.bash_profile
110
+echo 'export KUBECONFIG=/vagrant/openshift.local.config/master/admin.kubeconfig' >> /home/vagrant/.bash_profile
... ...
@@ -79,9 +79,9 @@ systemctl daemon-reload
79 79
 systemctl enable openshift-node.service
80 80
 systemctl start openshift-node.service
81 81
 
82
-# Set up the OPENSHIFTCONFIG environment variable for use by the client
83
-echo 'export OPENSHIFTCONFIG=/openshift.local.config/master/admin.kubeconfig' >> /root/.bash_profile
84
-echo 'export OPENSHIFTCONFIG=/openshift.local.config/master/admin.kubeconfig' >> /home/vagrant/.bash_profile
82
+# Set up the KUBECONFIG environment variable for use by the client
83
+echo 'export KUBECONFIG=/openshift.local.config/master/admin.kubeconfig' >> /root/.bash_profile
84
+echo 'export KUBECONFIG=/openshift.local.config/master/admin.kubeconfig' >> /home/vagrant/.bash_profile
85 85
 
86 86
 # Register with the master
87 87
 #curl -X POST -H 'Accept: application/json' -d "{\"kind\":\"Minion\", \"id\":"${MINION_IP}", \"apiVersion\":\"v1beta1\", \"hostIP\":"${MINION_IP}" }" http://${MASTER_IP}:8080/api/v1beta1/minions