mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 13:14:05 +00:00
Replace ``shell with
``sh
This commit is contained in:
@@ -51,7 +51,7 @@ OpenShift Origin creates privileged containers when running Docker builds during
|
||||
If you are using a Salt based KUBERNETES_PROVIDER (**gce**, **vagrant**, **aws**), you should enable the
|
||||
ability to create privileged containers via the API.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
$ cd kubernetes
|
||||
$ vi cluster/saltbase/pillar/privilege.sls
|
||||
|
||||
@@ -61,14 +61,14 @@ allow_privileged: true
|
||||
|
||||
Now spin up a cluster using your preferred KUBERNETES_PROVIDER
|
||||
|
||||
```shell
|
||||
```sh
|
||||
$ export KUBERNETES_PROVIDER=gce
|
||||
$ cluster/kube-up.sh
|
||||
```
|
||||
|
||||
Next, let's setup some variables, and create a local folder that will hold generated configuration files.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
$ export OPENSHIFT_EXAMPLE=$(pwd)/examples/openshift-origin
|
||||
$ export OPENSHIFT_CONFIG=${OPENSHIFT_EXAMPLE}/config
|
||||
$ mkdir ${OPENSHIFT_CONFIG}
|
||||
@@ -94,7 +94,7 @@ An external load balancer is needed to route traffic to our OpenShift master ser
|
||||
Kubernetes cluster.
|
||||
|
||||
|
||||
```shell
|
||||
```sh
|
||||
$ cluster/kubectl.sh create -f $OPENSHIFT_EXAMPLE/openshift-service.yaml
|
||||
```
|
||||
|
||||
@@ -107,7 +107,7 @@ build default certificates.
|
||||
|
||||
Grab the public IP address of the service we previously created.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
$ export PUBLIC_IP=$(cluster/kubectl.sh get services openshift --template="{{ index .status.loadBalancer.ingress 0 \"ip\" }}")
|
||||
$ echo $PUBLIC_IP
|
||||
```
|
||||
@@ -116,7 +116,7 @@ Ensure you have a valid PUBLIC_IP address before continuing in the example.
|
||||
|
||||
We now need to run a command on your host to generate a proper OpenShift configuration. To do this, we will volume mount the configuration directory that holds your Kubernetes kubeconfig file from the prior step.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
docker run --privileged -v ${OPENSHIFT_CONFIG}:/config openshift/origin start master --write-config=/config --kubeconfig='/config/kubeconfig' --master='https://localhost:8443' --public-master='https://${PUBLIC_IP}:8443'
|
||||
```
|
||||
|
||||
@@ -136,13 +136,13 @@ $ sudo -E chown -R ${USER} ${OPENSHIFT_CONFIG}
|
||||
|
||||
Then run the following command to collapse them into a Kubernetes secret.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
docker run -i -t --privileged -e="OPENSHIFTCONFIG=/config/admin.kubeconfig" -v ${OPENSHIFT_CONFIG}:/config openshift/origin ex bundle-secret openshift-config -f /config &> ${OPENSHIFT_EXAMPLE}/secret.json
|
||||
```
|
||||
|
||||
Now, lets create the secret in your Kubernetes cluster.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
$ cluster/kubectl.sh create -f ${OPENSHIFT_EXAMPLE}/secret.json
|
||||
```
|
||||
|
||||
@@ -155,13 +155,13 @@ We are now ready to deploy OpenShift.
|
||||
We will deploy a pod that runs the OpenShift master. The OpenShift master will delegate to the underlying Kubernetes
|
||||
system to manage Kubernetes specific resources. For the sake of simplicity, the OpenShift master will run with an embedded etcd to hold OpenShift specific content. This demonstration will evolve in the future to show how to run etcd in a pod so that content is not destroyed if the OpenShift master fails.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
$ cluster/kubectl.sh create -f ${OPENSHIFT_EXAMPLE}/openshift-controller.yaml
|
||||
```
|
||||
|
||||
You should now get a pod provisioned whose name begins with openshift.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
$ cluster/kubectl.sh get pods | grep openshift
|
||||
$ cluster/kubectl.sh log openshift-t7147 origin
|
||||
Running: cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/amd64/kubectl logs openshift-t7t47 origin
|
||||
@@ -171,7 +171,7 @@ Running: cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/linux/am
|
||||
|
||||
Depending upon your cloud provider, you may need to open up an external firewall rule for tcp:8443. For GCE, you can run the following:
|
||||
|
||||
```shell
|
||||
```sh
|
||||
gcloud compute --project "your-project" firewall-rules create "origin" --allow tcp:8443 --network "your-network" --source-ranges "0.0.0.0/0"
|
||||
```
|
||||
|
||||
@@ -181,7 +181,7 @@ Open a browser and visit the OpenShift master public address reported in your lo
|
||||
|
||||
You can use the CLI commands by running the following:
|
||||
|
||||
```shell
|
||||
```sh
|
||||
$ docker run --privileged --entrypoint="/usr/bin/bash" -it -e="OPENSHIFTCONFIG=/config/admin.kubeconfig" -v ${OPENSHIFT_CONFIG}:/config openshift/origin
|
||||
$ osc config use-context public-default
|
||||
$ osc --help
|
||||
|
Reference in New Issue
Block a user