# # Copyright (C) 2017-2025 Institute of Communication and Computer Systems (imu.iccs.gr) # # This Source Code Form is subject to the terms of the Mozilla Public License, v2.0, unless # Esper library is used, in which case it is subject to the terms of General Public License v2.0. # If a copy of the MPL was not distributed with this file, you can obtain one at # https://www.mozilla.org/en-US/MPL/2.0/ # --- apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "nebulous-monitoring.fullname" . }} labels: {{- include "nebulous-monitoring.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "nebulous-monitoring.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "nebulous-monitoring.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "nebulous-monitoring.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} terminationGracePeriodSeconds: 10 containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: {{- range .Values.env }} - name: {{ .name }} value: {{ .value | quote }} {{- end }} ports: {{- range .Values.ports }} - name: {{ .name }} containerPort: {{ .containerPort }} protocol: {{ .protocol }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} --- kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: nebulous-monitoring-role-binding subjects: - kind: ServiceAccount name: {{ include "nebulous-monitoring.serviceAccountName" . }} # namespace: default roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: nebulous-monitoring-role --- kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: nebulous-monitoring-role # Benefit of using RBAC over giving your personal access token as a secret to your application: You can pinpoint which access you want to allow rules: - apiGroups: [""] resources: ["pods", "services"] verbs: ["get", "list", "watch"]