diff --git a/charts/nobl9-agent/README.md b/charts/nobl9-agent/README.md index 15aaede..1ef5af0 100644 --- a/charts/nobl9-agent/README.md +++ b/charts/nobl9-agent/README.md @@ -22,25 +22,26 @@ Agent to retrieve SLI metrics from configured data sources and send the data bac |-----|------|---------|-------------| | config.allowedUrls | string | `nil` | Populates N9_ALLOWED_URLS that limits the URLs which an Agent is able to query | | config.authServer | string | `"auseg9kiegWKEtJZC416"` | Nobl9 Auth Server ID | -| config.clientId | string | `""` | Nobl9 Client ID, creates secret with this value, leave empty and use deployment.extraEnvs to load from existing Secret | -| config.clientSecret | string | `""` | Nobl9 Client secret, creates secret with this value, leave empty and use deployment.extraEnvs to load from existing Secret | -| config.datasourceName | string | `""` | Nobl9 Data Source name | -| config.intakeUrl | string | `"https://nobl9.com/api/input"` | Nobl9 API URL | +| config.clientId | string | `nil` | Nobl9 Client ID, creates secret with this value, leave empty and use deployment.extraEnvs to load from existing Secret | +| config.clientSecret | string | `nil` | Nobl9 Client secret, creates secret with this value, leave empty and use deployment.extraEnvs to load from existing Secret | +| config.datasourceName | string | `nil` | Nobl9 Data Source name | +| config.intakeUrl | string | `"https://app.nobl9.com/api/input"` | Nobl9 API URL | | config.oktaOrgUrl | string | `"https://accounts.nobl9.com"` | Nobl9 Okta Organization URL | -| config.organization | string | `""` | Nobl9 Organization name | -| config.project | string | `"default"` | Nobl9 Project name | +| config.organization | string | `nil` | Nobl9 Organization name | +| config.project | string | `nil` | Nobl9 Project name | | deployment.annotations | object | `{}` | Custom annotations | | deployment.extraEnvs | string | `nil` | Additional Envs | -| deployment.extraLabels | object | `{}` | Additional Labels | | deployment.image | string | `"nobl9/agent"` | Image used by chart | | deployment.pullPolicy | string | `"Always"` | Image Pull Policy | -| deployment.version | string | `"0.48.0"` | Agent version (image tag) | -| namespaceOverride | string | `nil` | Override the namespace | +| deployment.version | string | `"0.51.2"` | Agent version (image tag) | +| extraLabels | object | `{}` | | +| namespaceOverride | string | `nil` | Override the Namespace | | resources.limits.cpu | string | `"1.0"` | CPU limit | | resources.limits.memory | string | `"1Gi"` | Memory limit | | resources.requests.cpu | string | `"0.1"` | CPU request | | resources.requests.memory | string | `"350Mi"` | Memory request | | secret.extraData | string | `nil` | Extra stringData to be included in secret, use deployment.extraEnvs to load as deployment Envs | +| secret.nameOverride | string | `nil` | Override the Secret name | | securityContext.allowPrivilegeEscalation | bool | `false` | Grants container a privileged status if set to true | | securityContext.readOnlyRootFilesystem | bool | `true` | ReadOnly file system mode if set to true | | securityContext.runAsNonRoot | bool | `true` | Runs the container as a root user if set to false | diff --git a/charts/nobl9-agent/templates/_helpers.tpl b/charts/nobl9-agent/templates/_helpers.tpl index 6813e3f..e327197 100644 --- a/charts/nobl9-agent/templates/_helpers.tpl +++ b/charts/nobl9-agent/templates/_helpers.tpl @@ -37,3 +37,46 @@ Allow the release namespace to be overridden for multi-namespace deployments in {{- .Release.Namespace -}} {{- end -}} {{- end -}} + +{{/* +Allow the secret name to be overridden +*/}} +{{- define "nobl9-agent.secret.name" -}} + {{- if .Values.secret.nameOverride -}} + {{- .Values.secret.nameOverride -}} + {{- else -}} + {{ template "nobl9-agent.fullname" . }} + {{- end -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "nobl9-agent.labels" -}} +helm.sh/chart: {{ include "nobl9-agent.chart" . }} +{{ include "nobl9-agent.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.extraLabels }} +{{ toYaml .Values.extraLabels }} +{{- end }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "nobl9-agent.selectorLabels" -}} +app.kubernetes.io/name: {{ include "nobl9-agent.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Values.config.datasourceName }} +nobl9.com/agent-datasource-name: {{ .Values.config.datasourceName }} +{{- end }} +{{- if .Values.config.project }} +nobl9.com/agent-project: {{ .Values.config.project }} +{{- end }} +{{- if .Values.config.organization }} +nobl9.com/agent-organization: {{ .Values.config.organization }} +{{- end }} +{{- end -}} diff --git a/charts/nobl9-agent/templates/deployment.yaml b/charts/nobl9-agent/templates/deployment.yaml index 3e9ebf6..538a665 100644 --- a/charts/nobl9-agent/templates/deployment.yaml +++ b/charts/nobl9-agent/templates/deployment.yaml @@ -4,22 +4,12 @@ metadata: name: {{ template "nobl9-agent.fullname" . }} namespace: {{ template "nobl9-agent.namespace" . }} labels: - helm.sh/chart: {{ template "nobl9-agent.chart" . }} - app.kubernetes.io/name: {{ template "nobl9-agent.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} - {{- with .Values.deployment.extraLabels }} - {{ toYaml . | nindent 4 }} - {{- end }} + {{- include "nobl9-agent.labels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/name: {{ template "nobl9-agent.name" . }} - nobl9.com/agent-name: {{ .Values.config.datasourceName | quote }} - nobl9.com/agent-project: {{ .Values.config.project | quote }} - nobl9.com/agent-organization: {{ .Values.config.organization | quote }} + {{- include "nobl9-agent.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.deployment.annotations }} @@ -27,13 +17,7 @@ spec: {{ toYaml . | nindent 8 }} {{- end }} labels: - app.kubernetes.io/name: {{ template "nobl9-agent.name" . }} - nobl9.com/agent-name: {{ .Values.config.datasourceName | quote }} - nobl9.com/agent-project: {{ .Values.config.project | quote }} - nobl9.com/agent-organization: {{ .Values.config.organization | quote }} - {{- with .Values.extraLabels }} - {{ toYaml . | nindent 8 }} - {{- end }} + {{- include "nobl9-agent.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/charts/nobl9-agent/templates/secret.yaml b/charts/nobl9-agent/templates/secret.yaml index fc02602..761ba6f 100644 --- a/charts/nobl9-agent/templates/secret.yaml +++ b/charts/nobl9-agent/templates/secret.yaml @@ -2,14 +2,10 @@ apiVersion: v1 kind: Secret metadata: - name: {{ template "nobl9-agent.fullname" . }} + name: {{ template "nobl9-agent.secret.name" . }} namespace: {{ template "nobl9-agent.namespace" . }} labels: - helm.sh/chart: {{ template "nobl9-agent.chart" . }} - app.kubernetes.io/name: {{ template "nobl9-agent.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + {{- include "nobl9-agent.labels" . | nindent 4 }} type: Opaque stringData: {{- if .Values.config.clientId }} diff --git a/charts/nobl9-agent/values.yaml b/charts/nobl9-agent/values.yaml index f146108..88819b4 100644 --- a/charts/nobl9-agent/values.yaml +++ b/charts/nobl9-agent/values.yaml @@ -1,11 +1,12 @@ -# -- Override the namespace +# -- Override the Namespace namespaceOverride: +extraLabels: {} deployment: # -- Image used by chart - image: "nobl9/agent" + image: nobl9/agent # -- Agent version (image tag) - version: "0.48.0" + version: "0.51.2" # -- Image Pull Policy pullPolicy: Always # -- Additional Envs @@ -30,9 +31,10 @@ deployment: # -- Custom annotations annotations: {} # -- Additional Labels - extraLabels: {} secret: + # -- Override the Secret name + nameOverride: # -- Extra stringData to be included in secret, use deployment.extraEnvs to load as deployment Envs extraData: # splunk_api_token: my-api-token @@ -61,18 +63,18 @@ securityContext: config: # -- Nobl9 Project name - project: "default" + project: # -- Nobl9 Organization name - organization: "" + organization: # -- Nobl9 Data Source name - datasourceName: "" + datasourceName: # -- Nobl9 Client ID, creates secret with this value, leave empty and use deployment.extraEnvs to load from existing Secret - clientId: "" + clientId: # -- Nobl9 Client secret, creates secret with this value, leave empty and use deployment.extraEnvs to load from existing Secret - clientSecret: "" + clientSecret: # -- Nobl9 API URL - intakeUrl: "https://nobl9.com/api/input" + intakeUrl: "https://app.nobl9.com/api/input" # -- Nobl9 Auth Server ID authServer: "auseg9kiegWKEtJZC416" # -- Nobl9 Okta Organization URL