Skip to content

Commit eee9ba2

Browse files
committed
2 parents 3248779 + cda1ce9 commit eee9ba2

File tree

11 files changed

+1211
-4
lines changed

11 files changed

+1211
-4
lines changed

README-cn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Vagrant 2.0+
1313
- Virtualbox 5.0 +
1414
- 提前下载kubernetes1.9.1以上版本的release压缩包
15+
- Mac/Linux,**不支持Windows**
1516

1617
## 集群
1718

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ The container network range is `170.33.0.0/16` owned by flanneld with `host-gw`
3131
### Prerequisite
3232

3333
* Host server with 8G+ mem(More is better), 60G disk, 8 core cpu at lease
34-
* vagrant 2.0+
35-
* virtualbox 5.0+
36-
* Maybe need to access the internet through GFW to download the kubernetes files
34+
* Vagrant 2.0+
35+
* Virtualbox 5.0+
36+
* Across GFW to download the kubernetes files (For China users)
37+
* MacOS/Linux (**Windows is not supported**)
3738

38-
### Support Addon
39+
### Support Addons
3940

4041
**Required**
4142

addon/jenkins/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM jenkins/jenkins:lts
2+
MAINTAINER Jimmy Song <rootsongjc@gmail.com>
3+
EXPOSE 8080 50000
4+
USER root
5+
# Install prerequisites for Docker
6+
RUN apt-get update && apt-get install -y sudo maven iptables libsystemd-journal0 init-system-helpers libapparmor1 libltdl7 libseccomp2 libdevmapper1.02.1 && rm -rf /var/lib/apt/lists/*
7+
ENV DOCKER_VERSION=docker-ce_17.03.0~ce-0~ubuntu-trusty_amd64.deb
8+
ENV KUBERNETES_VERSION=v1.9.1
9+
# Set up Docker
10+
RUN wget https://download.docker.com/linux/ubuntu/dists/trusty/pool/stable/amd64/$DOCKER_VERSION
11+
RUN dpkg -i $DOCKER_VERSION
12+
# Set up Kubernetes
13+
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/amd64/kubectl
14+
RUN chmod +x ./kubectl
15+
RUN mv ./kubectl /usr/local/bin/kubectl
16+
# Configure access to the Kubernetes Cluster
17+
ADD ../../conf/config ~/.kube
18+
ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"]

addon/rook/mysql.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: wordpress-mysql
5+
labels:
6+
app: wordpress
7+
spec:
8+
ports:
9+
- port: 3306
10+
selector:
11+
app: wordpress
12+
tier: mysql
13+
clusterIP: None
14+
---
15+
apiVersion: v1
16+
kind: PersistentVolumeClaim
17+
metadata:
18+
name: mysql-pv-claim
19+
labels:
20+
app: wordpress
21+
spec:
22+
storageClassName: rook-block
23+
accessModes:
24+
- ReadWriteOnce
25+
resources:
26+
requests:
27+
storage: 2Gi
28+
---
29+
apiVersion: apps/v1beta1
30+
kind: Deployment
31+
metadata:
32+
name: wordpress-mysql
33+
labels:
34+
app: wordpress
35+
spec:
36+
strategy:
37+
type: Recreate
38+
template:
39+
metadata:
40+
labels:
41+
app: wordpress
42+
tier: mysql
43+
spec:
44+
containers:
45+
- image: mysql:5.6
46+
name: mysql
47+
env:
48+
- name: MYSQL_ROOT_PASSWORD
49+
value: changeme
50+
ports:
51+
- containerPort: 3306
52+
name: mysql
53+
volumeMounts:
54+
- name: mysql-persistent-storage
55+
mountPath: /var/lib/mysql
56+
volumes:
57+
- name: mysql-persistent-storage
58+
persistentVolumeClaim:
59+
claimName: mysql-pv-claim
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
kind: ClusterRoleBinding
2+
apiVersion: rbac.authorization.k8s.io/v1beta1
3+
metadata:
4+
name: rookagent-clusterrolebinding
5+
subjects:
6+
- kind: ServiceAccount
7+
name: rook-agent
8+
namespace: rook-system
9+
roleRef:
10+
kind: ClusterRole
11+
name: cluster-admin
12+
apiGroup: ""

addon/rook/rook-cluster.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: rook
5+
---
6+
apiVersion: rook.io/v1alpha1
7+
kind: Cluster
8+
metadata:
9+
name: rook
10+
namespace: rook
11+
spec:
12+
versionTag: v0.6.2
13+
dataDirHostPath: /var/lib/rook
14+
storage:
15+
useAllNodes: true
16+
useAllDevices: false
17+
storeConfig:
18+
storeType: bluestore
19+
databaseSizeMB: 512
20+
journalSizeMB: 512

addon/rook/rook-operator.yaml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: rook-system
5+
---
6+
kind: ClusterRole
7+
apiVersion: rbac.authorization.k8s.io/v1beta1
8+
metadata:
9+
name: rook-operator
10+
rules:
11+
- apiGroups:
12+
- ""
13+
resources:
14+
- namespaces
15+
- serviceaccounts
16+
- secrets
17+
- pods
18+
- services
19+
- nodes
20+
- nodes/proxy
21+
- configmaps
22+
- events
23+
- persistentvolumes
24+
- persistentvolumeclaims
25+
verbs:
26+
- get
27+
- list
28+
- watch
29+
- patch
30+
- create
31+
- update
32+
- delete
33+
- apiGroups:
34+
- extensions
35+
resources:
36+
- thirdpartyresources
37+
- deployments
38+
- daemonsets
39+
- replicasets
40+
verbs:
41+
- get
42+
- list
43+
- watch
44+
- create
45+
- update
46+
- delete
47+
- apiGroups:
48+
- apiextensions.k8s.io
49+
resources:
50+
- customresourcedefinitions
51+
verbs:
52+
- get
53+
- list
54+
- watch
55+
- create
56+
- delete
57+
- apiGroups:
58+
- rbac.authorization.k8s.io
59+
resources:
60+
- clusterroles
61+
- clusterrolebindings
62+
- roles
63+
- rolebindings
64+
verbs:
65+
- get
66+
- list
67+
- watch
68+
- create
69+
- update
70+
- delete
71+
- apiGroups:
72+
- storage.k8s.io
73+
resources:
74+
- storageclasses
75+
verbs:
76+
- get
77+
- list
78+
- watch
79+
- delete
80+
- apiGroups:
81+
- rook.io
82+
resources:
83+
- "*"
84+
verbs:
85+
- "*"
86+
---
87+
apiVersion: v1
88+
kind: ServiceAccount
89+
metadata:
90+
name: rook-operator
91+
namespace: rook-system
92+
---
93+
kind: ClusterRoleBinding
94+
apiVersion: rbac.authorization.k8s.io/v1beta1
95+
metadata:
96+
name: rook-operator
97+
namespace: rook-system
98+
roleRef:
99+
apiGroup: rbac.authorization.k8s.io
100+
kind: ClusterRole
101+
name: rook-operator
102+
subjects:
103+
- kind: ServiceAccount
104+
name: rook-operator
105+
namespace: rook-system
106+
---
107+
apiVersion: apps/v1beta1
108+
kind: Deployment
109+
metadata:
110+
name: rook-operator
111+
namespace: rook-system
112+
spec:
113+
replicas: 1
114+
template:
115+
metadata:
116+
labels:
117+
app: rook-operator
118+
spec:
119+
serviceAccountName: rook-operator
120+
containers:
121+
- name: rook-operator
122+
image: rook/rook:master
123+
args: ["operator"]
124+
env:
125+
# To disable RBAC, uncomment the following:
126+
# - name: RBAC_ENABLED
127+
# value: "false"
128+
# Rook Agent toleration. Will tolerate all taints with all keys.
129+
# Choose between NoSchedule, PreferNoSchedule and NoExecute:
130+
# - name: AGENT_TOLERATION
131+
# value: "NoSchedule"
132+
# (Optional) Rook Agent toleration key. Set this to the key of the taint you want to tolerate
133+
# - name: AGENT_TOLERATION_KEY
134+
# value: "<KeyOfTheTaintToTolerate>"
135+
# Set the path where the Rook agent can find the flex volumes
136+
# - name: FLEXVOLUME_DIR_PATH
137+
# value: "<PathToFlexVolumes>"
138+
# The interval to check if every mon is in the quorum.
139+
- name: ROOK_MON_HEALTHCHECK_INTERVAL
140+
value: "45s"
141+
- name: FLEXVOLUME_DIR_PATH
142+
value: "/var/lib/kubelet/volumeplugins"
143+
# The duration to wait before trying to failover or remove/replace the
144+
# current mon with a new mon (useful for compensating flapping network).
145+
- name: ROOK_MON_OUT_TIMEOUT
146+
value: "300s"
147+
- name: NODE_NAME
148+
valueFrom:
149+
fieldRef:
150+
fieldPath: spec.nodeName
151+
- name: POD_NAME
152+
valueFrom:
153+
fieldRef:
154+
fieldPath: metadata.name
155+
- name: POD_NAMESPACE
156+
valueFrom:
157+
fieldRef:
158+
fieldPath: metadata.namespace

addon/rook/rook-storageclass.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: rook.io/v1alpha1
2+
kind: Pool
3+
metadata:
4+
name: replicapool
5+
namespace: rook
6+
spec:
7+
replicated:
8+
size: 1
9+
# For an erasure-coded pool, comment out the replication size above and uncomment the following settings.
10+
# Make sure you have enough OSDs to support the replica size or erasure code chunks.
11+
#erasureCoded:
12+
# dataChunks: 2
13+
# codingChunks: 1
14+
---
15+
apiVersion: storage.k8s.io/v1
16+
kind: StorageClass
17+
metadata:
18+
name: rook-block
19+
provisioner: rook.io/block
20+
parameters:
21+
pool: replicapool
22+
# Specify the Rook cluster from which to create volumes.
23+
# If not specified, it will use `rook` as the name of the cluster.
24+
# This is also the namespace where the cluster will be
25+
clusterName: rook
26+
# Specify the filesystem type of the volume. If not specified, it will use `ext4`.
27+
# fstype: ext4

addon/rook/rook-tools.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: rook-tools
5+
namespace: rook
6+
spec:
7+
dnsPolicy: ClusterFirstWithHostNet
8+
containers:
9+
- name: rook-tools
10+
image: rook/toolbox:master
11+
imagePullPolicy: IfNotPresent
12+
env:
13+
- name: ROOK_ADMIN_SECRET
14+
valueFrom:
15+
secretKeyRef:
16+
name: rook-ceph-mon
17+
key: admin-secret
18+
securityContext:
19+
privileged: true
20+
volumeMounts:
21+
- mountPath: /dev
22+
name: dev
23+
- mountPath: /sys/bus
24+
name: sysbus
25+
- mountPath: /lib/modules
26+
name: libmodules
27+
- name: mon-endpoint-volume
28+
mountPath: /etc/rook
29+
hostNetwork: false
30+
volumes:
31+
- name: dev
32+
hostPath:
33+
path: /dev
34+
- name: sysbus
35+
hostPath:
36+
path: /sys/bus
37+
- name: libmodules
38+
hostPath:
39+
path: /lib/modules
40+
- name: mon-endpoint-volume
41+
configMap:
42+
name: rook-ceph-mon-endpoints
43+
items:
44+
- key: data
45+
path: mon-endpoints

0 commit comments

Comments
 (0)