Guest User

Untitled

a guest
Apr 27th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. ---
  2. kind: ClusterRole
  3. apiVersion: rbac.authorization.k8s.io/v1beta1
  4. metadata:
  5. name: flannel
  6. rules:
  7. - apiGroups:
  8. - ""
  9. resources:
  10. - pods
  11. verbs:
  12. - get
  13. - apiGroups:
  14. - ""
  15. resources:
  16. - nodes
  17. verbs:
  18. - list
  19. - watch
  20. - apiGroups:
  21. - ""
  22. resources:
  23. - nodes/status
  24. verbs:
  25. - patch
  26. ---
  27. kind: ClusterRoleBinding
  28. apiVersion: rbac.authorization.k8s.io/v1beta1
  29. metadata:
  30. name: flannel
  31. roleRef:
  32. apiGroup: rbac.authorization.k8s.io
  33. kind: ClusterRole
  34. name: flannel
  35. subjects:
  36. - kind: ServiceAccount
  37. name: flannel
  38. namespace: kube-system
  39. ---
  40. apiVersion: v1
  41. kind: ServiceAccount
  42. metadata:
  43. name: flannel
  44. namespace: kube-system
  45. ---
  46. kind: ConfigMap
  47. apiVersion: v1
  48. metadata:
  49. name: kube-flannel-cfg
  50. namespace: kube-system
  51. labels:
  52. tier: node
  53. app: flannel
  54. data:
  55. cni-conf.json: |
  56. {
  57. "name": "cbr0",
  58. "plugins": [
  59. {
  60. "type": "flannel",
  61. "delegate": {
  62. "hairpinMode": true,
  63. "isDefaultGateway": true
  64. }
  65. },
  66. {
  67. "type": "portmap",
  68. "capabilities": {
  69. "portMappings": true
  70. }
  71. }
  72. ]
  73. }
  74. net-conf.json: |
  75. {
  76. "Network": "172.17.0.0/16",
  77. "Backend": {
  78. "Type": "udp"
  79. }
  80. }
  81. ---
  82. apiVersion: extensions/v1beta1
  83. kind: DaemonSet
  84. metadata:
  85. name: kube-flannel-ds
  86. namespace: kube-system
  87. labels:
  88. tier: node
  89. app: flannel
  90. spec:
  91. template:
  92. metadata:
  93. labels:
  94. tier: node
  95. app: flannel
  96. spec:
  97. hostNetwork: true
  98. nodeSelector:
  99. beta.kubernetes.io/arch: amd64
  100. tolerations:
  101. - key: node-role.kubernetes.io/master
  102. operator: Exists
  103. effect: NoSchedule
  104. serviceAccountName: flannel
  105. initContainers:
  106. - name: install-cni
  107. image: quay.io/coreos/flannel:v0.10.0-amd64
  108. command:
  109. - cp
  110. args:
  111. - -f
  112. - /etc/kube-flannel/cni-conf.json
  113. - /etc/cni/net.d/10-flannel.conflist
  114. volumeMounts:
  115. - name: cni
  116. mountPath: /etc/cni/net.d
  117. - name: flannel-cfg
  118. mountPath: /etc/kube-flannel/
  119. containers:
  120. - name: kube-flannel
  121. image: quay.io/coreos/flannel:v0.10.0-amd64
  122. command:
  123. - /opt/bin/flanneld
  124. args:
  125. - --ip-masq
  126. - --kube-subnet-mgr
  127. resources:
  128. requests:
  129. cpu: "100m"
  130. memory: "50Mi"
  131. limits:
  132. cpu: "100m"
  133. memory: "50Mi"
  134. securityContext:
  135. privileged: true
  136. env:
  137. - name: POD_NAME
  138. valueFrom:
  139. fieldRef:
  140. fieldPath: metadata.name
  141. - name: POD_NAMESPACE
  142. valueFrom:
  143. fieldRef:
  144. fieldPath: metadata.namespace
  145. volumeMounts:
  146. - name: run
  147. mountPath: /run
  148. - name: flannel-cfg
  149. mountPath: /etc/kube-flannel/
  150. volumes:
  151. - name: run
  152. hostPath:
  153. path: /run
  154. - name: cni
  155. hostPath:
  156. path: /etc/cni/net.d
  157. - name: flannel-cfg
  158. configMap:
  159. name: kube-flannel-cfg
Add Comment
Please, Sign In to add comment