Statefulset-grid Daemon

Statefulset-grid daemon sample config

serviceGroup/statefulset-grid-daemon.yaml

  1. ---
  2. apiVersion: v1
  3. kind: ServiceAccount
  4. metadata:
  5. name: statefulset-grid-daemon
  6. namespace: edge-system
  7. ---
  8. apiVersion: rbac.authorization.k8s.io/v1
  9. kind: ClusterRole
  10. metadata:
  11. name: statefulset-grid-daemon
  12. namespace: edge-system
  13. rules:
  14. - apiGroups:
  15. - ""
  16. resources:
  17. - nodes
  18. - services
  19. - pods
  20. verbs:
  21. - "*"
  22. - apiGroups:
  23. - extensions
  24. - apps
  25. resources:
  26. - statefulsets
  27. verbs:
  28. - "*"
  29. - apiGroups:
  30. - superedge.io
  31. resources:
  32. - statefulsetgrids
  33. verbs:
  34. - "*"
  35. ---
  36. apiVersion: rbac.authorization.k8s.io/v1
  37. kind: ClusterRoleBinding
  38. metadata:
  39. name: statefulset-grid-daemon
  40. namespace: edge-system
  41. roleRef:
  42. apiGroup: rbac.authorization.k8s.io
  43. kind: ClusterRole
  44. name: statefulset-grid-daemon
  45. subjects:
  46. - kind: ServiceAccount
  47. name: statefulset-grid-daemon
  48. namespace: edge-system
  49. ---
  50. apiVersion: v1
  51. kind: ConfigMap
  52. metadata:
  53. name: statefulset-grid-daemon
  54. namespace: edge-system
  55. data:
  56. kubeconfig.conf: |
  57. apiVersion: v1
  58. clusters:
  59. - cluster:
  60. certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
  61. server: https://127.0.0.1:51003
  62. name: default
  63. contexts:
  64. - context:
  65. cluster: default
  66. namespace: default
  67. user: default
  68. name: default
  69. current-context: default
  70. kind: Config
  71. preferences: {}
  72. users:
  73. - name: default
  74. user:
  75. tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
  76. ---
  77. apiVersion: apps/v1
  78. kind: DaemonSet
  79. metadata:
  80. labels:
  81. k8s-app: statefulset-grid-daemon
  82. addonmanager.kubernetes.io/mode: Reconcile
  83. name: statefulset-grid-daemon
  84. namespace: edge-system
  85. spec:
  86. selector:
  87. matchLabels:
  88. k8s-app: statefulset-grid-daemon
  89. template:
  90. metadata:
  91. labels:
  92. k8s-app: statefulset-grid-daemon
  93. spec:
  94. serviceAccount: statefulset-grid-daemon
  95. serviceAccountName: statefulset-grid-daemon
  96. priorityClassName: system-node-critical
  97. hostNetwork: true
  98. restartPolicy: Always
  99. nodeSelector:
  100. kubernetes.io/os: linux # TODO select edge node
  101. tolerations:
  102. - key: "node-role.kubernetes.io/master"
  103. operator: "Exists"
  104. effect: "NoSchedule"
  105. containers:
  106. - name: statefulset-grid-daemon
  107. image: superedge/statefulset-grid-daemon:v0.3.0
  108. imagePullPolicy: IfNotPresent
  109. command:
  110. - /usr/local/bin/statefulset-grid-daemon
  111. - --hostname=$(NODE_NAME)
  112. - --kubeconfig=/var/lib/statefulset-grid-daemon/kubeconfig.conf
  113. env:
  114. - name: NODE_NAME
  115. valueFrom:
  116. fieldRef:
  117. apiVersion: v1
  118. fieldPath: spec.nodeName
  119. resources:
  120. limits:
  121. cpu: 50m
  122. memory: 100Mi
  123. requests:
  124. cpu: 10m
  125. memory: 20Mi
  126. securityContext:
  127. privileged: true
  128. volumeMounts:
  129. - mountPath: /data/edge
  130. name: hosts
  131. - mountPath: /var/lib/statefulset-grid-daemon
  132. name: statefulset-grid-daemon
  133. volumes:
  134. - configMap:
  135. defaultMode: 420
  136. name: statefulset-grid-daemon
  137. name: statefulset-grid-daemon
  138. - hostPath:
  139. path: /data/edge
  140. type: DirectoryOrCreate
  141. name: hosts

Last modified June 15, 2021 : Fixed error links and paths (fef537b)