kilo-typhoon.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: kilo
  5. namespace: kube-system
  6. labels:
  7. app.kubernetes.io/name: kilo
  8. data:
  9. cni-conf.json: |
  10. {
  11. "cniVersion":"0.3.1",
  12. "name":"kilo",
  13. "plugins":[
  14. {
  15. "name":"kubernetes",
  16. "type":"bridge",
  17. "bridge":"kube-bridge",
  18. "isDefaultGateway":true,
  19. "ipam":{
  20. "type":"host-local"
  21. }
  22. },
  23. {
  24. "type":"portmap",
  25. "snat":true,
  26. "capabilities":{
  27. "portMappings":true
  28. }
  29. }
  30. ]
  31. }
  32. ---
  33. apiVersion: v1
  34. kind: ServiceAccount
  35. metadata:
  36. name: kilo
  37. namespace: kube-system
  38. ---
  39. apiVersion: rbac.authorization.k8s.io/v1
  40. kind: ClusterRole
  41. metadata:
  42. name: kilo
  43. rules:
  44. - apiGroups:
  45. - ""
  46. resources:
  47. - nodes
  48. verbs:
  49. - list
  50. - patch
  51. - watch
  52. - apiGroups:
  53. - kilo.squat.ai
  54. resources:
  55. - peers
  56. verbs:
  57. - list
  58. - update
  59. - watch
  60. - apiGroups:
  61. - apiextensions.k8s.io
  62. resources:
  63. - customresourcedefinitions
  64. verbs:
  65. - create
  66. ---
  67. apiVersion: rbac.authorization.k8s.io/v1
  68. kind: ClusterRoleBinding
  69. metadata:
  70. name: kilo
  71. roleRef:
  72. apiGroup: rbac.authorization.k8s.io
  73. kind: ClusterRole
  74. name: kilo
  75. subjects:
  76. - kind: ServiceAccount
  77. name: kilo
  78. namespace: kube-system
  79. ---
  80. apiVersion: apps/v1
  81. kind: DaemonSet
  82. metadata:
  83. name: kilo
  84. namespace: kube-system
  85. labels:
  86. app.kubernetes.io/name: kilo
  87. spec:
  88. selector:
  89. matchLabels:
  90. app.kubernetes.io/name: kilo
  91. template:
  92. metadata:
  93. labels:
  94. app.kubernetes.io/name: kilo
  95. spec:
  96. serviceAccountName: kilo
  97. hostNetwork: true
  98. containers:
  99. - name: kilo
  100. image: squat/kilo
  101. args:
  102. - --kubeconfig=/etc/kubernetes/kubeconfig
  103. - --hostname=$(NODE_NAME)
  104. env:
  105. - name: NODE_NAME
  106. valueFrom:
  107. fieldRef:
  108. fieldPath: spec.nodeName
  109. securityContext:
  110. privileged: true
  111. volumeMounts:
  112. - name: cni-conf-dir
  113. mountPath: /etc/cni/net.d
  114. - name: kilo-dir
  115. mountPath: /var/lib/kilo
  116. - name: kubeconfig
  117. mountPath: /etc/kubernetes
  118. readOnly: true
  119. initContainers:
  120. - name: install-cni
  121. image: squat/kilo
  122. command:
  123. - /bin/sh
  124. - -c
  125. - set -e -x;
  126. cp /opt/cni/bin/* /host/opt/cni/bin/;
  127. TMP_CONF="$CNI_CONF_NAME".tmp;
  128. echo "$CNI_NETWORK_CONFIG" > $TMP_CONF;
  129. rm -f /host/etc/cni/net.d/*;
  130. mv $TMP_CONF /host/etc/cni/net.d/$CNI_CONF_NAME
  131. env:
  132. - name: CNI_CONF_NAME
  133. value: 10-kilo.conflist
  134. - name: CNI_NETWORK_CONFIG
  135. valueFrom:
  136. configMapKeyRef:
  137. name: kilo
  138. key: cni-conf.json
  139. volumeMounts:
  140. - name: cni-bin-dir
  141. mountPath: /host/opt/cni/bin
  142. - name: cni-conf-dir
  143. mountPath: /host/etc/cni/net.d
  144. tolerations:
  145. - effect: NoSchedule
  146. operator: Exists
  147. - effect: NoExecute
  148. operator: Exists
  149. volumes:
  150. - name: cni-bin-dir
  151. hostPath:
  152. path: /opt/cni/bin
  153. - name: cni-conf-dir
  154. hostPath:
  155. path: /etc/kubernetes/cni/net.d
  156. - name: kilo-dir
  157. hostPath:
  158. path: /var/lib/kilo
  159. - name: kubeconfig
  160. configMap:
  161. name: kubeconfig-in-cluster