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
f8047aa6
Commit
f8047aa6
authored
Jul 07, 2015
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update output of kubectl in examples
parent
127fe8d4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
73 deletions
+63
-73
README.md
examples/persistent-volumes/README.md
+20
-32
pod.yaml
examples/persistent-volumes/simpletest/pod.yaml
+1
-1
README.md
examples/phabricator/README.md
+3
-3
README.md
examples/resourcequota/README.md
+33
-31
README.md
examples/spark/README.md
+2
-2
README.md
examples/storm/README.md
+4
-4
No files found.
examples/persistent-volumes/README.md
View file @
f8047aa6
...
@@ -20,21 +20,17 @@ support local storage on the host at this time. There is no guarantee your pod
...
@@ -20,21 +20,17 @@ support local storage on the host at this time. There is no guarantee your pod
```
```
// this will be nginx's webroot
// this will be nginx's webroot
mkdir /tmp/data01
$
mkdir /tmp/data01
echo 'I love Kubernetes storage!' > /tmp/data01/index.html
$
echo 'I love Kubernetes storage!' > /tmp/data01/index.html
```
```
PVs are created by posting them to the API server.
PVs are created by posting them to the API server.
```
```
$ kubectl create -f examples/persistent-volumes/volumes/local-01.yaml
kubectl create -f examples/persistent-volumes/volumes/local-01.yaml
NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON
kubectl get pv
pv0001 type=local 10737418240 RWO Available
NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM
pv0001 map[] 10737418240 RWO Available
```
```
## Requesting storage
## Requesting storage
...
@@ -46,9 +42,9 @@ Claims must be created in the same namespace as the pods that use them.
...
@@ -46,9 +42,9 @@ Claims must be created in the same namespace as the pods that use them.
```
```
kubectl create -f examples/persistent-volumes/claims/claim-01.yaml
$ kubectl create -f examples/persistent-volumes/claims/claim-01.yaml
kubectl get pvc
$ kubectl get pvc
NAME LABELS STATUS VOLUME
NAME LABELS STATUS VOLUME
myclaim-1 map[]
myclaim-1 map[]
...
@@ -56,17 +52,13 @@ myclaim-1 map[]
...
@@ -56,17 +52,13 @@ myclaim-1 map[]
# A background process will attempt to match this claim to a volume.
# A background process will attempt to match this claim to a volume.
# The eventual state of your claim will look something like this:
# The eventual state of your claim will look something like this:
kubectl get pvc
$ kubectl get pvc
NAME LABELS STATUS VOLUME
NAME LABELS STATUS VOLUME
myclaim-1 map[] Bound pv0001
myclaim-1 map[] Bound f5c3a89a-e50a-11e4-972f-80e6500a981e
kubectl get pv
NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM
pv0001 map[] 10737418240 RWO Bound myclaim-1 / 6bef4c40-e50b-11e4-972f-80e6500a981e
$ kubectl get pv
NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON
pv0001 type=local 10737418240 RWO Bound default/myclaim-1
```
```
## Using your claim as a volume
## Using your claim as a volume
...
@@ -74,19 +66,15 @@ pv0001 map[] 10737418240 RWO
...
@@ -74,19 +66,15 @@ pv0001 map[] 10737418240 RWO
Claims are used as volumes in pods. Kubernetes uses the claim to look up its bound PV. The PV is then exposed to the pod.
Claims are used as volumes in pods. Kubernetes uses the claim to look up its bound PV. The PV is then exposed to the pod.
```
```
$ kubectl create -f examples/persistent-volumes/simpletest/pod.yaml
kubectl create -f examples/persistent-volumes/simpletest/pod.yaml
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
kubectl get pods
mypod 1/1 Running 0 1h
POD IP CONTAINER(S) IMAGE(S) HOST LABELS STATUS CREATED
mypod 172.17.0.2 myfrontend nginx 127.0.0.1/127.0.0.1 <none> Running 12 minutes
kubectl create -f examples/persistent-volumes/simpletest/service.json
kubectl get services
NAME LABELS SELECTOR IP PORT(S)
$ kubectl create -f examples/persistent-volumes/simpletest/service.json
$ kubectl get services
NAME LABELS SELECTOR IP(S) PORT(S)
frontendservice <none> name=frontendhttp 10.0.0.241 3000/TCP
frontendservice <none> name=frontendhttp 10.0.0.241 3000/TCP
kubernetes component=apiserver,provider=kubernetes <none> 10.0.0.2 443/TCP
kubernetes component=apiserver,provider=kubernetes <none> 10.0.0.2 443/TCP
...
...
examples/persistent-volumes/simpletest/pod.yaml
View file @
f8047aa6
...
@@ -7,7 +7,7 @@ metadata:
...
@@ -7,7 +7,7 @@ metadata:
spec
:
spec
:
containers
:
containers
:
-
name
:
myfrontend
-
name
:
myfrontend
image
:
dockerfile/
nginx
image
:
nginx
ports
:
ports
:
-
containerPort
:
80
-
containerPort
:
80
name
:
"
http-server"
name
:
"
http-server"
...
...
examples/phabricator/README.md
View file @
f8047aa6
...
@@ -78,8 +78,8 @@ kubectl get pods
...
@@ -78,8 +78,8 @@ kubectl get pods
You'll see a single phabricator pod. It will also display the machine that the pod is running on once it gets placed (may take up to thirty seconds):
You'll see a single phabricator pod. It will also display the machine that the pod is running on once it gets placed (may take up to thirty seconds):
```
```
POD IP CONTAINER(S) IMAGE(S) HOST LABELS STATUS
NAME READY STATUS RESTARTS AGE
phabricator-controller-
02qp4 10.244.1.34 phabricator fgrzadkowski/phabricator kubernetes-minion-2.c.myproject.internal/130.211.141.151 name=phabricator
phabricator-controller-
9vy68 1/1 Running 0 1m
```
```
If you ssh to that machine, you can run
`docker ps`
to see the actual pod:
If you ssh to that machine, you can run
`docker ps`
to see the actual pod:
...
@@ -203,7 +203,7 @@ phabricator
...
@@ -203,7 +203,7 @@ phabricator
To play with the service itself, find the external IP of the load balancer:
To play with the service itself, find the external IP of the load balancer:
```
shell
```
shell
$
kubectl get services
guestbook
-o
template
--template
=
'{{(index .status.loadBalancer.ingress 0).ip
}}'
$
kubectl get services
phabricator
-o
template
--template
=
'{{(index .status.loadBalancer.ingress 0).ip}}{{"\n"
}}'
```
```
and then visit port 80 of that IP address.
and then visit port 80 of that IP address.
...
...
examples/resourcequota/README.md
View file @
f8047aa6
...
@@ -42,17 +42,18 @@ namespace.
...
@@ -42,17 +42,18 @@ namespace.
```
```
$ kubectl describe quota quota --namespace=quota-example
$ kubectl describe quota quota --namespace=quota-example
Name: quota
Name: quota
Resource Used Hard
Namespace: quota-example
-------- ---- ----
Resource Used Hard
cpu 0m 20
-------- ---- ----
memory 0m 1Gi
cpu 0 20
persistentvolumeclaims 0m 10
memory 0 1Gi
pods 0m 10
persistentvolumeclaims 0 10
replicationcontrollers 0m 20
pods 0 10
resourcequotas 1 1
replicationcontrollers 0 20
secrets 1 10
resourcequotas 1 1
services 0m 5
secrets 1 10
services 0 5
```
```
Step 3: Applying default resource limits
Step 3: Applying default resource limits
...
@@ -74,7 +75,7 @@ Now let's look at the pods that were created.
...
@@ -74,7 +75,7 @@ Now let's look at the pods that were created.
```
shell
```
shell
$
kubectl get pods
--namespace
=
quota-example
$
kubectl get pods
--namespace
=
quota-example
POD IP CONTAINER
(
S
)
IMAGE
(
S
)
HOST LABELS STATUS CREATED MESS
AGE
NAME READY STATUS RESTARTS
AGE
```
```
What happened? I have no pods! Let's describe the replication controller to get a view of what is happening.
What happened? I have no pods! Let's describe the replication controller to get a view of what is happening.
...
@@ -101,11 +102,12 @@ So let's set some default limits for the amount of cpu and memory a pod can cons
...
@@ -101,11 +102,12 @@ So let's set some default limits for the amount of cpu and memory a pod can cons
$
kubectl create
-f
limits.yaml
--namespace
=
quota-example
$
kubectl create
-f
limits.yaml
--namespace
=
quota-example
limitranges/limits
limitranges/limits
$
kubectl describe limits limits
--namespace
=
quota-example
$
kubectl describe limits limits
--namespace
=
quota-example
Name: limits
Name: limits
Type Resource Min Max Default
Namespace: quota-example
----
--------
---
---
---
Type Resource Min Max Default
Container cpu - - 100m
----
--------
---
---
---
Container memory - - 512Mi
Container memory - - 512Mi
Container cpu - - 100m
```
```
Now any time a pod is created in this namespace, if it has not specified any resource limits, the default
Now any time a pod is created in this namespace, if it has not specified any resource limits, the default
...
@@ -116,26 +118,26 @@ create its pods.
...
@@ -116,26 +118,26 @@ create its pods.
```
shell
```
shell
$
kubectl get pods
--namespace
=
quota-example
$
kubectl get pods
--namespace
=
quota-example
POD IP CONTAINER
(
S
)
IMAGE
(
S
)
HOST LABELS STATUS CREATED MESSAGE
NAME READY STATUS RESTARTS AGE
nginx-t40zm 10.0.0.2 10.245.1.3/10.245.1.3
run
=
nginx Running 2 minutes
nginx-t9cap 1/1 Running 0 49s
nginx nginx Running 2 minutes
```
```
And if we print out our quota usage in the namespace:
And if we print out our quota usage in the namespace:
```
shell
```
shell
kubectl describe quota quota
--namespace
=
quota-example
kubectl describe quota quota
--namespace
=
quota-example
Name: quota
Name: quota
Resource Used Hard
Namespace: default
--------
----
----
Resource Used Hard
cpu 100m 20
--------
----
----
memory 536870912 1Gi
cpu 100m 20
persistentvolumeclaims 0m 10
memory 536870912 1Gi
pods 1 10
persistentvolumeclaims 0 10
replicationcontrollers 1 20
pods 1 10
resourcequotas 1 1
replicationcontrollers 1 20
secrets 1 10
resourcequotas 1 1
services 0m 5
secrets 1 10
services 0 5
```
```
You can now see the pod that was created is consuming explicit amounts of resources, and the usage is being
You can now see the pod that was created is consuming explicit amounts of resources, and the usage is being
...
...
examples/spark/README.md
View file @
f8047aa6
...
@@ -46,7 +46,7 @@ $ kubectl create -f examples/spark/spark-master-service.json
...
@@ -46,7 +46,7 @@ $ kubectl create -f examples/spark/spark-master-service.json
```
shell
```
shell
$
kubectl get pods
$
kubectl get pods
NAME READY
REASON
RESTARTS AGE
NAME READY
STATUS
RESTARTS AGE
[
...]
[
...]
spark-master 1/1 Running 0 25s
spark-master 1/1 Running 0 25s
...
@@ -97,7 +97,7 @@ $ kubectl create -f examples/spark/spark-worker-controller.json
...
@@ -97,7 +97,7 @@ $ kubectl create -f examples/spark/spark-worker-controller.json
```
shell
```
shell
$
kubectl get pods
$
kubectl get pods
NAME
READY REASON
RESTARTS AGE
NAME
READY STATUS
RESTARTS AGE
[
...]
[
...]
spark-master 1/1 Running 0 14m
spark-master 1/1 Running 0 14m
spark-worker-controller-hifwi 1/1 Running 0 33s
spark-worker-controller-hifwi 1/1 Running 0 33s
...
...
examples/storm/README.md
View file @
f8047aa6
...
@@ -52,15 +52,15 @@ before proceeding.
...
@@ -52,15 +52,15 @@ before proceeding.
```
shell
```
shell
$
kubectl get pods
$
kubectl get pods
POD IP CONTAINER
(
S
)
IMAGE
(
S
)
HOST LABELS STATUS
NAME READY STATUS RESTARTS AGE
zookeeper
192.168.86.4 zookeeper mattf/zookeeper 172.18.145.8/172.18.145.8
name
=
zookeeper Running
zookeeper
1/1 Running 0 43s
```
```
### Check to see if ZooKeeper is accessible
### Check to see if ZooKeeper is accessible
```
shell
```
shell
$
kubectl get services
$
kubectl get services
NAME LABELS SELECTOR IP
PORT
NAME LABELS SELECTOR IP
(
S
)
PORT
(
S
)
kubernetes
component
=
apiserver,provider
=
kubernetes <none> 10.254.0.2 443
kubernetes
component
=
apiserver,provider
=
kubernetes <none> 10.254.0.2 443
zookeeper
name
=
zookeeper
name
=
zookeeper 10.254.139.141 2181
zookeeper
name
=
zookeeper
name
=
zookeeper 10.254.139.141 2181
...
@@ -94,7 +94,7 @@ Ensure that the Nimbus service is running and functional.
...
@@ -94,7 +94,7 @@ Ensure that the Nimbus service is running and functional.
```
shell
```
shell
$
kubectl get services
$
kubectl get services
NAME LABELS SELECTOR IP
PORT
NAME LABELS SELECTOR IP
(
S
)
PORT
(
S
)
kubernetes
component
=
apiserver,provider
=
kubernetes <none> 10.254.0.2 443
kubernetes
component
=
apiserver,provider
=
kubernetes <none> 10.254.0.2 443
zookeeper
name
=
zookeeper
name
=
zookeeper 10.254.139.141 2181
zookeeper
name
=
zookeeper
name
=
zookeeper 10.254.139.141 2181
nimbus
name
=
nimbus
name
=
nimbus 10.254.115.208 6627
nimbus
name
=
nimbus
name
=
nimbus 10.254.115.208 6627
...
...
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