Skip to content

Commit

Permalink
Structure flannel/Calico manifests consistently
Browse files Browse the repository at this point in the history
* Organize flannel and Calico manifests to use consistent
naming, structure, and ordering to align
* Downside: Makes direct diff'ing with upstream harder, but
that's become difficult lately anyway, since Calico uses a
templating engine
  • Loading branch information
dghubble committed Nov 10, 2018
1 parent 8742024 commit d045a8e
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 102 deletions.
32 changes: 16 additions & 16 deletions resources/calico/calico.yaml → resources/calico/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ spec:
- -felix-ready
periodSeconds: 10
volumeMounts:
- mountPath: /lib/modules
name: lib-modules
- name: lib-modules
mountPath: /lib/modules
readOnly: true
- mountPath: /run/xtables.lock
name: xtables-lock
- name: var-lib-calico
mountPath: /var/lib/calico
readOnly: false
- mountPath: /var/run/calico
name: var-run-calico
- name: var-run-calico
mountPath: /var/run/calico
readOnly: false
- mountPath: /var/lib/calico
name: var-lib-calico
- name: xtables-lock
mountPath: /run/xtables.lock
readOnly: false
# Install Calico CNI binaries and CNI network config file on nodes
- name: install-cni
Expand Down Expand Up @@ -151,22 +151,22 @@ spec:
name: calico-config
key: veth_mtu
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
- mountPath: /host/etc/cni/net.d
name: cni-net-dir
- name: cni-bin-dir
mountPath: /host/opt/cni/bin
- name: cni-conf-dir
mountPath: /host/etc/cni/net.d
terminationGracePeriodSeconds: 0
volumes:
# Used by calico/node
- name: lib-modules
hostPath:
path: /lib/modules
- name: var-run-calico
hostPath:
path: /var/run/calico
- name: var-lib-calico
hostPath:
path: /var/lib/calico
- name: var-run-calico
hostPath:
path: /var/run/calico
- name: xtables-lock
hostPath:
type: FileOrCreate
Expand All @@ -175,6 +175,6 @@ spec:
- name: cni-bin-dir
hostPath:
path: /opt/cni/bin
- name: cni-net-dir
- name: cni-conf-dir
hostPath:
path: /etc/kubernetes/cni/net.d
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-flannel-cfg
name: flannel-config
namespace: kube-system
labels:
tier: node
Expand Down
83 changes: 83 additions & 0 deletions resources/flannel/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: flannel
namespace: kube-system
labels:
k8s-app: flannel
spec:
selector:
matchLabels:
k8s-app: flannel
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
template:
metadata:
labels:
k8s-app: flannel
annotations:
seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
spec:
hostNetwork: true
serviceAccountName: flannel
tolerations:
- effect: NoSchedule
operator: Exists
- effect: NoExecute
operator: Exists
containers:
- name: flannel
image: ${flannel_image}
command: [ "/opt/bin/flanneld", "--ip-masq", "--kube-subnet-mgr", "--iface=$(POD_IP)"]
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
securityContext:
privileged: true
volumeMounts:
- name: flannel-config
mountPath: /etc/kube-flannel/
- name: cni-conf-dir
mountPath: /etc/cni/net.d
- name: run
mountPath: /run
- name: install-cni
image: ${flannel_cni_image}
command: ["/install-cni.sh"]
env:
- name: CNI_NETWORK_CONFIG
valueFrom:
configMapKeyRef:
name: flannel-config
key: cni-conf.json
volumeMounts:
- name: cni-bin-dir
mountPath: /host/opt/cni/bin/
- name: cni-conf-dir
mountPath: /host/etc/cni/net.d
volumes:
- name: run
hostPath:
path: /run
- name: flannel-config
configMap:
name: flannel-config
# Used by install-cni
- name: cni-bin-dir
hostPath:
path: /opt/cni/bin
- name: cni-conf-dir
hostPath:
path: /etc/kubernetes/cni/net.d
85 changes: 0 additions & 85 deletions resources/flannel/flannel.yaml

This file was deleted.

File renamed without changes.

0 comments on commit d045a8e

Please sign in to comment.