mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
Improve markdown highlighting in vagrant getting started guide.
This commit is contained in:
parent
38c6a23eb2
commit
a6e4d317d2
@ -117,8 +117,8 @@ The master node instantiates the Kubernetes master components as pods on the mac
|
|||||||
|
|
||||||
To view the service status and/or logs on the kubernetes-master:
|
To view the service status and/or logs on the kubernetes-master:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
vagrant ssh master
|
[vagrant@kubernetes-master ~] $ vagrant ssh master
|
||||||
[vagrant@kubernetes-master ~] $ sudo su
|
[vagrant@kubernetes-master ~] $ sudo su
|
||||||
|
|
||||||
[root@kubernetes-master ~] $ systemctl status kubelet
|
[root@kubernetes-master ~] $ systemctl status kubelet
|
||||||
@ -134,8 +134,8 @@ vagrant ssh master
|
|||||||
|
|
||||||
To view the services on any of the nodes:
|
To view the services on any of the nodes:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
vagrant ssh minion-1
|
[vagrant@kubernetes-master ~] $ vagrant ssh minion-1
|
||||||
[vagrant@kubernetes-master ~] $ sudo su
|
[vagrant@kubernetes-master ~] $ sudo su
|
||||||
|
|
||||||
[root@kubernetes-master ~] $ systemctl status kubelet
|
[root@kubernetes-master ~] $ systemctl status kubelet
|
||||||
@ -172,7 +172,7 @@ Once your Vagrant machines are up and provisioned, the first thing to do is to c
|
|||||||
|
|
||||||
You may need to build the binaries first, you can do this with ```make```
|
You may need to build the binaries first, you can do this with ```make```
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ ./cluster/kubectl.sh get nodes
|
$ ./cluster/kubectl.sh get nodes
|
||||||
|
|
||||||
NAME LABELS
|
NAME LABELS
|
||||||
@ -187,6 +187,9 @@ When using the vagrant provider in Kubernetes, the `cluster/kubectl.sh` script w
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
cat ~/.kubernetes_vagrant_auth
|
cat ~/.kubernetes_vagrant_auth
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{ "User": "vagrant",
|
{ "User": "vagrant",
|
||||||
"Password": "vagrant",
|
"Password": "vagrant",
|
||||||
"CAFile": "/home/k8s_user/.kubernetes.vagrant.ca.crt",
|
"CAFile": "/home/k8s_user/.kubernetes.vagrant.ca.crt",
|
||||||
@ -205,7 +208,7 @@ You should now be set to use the `cluster/kubectl.sh` script. For example try to
|
|||||||
|
|
||||||
Your cluster is running, you can list the nodes in your cluster:
|
Your cluster is running, you can list the nodes in your cluster:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ ./cluster/kubectl.sh get nodes
|
$ ./cluster/kubectl.sh get nodes
|
||||||
|
|
||||||
NAME LABELS
|
NAME LABELS
|
||||||
@ -219,7 +222,7 @@ Now start running some containers!
|
|||||||
You can now use any of the `cluster/kube-*.sh` commands to interact with your VM machines.
|
You can now use any of the `cluster/kube-*.sh` commands to interact with your VM machines.
|
||||||
Before starting a container there will be no pods, services and replication controllers.
|
Before starting a container there will be no pods, services and replication controllers.
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ ./cluster/kubectl.sh get pods
|
$ ./cluster/kubectl.sh get pods
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
|
|
||||||
@ -232,13 +235,13 @@ CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
|
|||||||
|
|
||||||
Start a container running nginx with a replication controller and three replicas
|
Start a container running nginx with a replication controller and three replicas
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ ./cluster/kubectl.sh run my-nginx --image=nginx --replicas=3 --port=80
|
$ ./cluster/kubectl.sh run my-nginx --image=nginx --replicas=3 --port=80
|
||||||
```
|
```
|
||||||
|
|
||||||
When listing the pods, you will see that three containers have been started and are in Waiting state:
|
When listing the pods, you will see that three containers have been started and are in Waiting state:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ ./cluster/kubectl.sh get pods
|
$ ./cluster/kubectl.sh get pods
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
my-nginx-5kq0g 0/1 Pending 0 10s
|
my-nginx-5kq0g 0/1 Pending 0 10s
|
||||||
@ -248,7 +251,7 @@ my-nginx-xql4j 0/1 Pending 0 10s
|
|||||||
|
|
||||||
You need to wait for the provisioning to complete, you can monitor the nodes by doing:
|
You need to wait for the provisioning to complete, you can monitor the nodes by doing:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ vagrant ssh minion-1 -c 'sudo docker images'
|
$ vagrant ssh minion-1 -c 'sudo docker images'
|
||||||
kubernetes-minion-1:
|
kubernetes-minion-1:
|
||||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||||
@ -259,7 +262,7 @@ kubernetes-minion-1:
|
|||||||
|
|
||||||
Once the docker image for nginx has been downloaded, the container will start and you can list it:
|
Once the docker image for nginx has been downloaded, the container will start and you can list it:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ vagrant ssh minion-1 -c 'sudo docker ps'
|
$ vagrant ssh minion-1 -c 'sudo docker ps'
|
||||||
kubernetes-minion-1:
|
kubernetes-minion-1:
|
||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||||
@ -271,7 +274,7 @@ kubernetes-minion-1:
|
|||||||
|
|
||||||
Going back to listing the pods, services and replicationcontrollers, you now have:
|
Going back to listing the pods, services and replicationcontrollers, you now have:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ ./cluster/kubectl.sh get pods
|
$ ./cluster/kubectl.sh get pods
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
my-nginx-5kq0g 1/1 Running 0 1m
|
my-nginx-5kq0g 1/1 Running 0 1m
|
||||||
@ -290,7 +293,7 @@ We did not start any services, hence there are none listed. But we see three rep
|
|||||||
Check the [guestbook](../../examples/guestbook/README.md) application to learn how to create a service.
|
Check the [guestbook](../../examples/guestbook/README.md) application to learn how to create a service.
|
||||||
You can already play with scaling the replicas with:
|
You can already play with scaling the replicas with:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ ./cluster/kubectl.sh scale rc my-nginx --replicas=2
|
$ ./cluster/kubectl.sh scale rc my-nginx --replicas=2
|
||||||
$ ./cluster/kubectl.sh get pods
|
$ ./cluster/kubectl.sh get pods
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
@ -325,6 +328,9 @@ After using kubectl.sh make sure that the correct credentials are set:
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
cat ~/.kubernetes_vagrant_auth
|
cat ~/.kubernetes_vagrant_auth
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"User": "vagrant",
|
"User": "vagrant",
|
||||||
"Password": "vagrant"
|
"Password": "vagrant"
|
||||||
|
Loading…
Reference in New Issue
Block a user