porkadot 0.2.2 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/porkadot/assets.rb +9 -0
- data/lib/porkadot/assets/etcd/etcd-server.yaml.erb +2 -0
- data/lib/porkadot/assets/kubelet/config.yaml.erb +2 -0
- data/lib/porkadot/assets/kubelet/install-deps.sh.erb +11 -0
- data/lib/porkadot/assets/kubelet/install-pkgs.sh.erb +8 -1
- data/lib/porkadot/assets/kubernetes.rb +3 -0
- data/lib/porkadot/assets/kubernetes/manifests/coredns.yaml.erb +202 -0
- data/lib/porkadot/assets/kubernetes/manifests/dns-horizontal-autoscaler.yaml.erb +110 -0
- data/lib/porkadot/assets/kubernetes/manifests/flannel.yaml.erb +10 -10
- data/lib/porkadot/assets/kubernetes/manifests/kube-scheduler.yaml.erb +1 -1
- data/lib/porkadot/assets/kubernetes/manifests/kubelet-rubber-stamp.yaml.erb +11 -2
- data/lib/porkadot/assets/kubernetes/manifests/metallb.yaml.erb +3 -3
- data/lib/porkadot/assets/kubernetes/manifests/pod-checkpointer.yaml.erb +1 -1
- data/lib/porkadot/assets/kubernetes/manifests/porkadot.yaml.erb +23 -0
- data/lib/porkadot/assets/kubernetes/manifests/storage-version-migrator.yaml.erb +327 -0
- data/lib/porkadot/configs/certs/k8s.rb +6 -0
- data/lib/porkadot/configs/kubernetes.rb +1 -0
- data/lib/porkadot/default.yaml +3 -2
- data/lib/porkadot/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d57037f96d15fcabbd441ec706449775c89984f0b6019b1f15f863ccc970360a
|
4
|
+
data.tar.gz: 8c03689d67687fde6012cda7f0cea22e0f1c8b7b96a64942649d43e76560aaa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a941712075f648d17b5e6a75de10ce83974945ffb7feafcd630d4695d7ba7fab501d63e4a965319957ddf6676aa893e5035b01a2b93711ce1759153e35fc0d8
|
7
|
+
data.tar.gz: cb9b0ff915cea06c91a8da7fcdd894bee593bda0ec2efe3593a4b9dd5030b42269e5ba1f29230a77b076629651e387995cd2b1022906a66848cd74b84585c713
|
data/lib/porkadot/assets.rb
CHANGED
@@ -4,6 +4,15 @@ module Porkadot::Assets
|
|
4
4
|
space = space.times.map{' '}.join('')
|
5
5
|
text.lines.map{|line| "#{space}#{line}"}.join('')
|
6
6
|
end
|
7
|
+
|
8
|
+
def to_yaml(obj, space=0)
|
9
|
+
h = Hashie::Mash.new({obj: obj})
|
10
|
+
h = h.to_hash
|
11
|
+
if h['obj'].size == 0
|
12
|
+
return ''
|
13
|
+
end
|
14
|
+
return self.indent(h['obj'].to_yaml(canonical: false, header: false).gsub(/---\n/, ''), space)
|
15
|
+
end
|
7
16
|
end
|
8
17
|
|
9
18
|
def render_erb file, opts={}
|
@@ -26,3 +26,14 @@ curl -L https://storage.googleapis.com/kubernetes-release/release/${RELEASE}/bin
|
|
26
26
|
chmod +x /opt/bin/kubelet-${RELEASE}
|
27
27
|
rm -f /opt/bin/kubelet
|
28
28
|
ln -s /opt/bin/kubelet-${RELEASE} /opt/bin/kubelet
|
29
|
+
|
30
|
+
ETCD_VER="<%= global_config.etcd.image_tag.gsub(/\-\w+$/, '') %>"
|
31
|
+
ETCD_URL=https://storage.googleapis.com/etcd/${ETCD_VER}/etcd-${ETCD_VER}-linux-${architecture}.tar.gz
|
32
|
+
ETCD_TMP=$(mktemp -d)
|
33
|
+
|
34
|
+
curl -L ${ETCD_URL} -o ${ETCD_TMP}/etcd.tar.gz
|
35
|
+
tar zxvf ${ETCD_TMP}/etcd.tar.gz -C ${ETCD_TMP}/ --strip-components=1
|
36
|
+
chmod +x ${ETCD_TMP}/etcdctl
|
37
|
+
rm -f /opt/bin/etcdctl
|
38
|
+
mv ${ETCD_TMP}/etcdctl /opt/bin/etcdctl-${ETCD_VER}
|
39
|
+
ln -s /opt/bin/etcdctl-${ETCD_VER} /opt/bin/etcdctl
|
@@ -22,7 +22,8 @@ if type apt-get > /dev/null 2>&1 ;then
|
|
22
22
|
nfs-common \
|
23
23
|
socat \
|
24
24
|
udev \
|
25
|
-
util-linux
|
25
|
+
util-linux \
|
26
|
+
open-iscsi
|
26
27
|
fi
|
27
28
|
|
28
29
|
cat <<EOF > /etc/sysctl.d/k8s.conf
|
@@ -30,4 +31,10 @@ net.bridge.bridge-nf-call-ip6tables = 1
|
|
30
31
|
net.bridge.bridge-nf-call-iptables = 1
|
31
32
|
EOF
|
32
33
|
|
34
|
+
cat <<EOF > /etc/iscsi/initiatorname.iscsi
|
35
|
+
InitiatorName=iqn.2020-04.cloud.unstable:<%= config.hostname %>
|
36
|
+
EOF
|
37
|
+
|
38
|
+
systemctl restart iscsid.service
|
39
|
+
|
33
40
|
sysctl --system
|
@@ -29,6 +29,8 @@ module Porkadot; module Assets
|
|
29
29
|
render_erb 'manifests/kubelet.yaml'
|
30
30
|
render_erb "manifests/#{lb.type}.yaml"
|
31
31
|
render_erb "manifests/#{cni.type}.yaml"
|
32
|
+
render_erb "manifests/coredns.yaml"
|
33
|
+
render_erb "manifests/dns-horizontal-autoscaler.yaml"
|
32
34
|
render_erb "manifests/kube-apiserver.yaml"
|
33
35
|
render_secrets_erb "manifests/kube-apiserver.secrets.yaml"
|
34
36
|
render_erb "manifests/kube-proxy.yaml"
|
@@ -37,6 +39,7 @@ module Porkadot; module Assets
|
|
37
39
|
render_secrets_erb "manifests/kube-controller-manager.secrets.yaml"
|
38
40
|
render_erb "manifests/pod-checkpointer.yaml"
|
39
41
|
render_erb "manifests/kubelet-rubber-stamp.yaml"
|
42
|
+
render_erb "manifests/storage-version-migrator.yaml"
|
40
43
|
render_erb 'install.sh'
|
41
44
|
end
|
42
45
|
|
@@ -0,0 +1,202 @@
|
|
1
|
+
<% k8s = global_config.k8s -%>
|
2
|
+
# __MACHINE_GENERATED_WARNING__
|
3
|
+
|
4
|
+
apiVersion: v1
|
5
|
+
kind: ServiceAccount
|
6
|
+
metadata:
|
7
|
+
name: coredns
|
8
|
+
namespace: kube-system
|
9
|
+
labels:
|
10
|
+
kubernetes.io/cluster-service: "true"
|
11
|
+
addonmanager.kubernetes.io/mode: Reconcile
|
12
|
+
---
|
13
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
14
|
+
kind: ClusterRole
|
15
|
+
metadata:
|
16
|
+
labels:
|
17
|
+
kubernetes.io/bootstrapping: rbac-defaults
|
18
|
+
addonmanager.kubernetes.io/mode: Reconcile
|
19
|
+
name: system:coredns
|
20
|
+
rules:
|
21
|
+
- apiGroups:
|
22
|
+
- ""
|
23
|
+
resources:
|
24
|
+
- endpoints
|
25
|
+
- services
|
26
|
+
- pods
|
27
|
+
- namespaces
|
28
|
+
verbs:
|
29
|
+
- list
|
30
|
+
- watch
|
31
|
+
- apiGroups:
|
32
|
+
- ""
|
33
|
+
resources:
|
34
|
+
- nodes
|
35
|
+
verbs:
|
36
|
+
- get
|
37
|
+
---
|
38
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
39
|
+
kind: ClusterRoleBinding
|
40
|
+
metadata:
|
41
|
+
annotations:
|
42
|
+
rbac.authorization.kubernetes.io/autoupdate: "true"
|
43
|
+
labels:
|
44
|
+
kubernetes.io/bootstrapping: rbac-defaults
|
45
|
+
addonmanager.kubernetes.io/mode: EnsureExists
|
46
|
+
name: system:coredns
|
47
|
+
roleRef:
|
48
|
+
apiGroup: rbac.authorization.k8s.io
|
49
|
+
kind: ClusterRole
|
50
|
+
name: system:coredns
|
51
|
+
subjects:
|
52
|
+
- kind: ServiceAccount
|
53
|
+
name: coredns
|
54
|
+
namespace: kube-system
|
55
|
+
---
|
56
|
+
apiVersion: v1
|
57
|
+
kind: ConfigMap
|
58
|
+
metadata:
|
59
|
+
name: coredns
|
60
|
+
namespace: kube-system
|
61
|
+
labels:
|
62
|
+
addonmanager.kubernetes.io/mode: EnsureExists
|
63
|
+
data:
|
64
|
+
Corefile: |
|
65
|
+
.:53 {
|
66
|
+
errors
|
67
|
+
health {
|
68
|
+
lameduck 5s
|
69
|
+
}
|
70
|
+
ready
|
71
|
+
kubernetes <%= k8s.networking.dns_domain %> in-addr.arpa ip6.arpa {
|
72
|
+
pods insecure
|
73
|
+
fallthrough in-addr.arpa ip6.arpa
|
74
|
+
ttl 30
|
75
|
+
}
|
76
|
+
prometheus :9153
|
77
|
+
forward . /etc/resolv.conf
|
78
|
+
cache 30
|
79
|
+
loop
|
80
|
+
reload
|
81
|
+
loadbalance
|
82
|
+
}
|
83
|
+
---
|
84
|
+
apiVersion: apps/v1
|
85
|
+
kind: Deployment
|
86
|
+
metadata:
|
87
|
+
name: coredns
|
88
|
+
namespace: kube-system
|
89
|
+
labels:
|
90
|
+
k8s-app: kube-dns
|
91
|
+
kubernetes.io/cluster-service: "true"
|
92
|
+
addonmanager.kubernetes.io/mode: Reconcile
|
93
|
+
kubernetes.io/name: "CoreDNS"
|
94
|
+
spec:
|
95
|
+
# replicas: not specified here:
|
96
|
+
# 1. In order to make Addon Manager do not reconcile this replicas parameter.
|
97
|
+
# 2. Default is 1.
|
98
|
+
# 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
|
99
|
+
strategy:
|
100
|
+
type: RollingUpdate
|
101
|
+
rollingUpdate:
|
102
|
+
maxUnavailable: 1
|
103
|
+
selector:
|
104
|
+
matchLabels:
|
105
|
+
k8s-app: kube-dns
|
106
|
+
template:
|
107
|
+
metadata:
|
108
|
+
labels:
|
109
|
+
k8s-app: kube-dns
|
110
|
+
annotations:
|
111
|
+
seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
|
112
|
+
spec:
|
113
|
+
priorityClassName: system-cluster-critical
|
114
|
+
serviceAccountName: coredns
|
115
|
+
tolerations:
|
116
|
+
- key: "CriticalAddonsOnly"
|
117
|
+
operator: "Exists"
|
118
|
+
nodeSelector:
|
119
|
+
kubernetes.io/os: linux
|
120
|
+
containers:
|
121
|
+
- name: coredns
|
122
|
+
image: k8s.gcr.io/coredns:1.6.7
|
123
|
+
imagePullPolicy: IfNotPresent
|
124
|
+
resources:
|
125
|
+
limits:
|
126
|
+
memory: 170Mi
|
127
|
+
requests:
|
128
|
+
cpu: 100m
|
129
|
+
memory: 70Mi
|
130
|
+
args: [ "-conf", "/etc/coredns/Corefile" ]
|
131
|
+
volumeMounts:
|
132
|
+
- name: config-volume
|
133
|
+
mountPath: /etc/coredns
|
134
|
+
readOnly: true
|
135
|
+
ports:
|
136
|
+
- containerPort: 53
|
137
|
+
name: dns
|
138
|
+
protocol: UDP
|
139
|
+
- containerPort: 53
|
140
|
+
name: dns-tcp
|
141
|
+
protocol: TCP
|
142
|
+
- containerPort: 9153
|
143
|
+
name: metrics
|
144
|
+
protocol: TCP
|
145
|
+
livenessProbe:
|
146
|
+
httpGet:
|
147
|
+
path: /health
|
148
|
+
port: 8080
|
149
|
+
scheme: HTTP
|
150
|
+
initialDelaySeconds: 60
|
151
|
+
timeoutSeconds: 5
|
152
|
+
successThreshold: 1
|
153
|
+
failureThreshold: 5
|
154
|
+
readinessProbe:
|
155
|
+
httpGet:
|
156
|
+
path: /ready
|
157
|
+
port: 8181
|
158
|
+
scheme: HTTP
|
159
|
+
securityContext:
|
160
|
+
allowPrivilegeEscalation: false
|
161
|
+
capabilities:
|
162
|
+
add:
|
163
|
+
- NET_BIND_SERVICE
|
164
|
+
drop:
|
165
|
+
- all
|
166
|
+
readOnlyRootFilesystem: true
|
167
|
+
dnsPolicy: Default
|
168
|
+
volumes:
|
169
|
+
- name: config-volume
|
170
|
+
configMap:
|
171
|
+
name: coredns
|
172
|
+
items:
|
173
|
+
- key: Corefile
|
174
|
+
path: Corefile
|
175
|
+
---
|
176
|
+
apiVersion: v1
|
177
|
+
kind: Service
|
178
|
+
metadata:
|
179
|
+
name: kube-dns
|
180
|
+
namespace: kube-system
|
181
|
+
annotations:
|
182
|
+
prometheus.io/port: "9153"
|
183
|
+
prometheus.io/scrape: "true"
|
184
|
+
labels:
|
185
|
+
k8s-app: kube-dns
|
186
|
+
kubernetes.io/cluster-service: "true"
|
187
|
+
addonmanager.kubernetes.io/mode: Reconcile
|
188
|
+
kubernetes.io/name: "CoreDNS"
|
189
|
+
spec:
|
190
|
+
selector:
|
191
|
+
k8s-app: kube-dns
|
192
|
+
clusterIP: <%= k8s.networking.dns_ip %>
|
193
|
+
ports:
|
194
|
+
- name: dns
|
195
|
+
port: 53
|
196
|
+
protocol: UDP
|
197
|
+
- name: dns-tcp
|
198
|
+
port: 53
|
199
|
+
protocol: TCP
|
200
|
+
- name: metrics
|
201
|
+
port: 9153
|
202
|
+
protocol: TCP
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# Copyright 2016 The Kubernetes Authors.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
kind: ServiceAccount
|
16
|
+
apiVersion: v1
|
17
|
+
metadata:
|
18
|
+
name: kube-dns-autoscaler
|
19
|
+
namespace: kube-system
|
20
|
+
labels:
|
21
|
+
addonmanager.kubernetes.io/mode: Reconcile
|
22
|
+
---
|
23
|
+
kind: ClusterRole
|
24
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
25
|
+
metadata:
|
26
|
+
name: system:kube-dns-autoscaler
|
27
|
+
labels:
|
28
|
+
addonmanager.kubernetes.io/mode: Reconcile
|
29
|
+
rules:
|
30
|
+
- apiGroups: [""]
|
31
|
+
resources: ["nodes"]
|
32
|
+
verbs: ["list", "watch"]
|
33
|
+
- apiGroups: [""]
|
34
|
+
resources: ["replicationcontrollers/scale"]
|
35
|
+
verbs: ["get", "update"]
|
36
|
+
- apiGroups: ["apps"]
|
37
|
+
resources: ["deployments/scale", "replicasets/scale"]
|
38
|
+
verbs: ["get", "update"]
|
39
|
+
# Remove the configmaps rule once below issue is fixed:
|
40
|
+
# kubernetes-incubator/cluster-proportional-autoscaler#16
|
41
|
+
- apiGroups: [""]
|
42
|
+
resources: ["configmaps"]
|
43
|
+
verbs: ["get", "create"]
|
44
|
+
---
|
45
|
+
kind: ClusterRoleBinding
|
46
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
47
|
+
metadata:
|
48
|
+
name: system:kube-dns-autoscaler
|
49
|
+
labels:
|
50
|
+
addonmanager.kubernetes.io/mode: Reconcile
|
51
|
+
subjects:
|
52
|
+
- kind: ServiceAccount
|
53
|
+
name: kube-dns-autoscaler
|
54
|
+
namespace: kube-system
|
55
|
+
roleRef:
|
56
|
+
kind: ClusterRole
|
57
|
+
name: system:kube-dns-autoscaler
|
58
|
+
apiGroup: rbac.authorization.k8s.io
|
59
|
+
|
60
|
+
---
|
61
|
+
apiVersion: apps/v1
|
62
|
+
kind: Deployment
|
63
|
+
metadata:
|
64
|
+
name: kube-dns-autoscaler
|
65
|
+
namespace: kube-system
|
66
|
+
labels:
|
67
|
+
k8s-app: kube-dns-autoscaler
|
68
|
+
kubernetes.io/cluster-service: "true"
|
69
|
+
addonmanager.kubernetes.io/mode: Reconcile
|
70
|
+
spec:
|
71
|
+
selector:
|
72
|
+
matchLabels:
|
73
|
+
k8s-app: kube-dns-autoscaler
|
74
|
+
template:
|
75
|
+
metadata:
|
76
|
+
labels:
|
77
|
+
k8s-app: kube-dns-autoscaler
|
78
|
+
annotations:
|
79
|
+
seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
|
80
|
+
spec:
|
81
|
+
priorityClassName: system-cluster-critical
|
82
|
+
securityContext:
|
83
|
+
supplementalGroups: [ 65534 ]
|
84
|
+
fsGroup: 65534
|
85
|
+
nodeSelector:
|
86
|
+
kubernetes.io/os: linux
|
87
|
+
containers:
|
88
|
+
- name: autoscaler
|
89
|
+
image: k8s.gcr.io/cluster-proportional-autoscaler-amd64:1.7.1
|
90
|
+
resources:
|
91
|
+
requests:
|
92
|
+
cpu: "20m"
|
93
|
+
memory: "10Mi"
|
94
|
+
command:
|
95
|
+
- /cluster-proportional-autoscaler
|
96
|
+
- --namespace=kube-system
|
97
|
+
- --configmap=kube-dns-autoscaler
|
98
|
+
# Should keep target in sync with cluster/addons/dns/kube-dns.yaml.base
|
99
|
+
- --target=Deployment/coredns
|
100
|
+
# When cluster is using large nodes(with more cores), "coresPerReplica" should dominate.
|
101
|
+
# If using small nodes, "nodesPerReplica" should dominate.
|
102
|
+
- --default-params={"linear":{"coresPerReplica":256,"nodesPerReplica":16,"preventSinglePointFailure":true}}
|
103
|
+
- --logtostderr=true
|
104
|
+
- --v=2
|
105
|
+
tolerations:
|
106
|
+
- key: "CriticalAddonsOnly"
|
107
|
+
operator: "Exists"
|
108
|
+
nodeSelector:
|
109
|
+
kubernetes.io/os: linux
|
110
|
+
serviceAccountName: kube-dns-autoscaler
|
@@ -154,11 +154,11 @@ spec:
|
|
154
154
|
requiredDuringSchedulingIgnoredDuringExecution:
|
155
155
|
nodeSelectorTerms:
|
156
156
|
- matchExpressions:
|
157
|
-
- key:
|
157
|
+
- key: kubernetes.io/os
|
158
158
|
operator: In
|
159
159
|
values:
|
160
160
|
- linux
|
161
|
-
- key:
|
161
|
+
- key: kubernetes.io/arch
|
162
162
|
operator: In
|
163
163
|
values:
|
164
164
|
- amd64
|
@@ -248,11 +248,11 @@ spec:
|
|
248
248
|
requiredDuringSchedulingIgnoredDuringExecution:
|
249
249
|
nodeSelectorTerms:
|
250
250
|
- matchExpressions:
|
251
|
-
- key:
|
251
|
+
- key: kubernetes.io/os
|
252
252
|
operator: In
|
253
253
|
values:
|
254
254
|
- linux
|
255
|
-
- key:
|
255
|
+
- key: kubernetes.io/arch
|
256
256
|
operator: In
|
257
257
|
values:
|
258
258
|
- arm64
|
@@ -342,11 +342,11 @@ spec:
|
|
342
342
|
requiredDuringSchedulingIgnoredDuringExecution:
|
343
343
|
nodeSelectorTerms:
|
344
344
|
- matchExpressions:
|
345
|
-
- key:
|
345
|
+
- key: kubernetes.io/os
|
346
346
|
operator: In
|
347
347
|
values:
|
348
348
|
- linux
|
349
|
-
- key:
|
349
|
+
- key: kubernetes.io/arch
|
350
350
|
operator: In
|
351
351
|
values:
|
352
352
|
- arm
|
@@ -436,11 +436,11 @@ spec:
|
|
436
436
|
requiredDuringSchedulingIgnoredDuringExecution:
|
437
437
|
nodeSelectorTerms:
|
438
438
|
- matchExpressions:
|
439
|
-
- key:
|
439
|
+
- key: kubernetes.io/os
|
440
440
|
operator: In
|
441
441
|
values:
|
442
442
|
- linux
|
443
|
-
- key:
|
443
|
+
- key: kubernetes.io/arch
|
444
444
|
operator: In
|
445
445
|
values:
|
446
446
|
- ppc64le
|
@@ -530,11 +530,11 @@ spec:
|
|
530
530
|
requiredDuringSchedulingIgnoredDuringExecution:
|
531
531
|
nodeSelectorTerms:
|
532
532
|
- matchExpressions:
|
533
|
-
- key:
|
533
|
+
- key: kubernetes.io/os
|
534
534
|
operator: In
|
535
535
|
values:
|
536
536
|
- linux
|
537
|
-
- key:
|
537
|
+
- key: kubernetes.io/arch
|
538
538
|
operator: In
|
539
539
|
values:
|
540
540
|
- s390x
|
@@ -62,7 +62,7 @@ rules:
|
|
62
62
|
verbs: ["get", "watch", "list"]
|
63
63
|
- apiGroups: [""] # "" indicates the core API group
|
64
64
|
resources: ["secrets", "configmaps"]
|
65
|
-
verbs: ["get"]
|
65
|
+
verbs: ["get", "watch", "list"]
|
66
66
|
---
|
67
67
|
apiVersion: rbac.authorization.k8s.io/v1
|
68
68
|
kind: RoleBinding
|
@@ -24,7 +24,7 @@ spec:
|
|
24
24
|
- name: kubelet-rubber-stamp
|
25
25
|
# image: quay.io/kontena/kubelet-rubber-stamp-amd64:0.2
|
26
26
|
# Use following image until issue is fixed
|
27
|
-
image: yuanying/kubelet-rubber-stamp:0.
|
27
|
+
image: yuanying/kubelet-rubber-stamp:0.3.0.y01
|
28
28
|
args:
|
29
29
|
- "--v=2"
|
30
30
|
imagePullPolicy: Always
|
@@ -56,12 +56,21 @@ kind: ClusterRole
|
|
56
56
|
metadata:
|
57
57
|
name: kubelet-rubber-stamp
|
58
58
|
rules:
|
59
|
+
- apiGroups:
|
60
|
+
- certificates.k8s.io
|
61
|
+
resources:
|
62
|
+
- signers
|
63
|
+
# legacy-unknown: support before kubernetes-1.18.0
|
64
|
+
resourceNames:
|
65
|
+
- "kubernetes.io/legacy-unknown"
|
66
|
+
- "kubernetes.io/kubelet-serving"
|
67
|
+
verbs:
|
68
|
+
- approve
|
59
69
|
- apiGroups:
|
60
70
|
- certificates.k8s.io
|
61
71
|
resources:
|
62
72
|
- certificatesigningrequests
|
63
73
|
verbs:
|
64
|
-
- delete
|
65
74
|
- get
|
66
75
|
- list
|
67
76
|
- watch
|
@@ -206,7 +206,7 @@ spec:
|
|
206
206
|
- "-P"
|
207
207
|
- "FORWARD"
|
208
208
|
- "ACCEPT"
|
209
|
-
image: <%= k8s.image_repository %>/
|
209
|
+
image: <%= k8s.image_repository %>/kube-proxy:<%= k8s.kubernetes_version %>
|
210
210
|
imagePullPolicy: IfNotPresent
|
211
211
|
name: default-iptables
|
212
212
|
securityContext:
|
@@ -253,7 +253,7 @@ spec:
|
|
253
253
|
readOnlyRootFilesystem: true
|
254
254
|
hostNetwork: true
|
255
255
|
nodeSelector:
|
256
|
-
|
256
|
+
kubernetes.io/os: linux
|
257
257
|
serviceAccountName: speaker
|
258
258
|
terminationGracePeriodSeconds: 0
|
259
259
|
tolerations:
|
@@ -304,7 +304,7 @@ spec:
|
|
304
304
|
- all
|
305
305
|
readOnlyRootFilesystem: true
|
306
306
|
nodeSelector:
|
307
|
-
|
307
|
+
kubernetes.io/os: linux
|
308
308
|
securityContext:
|
309
309
|
runAsNonRoot: true
|
310
310
|
runAsUser: 65534
|
@@ -78,7 +78,7 @@ spec:
|
|
78
78
|
spec:
|
79
79
|
containers:
|
80
80
|
- name: pod-checkpointer
|
81
|
-
image:
|
81
|
+
image: yuanying/pod-checkpointer:v0.18.0
|
82
82
|
command:
|
83
83
|
- /checkpoint
|
84
84
|
- --lock-file=/var/run/lock/pod-checkpointer.lock
|
@@ -66,3 +66,26 @@ data:
|
|
66
66
|
- context:
|
67
67
|
cluster: local
|
68
68
|
user: service-account
|
69
|
+
---
|
70
|
+
apiVersion: v1
|
71
|
+
kind: ConfigMap
|
72
|
+
metadata:
|
73
|
+
name: kubeconfig-in-cluster-latest
|
74
|
+
namespace: kube-system
|
75
|
+
data:
|
76
|
+
kubeconfig: |
|
77
|
+
apiVersion: v1
|
78
|
+
clusters:
|
79
|
+
- name: local
|
80
|
+
cluster:
|
81
|
+
server: https://porkadot-kubernetes-latest:<%= port %>
|
82
|
+
certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
83
|
+
users:
|
84
|
+
- name: service-account
|
85
|
+
user:
|
86
|
+
# Use service account token
|
87
|
+
tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
|
88
|
+
contexts:
|
89
|
+
- context:
|
90
|
+
cluster: local
|
91
|
+
user: service-account
|
@@ -0,0 +1,327 @@
|
|
1
|
+
apiVersion: apiextensions.k8s.io/v1beta1
|
2
|
+
kind: CustomResourceDefinition
|
3
|
+
metadata:
|
4
|
+
name: storageversionmigrations.migration.k8s.io
|
5
|
+
spec:
|
6
|
+
group: migration.k8s.io
|
7
|
+
names:
|
8
|
+
kind: StorageVersionMigration
|
9
|
+
listKind: StorageVersionMigrationList
|
10
|
+
plural: storageversionmigrations
|
11
|
+
singular: storageversionmigration
|
12
|
+
scope: Cluster
|
13
|
+
subresources:
|
14
|
+
status: {}
|
15
|
+
version: v1alpha1
|
16
|
+
versions:
|
17
|
+
- name: v1alpha1
|
18
|
+
served: true
|
19
|
+
storage: true
|
20
|
+
"validation":
|
21
|
+
"openAPIV3Schema":
|
22
|
+
description: StorageVersionMigration represents a migration of stored data to
|
23
|
+
the latest storage version.
|
24
|
+
type: object
|
25
|
+
properties:
|
26
|
+
apiVersion:
|
27
|
+
description: 'APIVersion defines the versioned schema of this representation
|
28
|
+
of an object. Servers should convert recognized schemas to the latest
|
29
|
+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
30
|
+
type: string
|
31
|
+
kind:
|
32
|
+
description: 'Kind is a string value representing the REST resource this
|
33
|
+
object represents. Servers may infer this from the endpoint the client
|
34
|
+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
35
|
+
type: string
|
36
|
+
metadata:
|
37
|
+
type: object
|
38
|
+
spec:
|
39
|
+
description: Specification of the migration.
|
40
|
+
type: object
|
41
|
+
required:
|
42
|
+
- resource
|
43
|
+
properties:
|
44
|
+
continueToken:
|
45
|
+
description: The token used in the list options to get the next chunk
|
46
|
+
of objects to migrate. When the .status.conditions indicates the migration
|
47
|
+
is "Running", users can use this token to check the progress of the
|
48
|
+
migration.
|
49
|
+
type: string
|
50
|
+
resource:
|
51
|
+
description: The resource that is being migrated. The migrator sends
|
52
|
+
requests to the endpoint serving the resource. Immutable.
|
53
|
+
type: object
|
54
|
+
properties:
|
55
|
+
group:
|
56
|
+
description: The name of the group.
|
57
|
+
type: string
|
58
|
+
resource:
|
59
|
+
description: The name of the resource.
|
60
|
+
type: string
|
61
|
+
version:
|
62
|
+
description: The name of the version.
|
63
|
+
type: string
|
64
|
+
status:
|
65
|
+
description: Status of the migration.
|
66
|
+
type: object
|
67
|
+
properties:
|
68
|
+
conditions:
|
69
|
+
description: The latest available observations of the migration's current
|
70
|
+
state.
|
71
|
+
type: array
|
72
|
+
items:
|
73
|
+
description: Describes the state of a migration at a certain point.
|
74
|
+
type: object
|
75
|
+
required:
|
76
|
+
- status
|
77
|
+
- type
|
78
|
+
properties:
|
79
|
+
lastUpdateTime:
|
80
|
+
description: The last time this condition was updated.
|
81
|
+
type: string
|
82
|
+
format: date-time
|
83
|
+
message:
|
84
|
+
description: A human readable message indicating details about
|
85
|
+
the transition.
|
86
|
+
type: string
|
87
|
+
reason:
|
88
|
+
description: The reason for the condition's last transition.
|
89
|
+
type: string
|
90
|
+
status:
|
91
|
+
description: Status of the condition, one of True, False, Unknown.
|
92
|
+
type: string
|
93
|
+
type:
|
94
|
+
description: Type of the condition.
|
95
|
+
type: string
|
96
|
+
---
|
97
|
+
apiVersion: apiextensions.k8s.io/v1beta1
|
98
|
+
kind: CustomResourceDefinition
|
99
|
+
metadata:
|
100
|
+
name: storagestates.migration.k8s.io
|
101
|
+
spec:
|
102
|
+
group: migration.k8s.io
|
103
|
+
names:
|
104
|
+
kind: StorageState
|
105
|
+
listKind: StorageStateList
|
106
|
+
plural: storagestates
|
107
|
+
singular: storagestate
|
108
|
+
scope: Cluster
|
109
|
+
subresources:
|
110
|
+
status: {}
|
111
|
+
version: v1alpha1
|
112
|
+
versions:
|
113
|
+
- name: v1alpha1
|
114
|
+
served: true
|
115
|
+
storage: true
|
116
|
+
"validation":
|
117
|
+
"openAPIV3Schema":
|
118
|
+
description: The state of the storage of a specific resource.
|
119
|
+
type: object
|
120
|
+
properties:
|
121
|
+
apiVersion:
|
122
|
+
description: 'APIVersion defines the versioned schema of this representation
|
123
|
+
of an object. Servers should convert recognized schemas to the latest
|
124
|
+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
125
|
+
type: string
|
126
|
+
kind:
|
127
|
+
description: 'Kind is a string value representing the REST resource this
|
128
|
+
object represents. Servers may infer this from the endpoint the client
|
129
|
+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
130
|
+
type: string
|
131
|
+
metadata:
|
132
|
+
description: The name must be "<.spec.resource.resouce>.<.spec.resource.group>".
|
133
|
+
type: object
|
134
|
+
spec:
|
135
|
+
description: Specification of the storage state.
|
136
|
+
type: object
|
137
|
+
properties:
|
138
|
+
resource:
|
139
|
+
description: The resource this storageState is about.
|
140
|
+
type: object
|
141
|
+
properties:
|
142
|
+
group:
|
143
|
+
description: The name of the group.
|
144
|
+
type: string
|
145
|
+
resource:
|
146
|
+
description: The name of the resource.
|
147
|
+
type: string
|
148
|
+
status:
|
149
|
+
description: Status of the storage state.
|
150
|
+
type: object
|
151
|
+
properties:
|
152
|
+
currentStorageVersionHash:
|
153
|
+
description: The hash value of the current storage version, as shown
|
154
|
+
in the discovery document served by the API server. Storage Version
|
155
|
+
is the version to which objects are converted to before persisted.
|
156
|
+
type: string
|
157
|
+
lastHeartbeatTime:
|
158
|
+
description: LastHeartbeatTime is the last time the storage migration
|
159
|
+
triggering controller checks the storage version hash of this resource
|
160
|
+
in the discovery document and updates this field.
|
161
|
+
type: string
|
162
|
+
format: date-time
|
163
|
+
persistedStorageVersionHashes:
|
164
|
+
description: The hash values of storage versions that persisted instances
|
165
|
+
of spec.resource might still be encoded in. "Unknown" is a valid value
|
166
|
+
in the list, and is the default value. It is not safe to upgrade or
|
167
|
+
downgrade to an apiserver binary that does not support all versions
|
168
|
+
listed in this field, or if "Unknown" is listed. Once the storage
|
169
|
+
version migration for this resource has completed, the value of this
|
170
|
+
field is refined to only contain the currentStorageVersionHash. Once
|
171
|
+
the apiserver has changed the storage version, the new storage version
|
172
|
+
is appended to the list.
|
173
|
+
type: array
|
174
|
+
items:
|
175
|
+
type: string
|
176
|
+
---
|
177
|
+
apiVersion: v1
|
178
|
+
kind: Namespace
|
179
|
+
metadata:
|
180
|
+
name: kube-system
|
181
|
+
---
|
182
|
+
kind: ClusterRole
|
183
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
184
|
+
metadata:
|
185
|
+
name: storage-version-migration-trigger
|
186
|
+
rules:
|
187
|
+
- apiGroups: ["migration.k8s.io"]
|
188
|
+
resources: ["storagestates"]
|
189
|
+
verbs: ["watch", "get", "list", "delete", "create", "update"]
|
190
|
+
- apiGroups: ["migration.k8s.io"]
|
191
|
+
resources: ["storageversionmigrations"]
|
192
|
+
verbs: ["watch", "get", "list", "delete", "create"]
|
193
|
+
---
|
194
|
+
kind: ClusterRole
|
195
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
196
|
+
metadata:
|
197
|
+
name: storage-version-migration-crd-creator
|
198
|
+
rules:
|
199
|
+
- apiGroups: ["apiextensions.k8s.io"]
|
200
|
+
resources: ["customresourcedefinitions"]
|
201
|
+
verbs: ["create", "delete", "get"]
|
202
|
+
---
|
203
|
+
kind: ClusterRole
|
204
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
205
|
+
metadata:
|
206
|
+
name: storage-version-migration-initializer
|
207
|
+
rules:
|
208
|
+
- apiGroups: ["migration.k8s.io"]
|
209
|
+
resources: ["storageversionmigrations"]
|
210
|
+
verbs: ["create"]
|
211
|
+
---
|
212
|
+
kind: ClusterRoleBinding
|
213
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
214
|
+
metadata:
|
215
|
+
name: storage-version-migration-migrator
|
216
|
+
subjects:
|
217
|
+
- kind: ServiceAccount
|
218
|
+
name: default
|
219
|
+
namespace: kube-system
|
220
|
+
roleRef:
|
221
|
+
kind: ClusterRole
|
222
|
+
name: cluster-admin
|
223
|
+
apiGroup: rbac.authorization.k8s.io
|
224
|
+
---
|
225
|
+
kind: ClusterRoleBinding
|
226
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
227
|
+
metadata:
|
228
|
+
name: storage-version-migration-trigger
|
229
|
+
subjects:
|
230
|
+
- kind: ServiceAccount
|
231
|
+
name: default
|
232
|
+
namespace: kube-system
|
233
|
+
roleRef:
|
234
|
+
kind: ClusterRole
|
235
|
+
name: storage-version-migration-trigger
|
236
|
+
apiGroup: rbac.authorization.k8s.io
|
237
|
+
---
|
238
|
+
kind: ClusterRoleBinding
|
239
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
240
|
+
metadata:
|
241
|
+
name: storage-version-migration-crd-creator
|
242
|
+
subjects:
|
243
|
+
- kind: ServiceAccount
|
244
|
+
name: default
|
245
|
+
namespace: kube-system
|
246
|
+
roleRef:
|
247
|
+
kind: ClusterRole
|
248
|
+
name: storage-version-migration-crd-creator
|
249
|
+
apiGroup: rbac.authorization.k8s.io
|
250
|
+
---
|
251
|
+
kind: ClusterRoleBinding
|
252
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
253
|
+
metadata:
|
254
|
+
name: storage-version-migration-initializer
|
255
|
+
subjects:
|
256
|
+
- kind: ServiceAccount
|
257
|
+
name: default
|
258
|
+
namespace: kube-system
|
259
|
+
roleRef:
|
260
|
+
kind: ClusterRole
|
261
|
+
name: storage-version-migration-initializer
|
262
|
+
apiGroup: rbac.authorization.k8s.io
|
263
|
+
---
|
264
|
+
apiVersion: apps/v1
|
265
|
+
kind: Deployment
|
266
|
+
metadata:
|
267
|
+
name: trigger
|
268
|
+
namespace: kube-system
|
269
|
+
labels:
|
270
|
+
app: trigger
|
271
|
+
spec:
|
272
|
+
replicas: 1
|
273
|
+
selector:
|
274
|
+
matchLabels:
|
275
|
+
app: trigger
|
276
|
+
template:
|
277
|
+
metadata:
|
278
|
+
labels:
|
279
|
+
app: trigger
|
280
|
+
spec:
|
281
|
+
containers:
|
282
|
+
- name: trigger
|
283
|
+
image: yuanying/storage-version-migration-trigger:v0.1
|
284
|
+
args:
|
285
|
+
- --kubeconfig=/etc/trigger/kubeconfig
|
286
|
+
volumeMounts:
|
287
|
+
- mountPath: /etc/trigger
|
288
|
+
name: kubeconfig
|
289
|
+
volumes:
|
290
|
+
- name: kubeconfig
|
291
|
+
configMap:
|
292
|
+
name: kubeconfig-in-cluster-latest
|
293
|
+
---
|
294
|
+
apiVersion: apps/v1
|
295
|
+
kind: Deployment
|
296
|
+
metadata:
|
297
|
+
name: migrator
|
298
|
+
namespace: kube-system
|
299
|
+
labels:
|
300
|
+
app: migrator
|
301
|
+
spec:
|
302
|
+
replicas: 1
|
303
|
+
selector:
|
304
|
+
matchLabels:
|
305
|
+
app: migrator
|
306
|
+
template:
|
307
|
+
metadata:
|
308
|
+
labels:
|
309
|
+
app: migrator
|
310
|
+
spec:
|
311
|
+
containers:
|
312
|
+
- name: migrator
|
313
|
+
image: yuanying/storage-version-migration-migrator:v0.1
|
314
|
+
command:
|
315
|
+
- /migrator
|
316
|
+
- --v=2
|
317
|
+
- --alsologtostderr
|
318
|
+
- --kube-api-qps=40
|
319
|
+
- --kube-api-burst=1000
|
320
|
+
- --kubeconfig=/etc/migrator/kubeconfig
|
321
|
+
volumeMounts:
|
322
|
+
- mountPath: /etc/migrator
|
323
|
+
name: kubeconfig
|
324
|
+
volumes:
|
325
|
+
- name: kubeconfig
|
326
|
+
configMap:
|
327
|
+
name: kubeconfig-in-cluster-latest
|
@@ -33,6 +33,12 @@ module Porkadot; module Configs; class Certs
|
|
33
33
|
DNS:kubernetes.default
|
34
34
|
DNS:kubernetes.default.svc
|
35
35
|
DNS:kubernetes.default.svc.#{self.config.k8s.networking.dns_domain}
|
36
|
+
DNS:porkadot-kubernetes
|
37
|
+
DNS:porkadot-kubernetes.kube-system
|
38
|
+
DNS:porkadot-kubernetes.kube-system.svc
|
39
|
+
DNS:porkadot-kubernetes-latest
|
40
|
+
DNS:porkadot-kubernetes-latest.kube-system
|
41
|
+
DNS:porkadot-kubernetes-latest.kube-system.svc
|
36
42
|
DNS:localhost
|
37
43
|
IP:#{self.config.k8s.networking.kubernetes_ip}
|
38
44
|
IP:127.0.0.1
|
@@ -56,6 +56,7 @@ module Porkadot; module Configs
|
|
56
56
|
"#{RECOMMENDED_LABEL_PREFIX}/version": self.config.k8s.kubernetes_version,
|
57
57
|
"#{RECOMMENDED_LABEL_PREFIX}/part-of": 'kubernetes',
|
58
58
|
"#{RECOMMENDED_LABEL_PREFIX}/managed-by": 'porkadot',
|
59
|
+
"k8s-app": self.component_name,
|
59
60
|
})
|
60
61
|
end
|
61
62
|
|
data/lib/porkadot/default.yaml
CHANGED
@@ -27,10 +27,11 @@ lb:
|
|
27
27
|
|
28
28
|
etcd:
|
29
29
|
image_repository: gcr.io/etcd-development/etcd
|
30
|
-
image_tag: v3.3
|
30
|
+
image_tag: v3.4.3
|
31
|
+
extra_env: []
|
31
32
|
|
32
33
|
kubernetes:
|
33
|
-
kubernetes_version: v1.
|
34
|
+
kubernetes_version: v1.18.10
|
34
35
|
image_repository: k8s.gcr.io
|
35
36
|
|
36
37
|
networking:
|
data/lib/porkadot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: porkadot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OTSUKA, Yuanying
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -140,6 +140,8 @@ files:
|
|
140
140
|
- lib/porkadot/assets/kubelet/kubelet.service.erb
|
141
141
|
- lib/porkadot/assets/kubernetes.rb
|
142
142
|
- lib/porkadot/assets/kubernetes/install.sh.erb
|
143
|
+
- lib/porkadot/assets/kubernetes/manifests/coredns.yaml.erb
|
144
|
+
- lib/porkadot/assets/kubernetes/manifests/dns-horizontal-autoscaler.yaml.erb
|
143
145
|
- lib/porkadot/assets/kubernetes/manifests/flannel.yaml.erb
|
144
146
|
- lib/porkadot/assets/kubernetes/manifests/kube-apiserver.secrets.yaml.erb
|
145
147
|
- lib/porkadot/assets/kubernetes/manifests/kube-apiserver.yaml.erb
|
@@ -152,6 +154,7 @@ files:
|
|
152
154
|
- lib/porkadot/assets/kubernetes/manifests/metallb.yaml.erb
|
153
155
|
- lib/porkadot/assets/kubernetes/manifests/pod-checkpointer.yaml.erb
|
154
156
|
- lib/porkadot/assets/kubernetes/manifests/porkadot.yaml.erb
|
157
|
+
- lib/porkadot/assets/kubernetes/manifests/storage-version-migrator.yaml.erb
|
155
158
|
- lib/porkadot/cmd.rb
|
156
159
|
- lib/porkadot/cmd/cli.rb
|
157
160
|
- lib/porkadot/cmd/install.rb
|