Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.

Commit c7ccfd5

Browse files
committed
*: add kenc and bootstrap etcd
1 parent 67bddde commit c7ccfd5

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

config.tf

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ variable "tectonic_container_images" {
4040
flannel = "quay.io/coreos/flannel:v0.7.1-amd64"
4141
etcd = "quay.io/coreos/etcd:v3.1.6"
4242
etcd_operator = "quay.io/coreos/etcd-operator:v0.2.5"
43+
kenc = "quay.io/coreos/kenc:48b6feceeee56c657ea9263f47b6ea091e8d3035"
4344
awscli = "quay.io/coreos/awscli:025a357f05242fdad6a81e8a6b520098aa65a600"
4445
}
4546
}

modules/bootkube/assets.tf

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ resource "template_dir" "bootkube" {
2626
kubedns_sidecar_image = "${var.container_images["kubedns_sidecar"]}"
2727
flannel_image = "${var.container_images["flannel"]}"
2828
etcd_operator_image = "${var.container_images["etcd_operator"]}"
29+
kenc_image = "${var.container_images["kenc"]}"
2930

3031
etcd_servers = "${data.null_data_source.etcd.outputs.no_certs ? "http://127.0.0.1:2379" : join(",", formatlist("https://%s:2379", var.etcd_endpoints))}"
3132
etcd_ca_flag = "${data.null_data_source.etcd.outputs.ca_flag}"
@@ -65,6 +66,7 @@ resource "template_dir" "bootkube-bootstrap" {
6566

6667
vars {
6768
hyperkube_image = "${var.container_images["hyperkube"]}"
69+
etcd_image = "${var.container_images["etcd"]}"
6870

6971
etcd_servers = "${data.null_data_source.etcd.outputs.no_certs ? "http://127.0.0.1:2379" : join(",", formatlist("https://%s:2379", var.etcd_endpoints))}"
7072
etcd_ca_flag = "${data.null_data_source.etcd.outputs.ca_flag}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: bootstrap-etcd
5+
namespace: kube-system
6+
labels:
7+
k8s-app: boot-etcd
8+
spec:
9+
containers:
10+
- name: etcd
11+
image: ${etcd_image}
12+
command:
13+
- /usr/local/bin/etcd
14+
- --name=boot-etcd
15+
- --listen-client-urls=http://0.0.0.0:12379
16+
- --listen-peer-urls=http://0.0.0.0:12380
17+
- --advertise-client-urls=http://$(MY_POD_IP):12379
18+
- --initial-advertise-peer-urls=http://$(MY_POD_IP):12380
19+
- --initial-cluster=boot-etcd=http://$(MY_POD_IP):12380
20+
- --initial-cluster-token=bootkube
21+
- --initial-cluster-state=new
22+
- --data-dir=/var/etcd/data
23+
env:
24+
- name: MY_POD_IP
25+
valueFrom:
26+
fieldRef:
27+
fieldPath: status.podIP
28+
hostNetwork: true
29+
restartPolicy: Never
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apiVersion: "extensions/v1beta1"
2+
kind: DaemonSet
3+
metadata:
4+
name: kube-etcd-network-checkpointer
5+
namespace: kube-system
6+
labels:
7+
tier: control-plane
8+
component: kube-etcd-network-checkpointer
9+
spec:
10+
template:
11+
metadata:
12+
labels:
13+
tier: control-plane
14+
component: kube-etcd-network-checkpointer
15+
annotations:
16+
checkpointer.alpha.coreos.com/checkpoint: "true"
17+
spec:
18+
containers:
19+
- image: ${kenc-image}
20+
name: kube-etcd-network-checkpointer
21+
securityContext:
22+
privileged: true
23+
volumeMounts:
24+
- mountPath: /etc/kubernetes/selfhosted-etcd
25+
name: checkpoint-dir
26+
readOnly: false
27+
- mountPath: /var/lock
28+
name: var-lock
29+
readOnly: false
30+
command:
31+
- /usr/bin/flock
32+
- /var/lock/kenc.lock
33+
- -c
34+
- "kenc -r -m iptables && kenc -m iptables"
35+
hostNetwork: true
36+
nodeSelector:
37+
node-role.kubernetes.io/master: ""
38+
tolerations:
39+
- key: node-role.kubernetes.io/master
40+
operator: Exists
41+
effect: NoSchedule
42+
volumes:
43+
- name: checkpoint-dir
44+
hostPath:
45+
path: /etc/kubernetes/checkpoint-iptables
46+
- name: var-lock
47+
hostPath:
48+
path: /var/lock

0 commit comments

Comments
 (0)