You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.9 KiB

  1. apiVersion: apps/v1
  2. kind: DaemonSet
  3. metadata:
  4. labels:
  5. app: netchecker-agent-hostnet
  6. name: netchecker-agent-hostnet
  7. namespace: {{ netcheck_namespace }}
  8. spec:
  9. selector:
  10. matchLabels:
  11. app: netchecker-agent-hostnet
  12. template:
  13. metadata:
  14. name: netchecker-agent-hostnet
  15. labels:
  16. app: netchecker-agent-hostnet
  17. spec:
  18. hostNetwork: true
  19. dnsPolicy: ClusterFirstWithHostNet
  20. nodeSelector:
  21. kubernetes.io/os: linux
  22. priorityClassName: {% if netcheck_namespace == 'kube-system' %}system-node-critical{% else %}k8s-cluster-critical{% endif %}{{ '' }}
  23. tolerations:
  24. - effect: NoSchedule
  25. operator: Exists
  26. containers:
  27. - name: netchecker-agent
  28. image: "{{ netcheck_agent_image_repo }}:{{ netcheck_agent_image_tag }}"
  29. imagePullPolicy: {{ k8s_image_pull_policy }}
  30. env:
  31. - name: MY_POD_NAME
  32. valueFrom:
  33. fieldRef:
  34. fieldPath: metadata.name
  35. - name: MY_NODE_NAME
  36. valueFrom:
  37. fieldRef:
  38. fieldPath: spec.nodeName
  39. args:
  40. - "-v=5"
  41. - "-alsologtostderr=true"
  42. - "-serverendpoint=netchecker-service:8081"
  43. - "-reportinterval={{ agent_report_interval }}"
  44. resources:
  45. limits:
  46. cpu: {{ netchecker_agent_cpu_limit }}
  47. memory: {{ netchecker_agent_memory_limit }}
  48. requests:
  49. cpu: {{ netchecker_agent_cpu_requests }}
  50. memory: {{ netchecker_agent_memory_requests }}
  51. securityContext:
  52. runAsUser: {{ netchecker_agent_user | default('0') }}
  53. runAsGroup: {{ netchecker_agent_group | default('0') }}
  54. serviceAccountName: netchecker-agent
  55. updateStrategy:
  56. rollingUpdate:
  57. maxUnavailable: 100%
  58. type: RollingUpdate