Guest User

Untitled

a guest
Mar 17th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 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. "type": "flannel",
  59. "delegate": {
  60. "isDefaultGateway": false
  61. }
  62. }
  63. net-conf.json: |
  64. {
  65. "Network": "10.244.0.0/16",
  66. "Backend": {
  67. "Type": "host-gw"
  68. }
  69. }
  70. ---
  71. apiVersion: extensions/v1beta1
  72. kind: DaemonSet
  73. metadata:
  74. name: kube-flannel-ds
  75. namespace: kube-system
  76. labels:
  77. tier: node
  78. app: flannel
  79. spec:
  80. template:
  81. metadata:
  82. labels:
  83. tier: node
  84. app: flannel
  85. spec:
  86. hostNetwork: true
  87. nodeSelector:
  88. beta.kubernetes.io/arch: amd64
  89. tolerations:
  90. - key: node-role.kubernetes.io/master
  91. operator: Exists
  92. effect: NoSchedule
  93. serviceAccountName: flannel
  94. initContainers:
  95. - name: install-cni
  96. image: quay.io/coreos/flannel:v0.9.0-amd64
  97. command:
  98. - cp
  99. args:
  100. - -f
  101. - /etc/kube-flannel/cni-conf.json
  102. - /etc/cni/net.d/10-flannel.conf
  103. volumeMounts:
  104. - name: cni
  105. mountPath: /etc/cni/net.d
  106. - name: flannel-cfg
  107. mountPath: /etc/kube-flannel/
  108. containers:
  109. - name: kube-flannel
  110. image: quay.io/coreos/flannel:v0.9.0-amd64
  111. command: [ "/opt/bin/flanneld", "--kube-subnet-mgr", "--iface=backplane1" ]
  112. securityContext:
  113. privileged: true
  114. env:
  115. - name: POD_NAME
  116. valueFrom:
  117. fieldRef:
  118. fieldPath: metadata.name
  119. - name: POD_NAMESPACE
  120. valueFrom:
  121. fieldRef:
  122. fieldPath: metadata.namespace
  123. volumeMounts:
  124. - name: run
  125. mountPath: /run
  126. - name: flannel-cfg
  127. mountPath: /etc/kube-flannel/
  128. volumes:
  129. - name: run
  130. hostPath:
  131. path: /run
  132. - name: cni
  133. hostPath:
  134. path: /etc/cni/net.d
  135. - name: flannel-cfg
  136. configMap:
  137. name: kube-flannel-cfg
Add Comment
Please, Sign In to add comment