kilo-kubeadm-cilium.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4. name: kilo
  5. namespace: kube-system
  6. ---
  7. apiVersion: rbac.authorization.k8s.io/v1
  8. kind: ClusterRole
  9. metadata:
  10. name: kilo
  11. rules:
  12. - apiGroups:
  13. - ""
  14. resources:
  15. - nodes
  16. verbs:
  17. - list
  18. - patch
  19. - watch
  20. - apiGroups:
  21. - kilo.squat.ai
  22. resources:
  23. - peers
  24. verbs:
  25. - list
  26. - watch
  27. - apiGroups:
  28. - apiextensions.k8s.io
  29. resources:
  30. - customresourcedefinitions
  31. verbs:
  32. - get
  33. ---
  34. apiVersion: rbac.authorization.k8s.io/v1
  35. kind: ClusterRoleBinding
  36. metadata:
  37. name: kilo
  38. roleRef:
  39. apiGroup: rbac.authorization.k8s.io
  40. kind: ClusterRole
  41. name: kilo
  42. subjects:
  43. - kind: ServiceAccount
  44. name: kilo
  45. namespace: kube-system
  46. ---
  47. apiVersion: apps/v1
  48. kind: DaemonSet
  49. metadata:
  50. name: kilo
  51. namespace: kube-system
  52. labels:
  53. app.kubernetes.io/name: kilo
  54. app.kubernetes.io/part-of: kilo
  55. spec:
  56. selector:
  57. matchLabels:
  58. app.kubernetes.io/name: kilo
  59. app.kubernetes.io/part-of: kilo
  60. template:
  61. metadata:
  62. labels:
  63. app.kubernetes.io/name: kilo
  64. app.kubernetes.io/part-of: kilo
  65. spec:
  66. serviceAccountName: kilo
  67. hostNetwork: true
  68. containers:
  69. - name: kilo
  70. image: squat/kilo:0.7.0
  71. args:
  72. - --kubeconfig=/etc/kubernetes/kubeconfig
  73. - --hostname=$(NODE_NAME)
  74. - --cni=false
  75. - --compatibility=cilium
  76. - --local=false
  77. # additional and also optional flag
  78. - --encapsulate=crosssubnet
  79. - --clean-up-interface=true
  80. - --subnet=172.31.254.0/24
  81. - --log-level=all
  82. - --internal-cidr=$(NODE_IP)/32
  83. env:
  84. - name: NODE_NAME
  85. valueFrom:
  86. fieldRef:
  87. fieldPath: spec.nodeName
  88. - name: NODE_IP
  89. valueFrom:
  90. fieldRef:
  91. fieldPath: status.hostIP
  92. ports:
  93. - containerPort: 1107
  94. name: metrics
  95. securityContext:
  96. privileged: true
  97. volumeMounts:
  98. - name: kilo-dir
  99. mountPath: /var/lib/kilo
  100. # without kube-proxy host kubeconfig binding
  101. - name: kubeconfig
  102. # with kube-proxy configmap
  103. # - name: kubeconfig
  104. # mountPath: /etc/kubernetes
  105. # readOnly: true
  106. mountPath: /etc/kubernetes/kubeconfig
  107. subPath: admin.conf
  108. readOnly: true
  109. - name: lib-modules
  110. mountPath: /lib/modules
  111. readOnly: true
  112. - name: xtables-lock
  113. mountPath: /run/xtables.lock
  114. readOnly: false
  115. tolerations:
  116. - effect: NoSchedule
  117. operator: Exists
  118. - effect: NoExecute
  119. operator: Exists
  120. volumes:
  121. - name: kilo-dir
  122. hostPath:
  123. path: /var/lib/kilo
  124. # without kube-proxy host kubeconfig binding
  125. - name: kubeconfig
  126. # with kube-proxy configmap
  127. # - name: kubeconfig
  128. # configMap:
  129. # name: kube-proxy
  130. # items:
  131. # - key: kubeconfig.conf
  132. # path: kubeconfig
  133. hostPath:
  134. path: /etc/kubernetes
  135. - name: lib-modules
  136. hostPath:
  137. path: /lib/modules
  138. - name: xtables-lock
  139. hostPath:
  140. path: /run/xtables.lock
  141. type: FileOrCreate