Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRE-862-Update-default-variables #9

Merged
merged 8 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions charts/nobl9-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
43 changes: 43 additions & 0 deletions charts/nobl9-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
22 changes: 3 additions & 19 deletions charts/nobl9-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,20 @@ 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 }}
annotations:
{{ 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:
Expand Down
8 changes: 2 additions & 6 deletions charts/nobl9-agent/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
22 changes: 12 additions & 10 deletions charts/nobl9-agent/values.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down