diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 2c94423a6507bc6df0e7222a584a9f2b647e257f..ded32135655fe5c41f403b36d305c83165509269 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -9,7 +9,7 @@ description: |- type: application -version: 2.0.9-bb.2 +version: 2.0.9-bb.3 appVersion: 2.0.9 diff --git a/chart/templates/minio-vs.yaml b/chart/templates/minio-vs.yaml index 156e3d476c497693b1a1a8752165552548934232..8d96f72b9fad942d0a02fc4c8d0dd9a5a23b40ab 100644 --- a/chart/templates/minio-vs.yaml +++ b/chart/templates/minio-vs.yaml @@ -10,7 +10,23 @@ spec: hosts: - {{ .Values.istio.virtualService.name }}.{{ .Values.hostname }} http: - - route: + - match: + - uri: + prefix: /minio/prometheus/metrics + route: + - destination: + host: {{ include "minio.fullname" . }} + port: + number: {{ .Values.service.port }} + fault: + abort: + percentage: + value: 100 + httpStatus: 403 + - match: + - uri: + prefix: / + route: - destination: host: {{ include "minio.fullname" . }} port: diff --git a/chart/templates/minioinstance.yaml b/chart/templates/minioinstance.yaml index 40306e680b01588783d1084417e2d5d3f81df23a..17ba74fa571043c1fdb227b8b949b4fc1a33c22f 100644 --- a/chart/templates/minioinstance.yaml +++ b/chart/templates/minioinstance.yaml @@ -78,7 +78,9 @@ spec: # operator: Equal # value: storage ## Add environment variables to be set in MinIO container (https://github.com/minio/minio/tree/master/docs/config) - # env: + env: + - name: MINIO_PROMETHEUS_AUTH_TYPE + value: "public" # - name: MINIO_BROWSER # value: "off" # to turn-off browser # - name: MINIO_STORAGE_CLASS_STANDARD diff --git a/chart/templates/role.yaml b/chart/templates/role.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a45547bf96c1bb8750dd6447fe89e5ce67a0d442 --- /dev/null +++ b/chart/templates/role.yaml @@ -0,0 +1,23 @@ +{{- if .Values.monitoring.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleList +items: +- apiVersion: rbac.authorization.k8s.io/v1 + kind: Role + metadata: + name: prometheus-k8s + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/component: "monitoring" + rules: + - apiGroups: + - "" + resources: + - services + - endpoints + - pods + verbs: + - get + - list + - watch +{{- end }} diff --git a/chart/templates/rolebinding.yaml b/chart/templates/rolebinding.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ef303a8af8f05a9cead39cd821fc9e0eb2345e50 --- /dev/null +++ b/chart/templates/rolebinding.yaml @@ -0,0 +1,20 @@ +{{- if .Values.monitoring.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBindingList +items: +- apiVersion: rbac.authorization.k8s.io/v1 + kind: RoleBinding + metadata: + name: prometheus-k8s + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/component: "monitoring" + roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: prometheus-k8s + subjects: + - kind: ServiceAccount + name: prometheus-k8s + namespace: {{ .Values.monitoring.namespace }} +{{- end }} diff --git a/chart/templates/serviceMonitor.yaml b/chart/templates/serviceMonitor.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a9a1e57dd6681b685c693e529e847eadd262cdf6 --- /dev/null +++ b/chart/templates/serviceMonitor.yaml @@ -0,0 +1,25 @@ +{{- if .Values.monitoring.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + prometheus: k8s + release: monitoring + {{ include "minio.labels" . | nindent 4 }} + app.kubernetes.io/component: "monitoring" + name: minio-metrics + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + {{- include "minio.selectorLabels" . | nindent 6 }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + endpoints: + - interval: 30s + port: http + scheme: http + path: /minio/prometheus/metrics + jobLabel: minio +{{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index 1e6dff842c74d705b08eec5ba26b00ad724a8a33..d38115211c55ca35cab7762d18a401e467151e36 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -51,4 +51,6 @@ istio: enabled: true name: minio - +monitoring: + enabled: false + namespace: monitoring diff --git a/tests/test-values.yml b/tests/test-values.yml index 7640ac2b6372dbb84c49c3df85302be28aa4d854..f73e391ea9f8be954b1eb1ccb261e9f5fabb7dcd 100644 --- a/tests/test-values.yml +++ b/tests/test-values.yml @@ -22,4 +22,16 @@ volumeClaimTemplate: minioUICreds: default-minio-creds-secret imagePullSecrets: - - name: private-registry-mil \ No newline at end of file + - name: private-registry-mil + +hostname: bigbang.dev + +istio: + enabled: true + virtualService: + enabled: true + name: minio + +monitoring: + enabled: false + namespace: monitoring