rancher.yaml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. ---
  2. apiVersion: rbac.authorization.k8s.io/v1
  3. kind: ClusterRole
  4. metadata:
  5. name: proxy-clusterrole-kubeapiserver
  6. rules:
  7. - apiGroups: [""]
  8. resources:
  9. - nodes/metrics
  10. - nodes/proxy
  11. - nodes/stats
  12. - nodes/log
  13. - nodes/spec
  14. verbs: ["get", "list", "watch", "create"]
  15. ---
  16. apiVersion: rbac.authorization.k8s.io/v1
  17. kind: ClusterRoleBinding
  18. metadata:
  19. name: proxy-role-binding-kubernetes-master
  20. roleRef:
  21. apiGroup: rbac.authorization.k8s.io
  22. kind: ClusterRole
  23. name: proxy-clusterrole-kubeapiserver
  24. subjects:
  25. - apiGroup: rbac.authorization.k8s.io
  26. kind: User
  27. name: kube-apiserver
  28. ---
  29. apiVersion: v1
  30. kind: Namespace
  31. metadata:
  32. name: cattle-system
  33. ---
  34. apiVersion: v1
  35. kind: ServiceAccount
  36. metadata:
  37. name: cattle
  38. namespace: cattle-system
  39. ---
  40. apiVersion: rbac.authorization.k8s.io/v1
  41. kind: ClusterRoleBinding
  42. metadata:
  43. name: cattle-admin-binding
  44. namespace: cattle-system
  45. labels:
  46. cattle.io/creator: "norman"
  47. subjects:
  48. - kind: ServiceAccount
  49. name: cattle
  50. namespace: cattle-system
  51. roleRef:
  52. kind: ClusterRole
  53. name: cattle-admin
  54. apiGroup: rbac.authorization.k8s.io
  55. ---
  56. apiVersion: v1
  57. kind: Secret
  58. metadata:
  59. name: cattle-credentials-80151d8
  60. namespace: cattle-system
  61. type: Opaque
  62. data:
  63. url: "aHR0cHM6Ly9rOHMtc2VydmVy"
  64. token: "azR0Nzk2ZDZjc2dka3pyOXJ3MjR2dDdwZzlzNW16bG45dzRxNWQ3d2w2bHZsdHY0Y3RoMjU4"
  65. namespace: ""
  66. ---
  67. apiVersion: rbac.authorization.k8s.io/v1
  68. kind: ClusterRole
  69. metadata:
  70. name: cattle-admin
  71. labels:
  72. cattle.io/creator: "norman"
  73. rules:
  74. - apiGroups:
  75. - '*'
  76. resources:
  77. - '*'
  78. verbs:
  79. - '*'
  80. - nonResourceURLs:
  81. - '*'
  82. verbs:
  83. - '*'
  84. ---
  85. apiVersion: apps/v1
  86. kind: Deployment
  87. metadata:
  88. name: cattle-cluster-agent
  89. namespace: cattle-system
  90. spec:
  91. selector:
  92. matchLabels:
  93. app: cattle-cluster-agent
  94. template:
  95. metadata:
  96. labels:
  97. app: cattle-cluster-agent
  98. spec:
  99. affinity:
  100. nodeAffinity:
  101. requiredDuringSchedulingIgnoredDuringExecution:
  102. nodeSelectorTerms:
  103. - matchExpressions:
  104. - key: kubernetes.io/os
  105. operator: NotIn
  106. values:
  107. - windows
  108. preferredDuringSchedulingIgnoredDuringExecution:
  109. - weight: 100
  110. preference:
  111. matchExpressions:
  112. - key: node-role.kubernetes.io/controlplane
  113. operator: In
  114. values:
  115. - "true"
  116. - weight: 1
  117. preference:
  118. matchExpressions:
  119. - key: node-role.kubernetes.io/etcd
  120. operator: In
  121. values:
  122. - "true"
  123. serviceAccountName: cattle
  124. tolerations:
  125. - operator: Exists
  126. containers:
  127. - name: cluster-register
  128. imagePullPolicy: IfNotPresent
  129. env:
  130. - name: CATTLE_FEATURES
  131. value: ""
  132. - name: CATTLE_SERVER
  133. value: "https://k8s-server"
  134. - name: CATTLE_CA_CHECKSUM
  135. value: "80133263142ecf49684f5a72e13c9ac613fce40afb85514123875530b55704dd"
  136. - name: CATTLE_CLUSTER
  137. value: "true"
  138. - name: CATTLE_K8S_MANAGED
  139. value: "true"
  140. image: rancher/rancher-agent:v2.4.18
  141. volumeMounts:
  142. - name: cattle-credentials
  143. mountPath: /cattle-credentials
  144. readOnly: true
  145. volumes:
  146. - name: cattle-credentials
  147. secret:
  148. secretName: cattle-credentials-80151d8
  149. defaultMode: 320
  150. ---
  151. apiVersion: apps/v1
  152. kind: DaemonSet
  153. metadata:
  154. name: cattle-node-agent
  155. namespace: cattle-system
  156. spec:
  157. selector:
  158. matchLabels:
  159. app: cattle-agent
  160. template:
  161. metadata:
  162. labels:
  163. app: cattle-agent
  164. spec:
  165. affinity:
  166. nodeAffinity:
  167. requiredDuringSchedulingIgnoredDuringExecution:
  168. nodeSelectorTerms:
  169. - matchExpressions:
  170. - key: kubernetes.io/os
  171. operator: NotIn
  172. values:
  173. - windows
  174. hostNetwork: true
  175. serviceAccountName: cattle
  176. tolerations:
  177. - operator: Exists
  178. containers:
  179. - name: agent
  180. image: rancher/rancher-agent:v2.4.18
  181. imagePullPolicy: IfNotPresent
  182. env:
  183. - name: CATTLE_NODE_NAME
  184. valueFrom:
  185. fieldRef:
  186. fieldPath: spec.nodeName
  187. - name: CATTLE_SERVER
  188. value: "https://k8s-server"
  189. - name: CATTLE_CA_CHECKSUM
  190. value: "80133263142ecf49684f5a72e13c9ac613fce40afb85514123875530b55704dd"
  191. - name: CATTLE_CLUSTER
  192. value: "false"
  193. - name: CATTLE_K8S_MANAGED
  194. value: "true"
  195. - name: CATTLE_AGENT_CONNECT
  196. value: "true"
  197. volumeMounts:
  198. - name: cattle-credentials
  199. mountPath: /cattle-credentials
  200. readOnly: true
  201. - name: k8s-ssl
  202. mountPath: /etc/kubernetes
  203. - name: var-run
  204. mountPath: /var/run
  205. - name: run
  206. mountPath: /run
  207. - name: docker-certs
  208. mountPath: /etc/docker/certs.d
  209. securityContext:
  210. privileged: true
  211. volumes:
  212. - name: k8s-ssl
  213. hostPath:
  214. path: /etc/kubernetes
  215. type: DirectoryOrCreate
  216. - name: var-run
  217. hostPath:
  218. path: /var/run
  219. type: DirectoryOrCreate
  220. - name: run
  221. hostPath:
  222. path: /run
  223. type: DirectoryOrCreate
  224. - name: cattle-credentials
  225. secret:
  226. secretName: cattle-credentials-80151d8
  227. defaultMode: 320
  228. - hostPath:
  229. path: /etc/docker/certs.d
  230. type: DirectoryOrCreate
  231. name: docker-certs
  232. updateStrategy:
  233. type: RollingUpdate
  234. rollingUpdate:
  235. maxUnavailable: 25%