ApplicationGrid Wrapper

ApplicationGrid wrapper 配置示例

serviceGroup/application-grid-wrapper.yaml

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

最后修改 June 15, 2021 : Fixed error links and paths (fef537b)