Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
049c989a
Commit
049c989a
authored
Jul 07, 2015
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update kubectl get command in docs/devel/
parent
f7e1a004
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
34 deletions
+36
-34
vagrant.md
docs/devel/developer-guides/vagrant.md
+36
-34
No files found.
docs/devel/developer-guides/vagrant.md
View file @
049c989a
...
...
@@ -36,14 +36,14 @@ Vagrant will provision each machine in the cluster with all the necessary compon
By default, each VM in the cluster is running Fedora, and all of the Kubernetes services are installed into systemd.
To access the master or any
minion
:
To access the master or any
node
:
```
sh
vagrant ssh master
vagrant ssh minion-1
```
If you are running more than one
minion
, you can access the others by:
If you are running more than one
nodes
, you can access the others by:
```
sh
vagrant ssh minion-2
...
...
@@ -97,12 +97,12 @@ 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```
```
sh
$
./cluster/kubectl.sh get
minion
s
$
./cluster/kubectl.sh get
node
s
NAME
LABEL
S
10.245.1.4 <none>
10.245.1.5 <none>
10.245.1.3 <none>
NAME
LABELS STATU
S
kubernetes-minion-0whl kubernetes.io/hostname
=
kubernetes-minion-0whl Ready
kubernetes-minion-4jdf kubernetes.io/hostname
=
kubernetes-minion-4jdf Ready
kubernetes-minion-epbe kubernetes.io/hostname
=
kubernetes-minion-epbe Ready
```
### Interacting with your Kubernetes cluster with the `kube-*` scripts.
...
...
@@ -153,23 +153,23 @@ cat ~/.kubernetes_vagrant_auth
}
```
You should now be set to use the
`cluster/kubectl.sh`
script. For example try to list the
minion
s that you have started with:
You should now be set to use the
`cluster/kubectl.sh`
script. For example try to list the
node
s that you have started with:
```
sh
./cluster/kubectl.sh get
minion
s
./cluster/kubectl.sh get
node
s
```
### Running containers
Your cluster is running, you can list the
minion
s in your cluster:
Your cluster is running, you can list the
node
s in your cluster:
```
sh
$
./cluster/kubectl.sh get
minion
s
$
./cluster/kubectl.sh get
node
s
NAME
LABEL
S
10.245.2.4 <none>
10.245.2.3 <none>
10.245.2.2 <none>
NAME
LABELS STATU
S
kubernetes-minion-0whl kubernetes.io/hostname
=
kubernetes-minion-0whl Ready
kubernetes-minion-4jdf kubernetes.io/hostname
=
kubernetes-minion-4jdf Ready
kubernetes-minion-epbe kubernetes.io/hostname
=
kubernetes-minion-epbe Ready
```
Now start running some containers!
...
...
@@ -179,29 +179,31 @@ Before starting a container there will be no pods, services and replication cont
```
$ cluster/kubectl.sh get pods
NAME
IMAGE(S) HOST LABELS STATUS
NAME
READY STATUS RESTARTS AGE
$ cluster/kubectl.sh get services
NAME
LABELS SELECTOR IP PORT
NAME
LABELS SELECTOR IP(S) PORT(S)
$ cluster/kubectl.sh get r
eplicationcontrollers
NAME IMAGE(S SELECTOR
REPLICAS
$ cluster/kubectl.sh get r
c
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR
REPLICAS
```
Start a container running nginx with a replication controller and three replicas
```
$ cluster/kubectl.sh run my-nginx --image=nginx --replicas=3 --port=80
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLICAS
my-nginx my-nginx nginx run=my-nginx 3
```
When listing the pods, you will see that three containers have been started and are in Waiting state:
```
$ cluster/kubectl.sh get pods
NAME
IMAGE(S) HOST LABELS STATUS
781191ff-3ffe-11e4-9036-0800279696e1 nginx 10.245.2.4/10.245.2.4 name=myNginx Waiting
7813c8bd-3ffe-11e4-9036-0800279696e1 nginx 10.245.2.2/10.245.2.2 name=myNginx Waiting
78140853-3ffe-11e4-9036-0800279696e1 nginx 10.245.2.3/10.245.2.3 name=myNginx Waiting
NAME
READY STATUS RESTARTS AGE
my-nginx-389da 1/1 Waiting 0 33s
my-nginx-kqdjk 1/1 Waiting 0 33s
my-nginx-nyj3x 1/1 Waiting 0 33s
```
You need to wait for the provisioning to complete, you can monitor the minions by doing:
...
...
@@ -228,17 +230,17 @@ Going back to listing the pods, services and replicationcontrollers, you now hav
```
$ cluster/kubectl.sh get pods
NAME
IMAGE(S) HOST LABELS STATUS
781191ff-3ffe-11e4-9036-0800279696e1 nginx 10.245.2.4/10.245.2.4 name=myNginx Running
7813c8bd-3ffe-11e4-9036-0800279696e1 nginx 10.245.2.2/10.245.2.2 name=myNginx Running
78140853-3ffe-11e4-9036-0800279696e1 nginx 10.245.2.3/10.245.2.3 name=myNginx Running
NAME
READY STATUS RESTARTS AGE
my-nginx-389da 1/1 Running 0 33s
my-nginx-kqdjk 1/1 Running 0 33s
my-nginx-nyj3x 1/1 Running 0 33s
$ cluster/kubectl.sh get services
NAME LABELS SELECTOR IP
PORT
NAME LABELS SELECTOR IP
(S) PORT(S)
$ cluster/kubectl.sh get r
eplicationcontrollers
NAME
IMAGE(S
SELECTOR REPLICAS
my
Nginx nginx name
=my-nginx 3
$ cluster/kubectl.sh get r
c
NAME
IMAGE(S)
SELECTOR REPLICAS
my
-nginx nginx run
=my-nginx 3
```
We did not start any services, hence there are none listed. But we see three replicas displayed properly.
...
...
@@ -248,9 +250,9 @@ You can already play with scaling the replicas with:
```
sh
$
./cluster/kubectl.sh scale rc my-nginx
--replicas
=
2
$
./cluster/kubectl.sh get pods
NAME
IMAGE
(
S
)
HOST LABELS STATUS
7813c8bd-3ffe-11e4-9036-0800279696e1 nginx 10.245.2.2/10.245.2.2
name
=
myNginx Running
78140853-3ffe-11e4-9036-0800279696e1 nginx 10.245.2.3/10.245.2.3
name
=
myNginx Running
NAME
READY STATUS RESTARTS AGE
my-nginx-kqdjk 1/1 Running 0 13m
my-nginx-nyj3x 1/1 Running 0 13m
```
Congratulations!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment