deployment.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. {{ include "common.storage.hostPathValidate" .Values }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ template "netdata.name" . }}
  6. labels:
  7. app: {{ template "netdata.name" . }}
  8. chart: {{ template "netdata.chart" . }}
  9. release: {{ .Release.Name }}
  10. heritage: {{ .Release.Service }}
  11. role: parent
  12. spec:
  13. replicas: 1
  14. strategy:
  15. type: Recreate
  16. selector:
  17. matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
  18. template:
  19. metadata:
  20. labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
  21. annotations:
  22. rollme: {{ randAlphaNum 5 | quote }}
  23. spec:
  24. securityContext:
  25. fsGroup: 201
  26. serviceAccountName: {{ .Release.Name }}
  27. containers:
  28. - name: {{ .Chart.Name }}
  29. image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}"
  30. imagePullPolicy: {{ .Values.image.pullPolicy }}
  31. {{ include "common.resources.limitation" . | nindent 10 }}
  32. env:
  33. {{ $envList := (default list .Values.environmentVariables) }}
  34. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  35. ports:
  36. - name: http
  37. containerPort: 19999
  38. protocol: TCP
  39. livenessProbe:
  40. httpGet:
  41. path: /api/v1/info
  42. port: http
  43. initialDelaySeconds: 10
  44. periodSeconds: 10
  45. timeoutSeconds: 5
  46. failureThreshold: 5
  47. successThreshold: 1
  48. readinessProbe:
  49. httpGet:
  50. path: /api/v1/info
  51. port: http
  52. initialDelaySeconds: 10
  53. periodSeconds: 10
  54. timeoutSeconds: 5
  55. failureThreshold: 5
  56. successThreshold: 2
  57. startupProbe:
  58. httpGet:
  59. path: /api/v1/info
  60. port: http
  61. initialDelaySeconds: 10
  62. periodSeconds: 5
  63. timeoutSeconds: 2
  64. failureThreshold: 60
  65. successThreshold: 1
  66. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
  67. - name: os-release
  68. mountPath: /host/etc/os-release
  69. readOnly: true
  70. - name: sys
  71. mountPath: /host/sys
  72. readOnly: true
  73. - name: proc
  74. mountPath: /host/proc
  75. readOnly: true
  76. - name: user
  77. mountPath: /host/etc/passwd
  78. readOnly: true
  79. - name: group
  80. mountPath: /host/etc/group
  81. readOnly: true
  82. securityContext:
  83. capabilities:
  84. add:
  85. - SYS_PTRACE
  86. terminationGracePeriodSeconds: 60
  87. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  88. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  89. - name: os-release
  90. hostPath:
  91. path: /etc/os-release
  92. - name: proc
  93. hostPath:
  94. path: /proc
  95. - name: sys
  96. hostPath:
  97. path: /sys
  98. - name: user
  99. hostPath:
  100. path: /etc/passwd
  101. - name: group
  102. hostPath:
  103. path: /etc/group