Skip to content

Commit

Permalink
part of c9
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Xiao <[email protected]>
  • Loading branch information
xiaopeng163 committed Mar 11, 2018
1 parent e149328 commit 606e681
Show file tree
Hide file tree
Showing 124 changed files with 4,520 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Vagrant下载 https://www.vagrantup.com/downloads.html

Virtualbox 5.1下载 https://www.virtualbox.org/wiki/Download_Old_Builds_5_1

Docker国内源安装 https://get.daocloud.io/#install-docker

Docker官方网站 https://www.docker.com/

Docker官方文档中心 https://docs.docker.com/
Expand Down
Empty file removed chapter9/Vagrantfile
Empty file.
Binary file added chapter9/gif/k8s-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions chapter9/labs/deployment/deployment_nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.12.2
ports:
- containerPort: 80
9 changes: 9 additions & 0 deletions chapter9/labs/pod-basic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Pod 基础

```
$ kubectl get pods # 获取所有正在运行的POD
$ kubectl get pods -o wide # 获取pod的更多信息,比如在哪台k8s机器上
$ kubectl describe pod <pod> #获取一个POD的详细信息
$ kubectl exec <pod> <cmd> #在pod里的container里执行一个命令,如果这个pod有多个container,默认会在第一个里执行,或者通过-c去指定哪个
```
11 changes: 11 additions & 0 deletions chapter9/labs/pod-basic/pod_busybox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Pod
metadata:
name: busybox
labels:
app: busybox
spec:
containers:
- name: busybox
image: busybox

12 changes: 12 additions & 0 deletions chapter9/labs/pod-basic/pod_nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
19 changes: 19 additions & 0 deletions chapter9/labs/replicas-set/rc_nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx
spec:
replicas: 3
selector:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
22 changes: 22 additions & 0 deletions chapter9/labs/replicas-set/rs_nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: nginx
labels:
tier: frontend
spec:
replicas: 3
selector:
matchLabels:
tier: frontend
template:
metadata:
name: nginx
labels:
tier: frontend
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
13 changes: 13 additions & 0 deletions chapter9/labs/services/pod_busybox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Pod
metadata:
name: busybox-pod
labels:
app: busybox
spec:
containers:
- name: busybox-container
image: busybox
command:
- sleep
- "360000"
13 changes: 13 additions & 0 deletions chapter9/labs/services/pod_nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx-container
image: nginx
ports:
- name: nginx-port
containerPort: 80
13 changes: 13 additions & 0 deletions chapter9/labs/services/service_nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
ports:
- port: 8080
nodePort: 8080
targetPort: nginx-port
protocol: TCP
selector:
app: nginx
type: NodePort
1 change: 1 addition & 0 deletions chapter9/tectonic-sandbox-1.7.5-tectonic.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please follow the instructions for setting up Tectonic Sandbox at https://coreos.com/tectonic/sandbox
Loading

0 comments on commit 606e681

Please sign in to comment.