Skip to content

Commit

Permalink
feat(rel-argus-7.0.0): release argus 7.0.0 charts (#116)
Browse files Browse the repository at this point in the history
Co-authored-by: Shubhashri Shirode <shubhashri.shirode@logicmonitor.com>
  • Loading branch information
shubhashri12 and lmshubhashri authored Sep 14, 2023
1 parent 0236b73 commit f2cae98
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 45 deletions.
6 changes: 3 additions & 3 deletions charts/argus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ maintainers:
- email: argus@logicmonitor.com
name: LogicMonitor
name: argus
version: 6.3.0
version: 7.0.0
home: https://logicmonitor.github.io/helm-charts
appVersion: v11.3.0
appVersion: v11.4.0
dependencies:
- name: lmutil
repository: https://logicmonitor.github.io/helm-charts
# repository: file://../lmutil
version: 0.1.6
version: 0.1.9
60 changes: 59 additions & 1 deletion charts/argus/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,62 @@ Collector Pod security context
capabilities:
drop: {{ toYaml .Values.collector.securityContext.capabilities.drop | nindent 4 }}
add: {{ toYaml $addCaps | nindent 4 }}
{{- end }}
{{- end }}

{{/*
LM Credentials and Proxy Details.
The user can provide proxy details in values.yaml or by creating user defined secret.
Argus proxy takes precendence over the global proxy. We need to check if the user defined secret contains
Argus proxy details or not, for this we're using Lookup function in helm.
*/}}
{{- define "lm-credentials-and-proxy-details" -}}
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace .Values.global.userDefinedSecret) | default dict }}
{{- $secretData := (get $secretObj "data") | default dict }}
{{- $data := dict "root" . "secretdata" $secretData }}
{{- include "lmutil.validate-user-provided-secret" $data }}
- name: ACCESS_ID
valueFrom:
secretKeyRef:
name: {{ include "lmutil.secret-name" . }}
key: accessID
- name: ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ include "lmutil.secret-name" . }}
key: accessKey
- name: ACCOUNT
valueFrom:
secretKeyRef:
name: {{ include "lmutil.secret-name" . }}
key: account
{{- if $secretData.etcdDiscoveryToken }}
- name: ETCD_DISCOVERY_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "lmutil.secret-name" . }}
key: etcdDiscoveryToken
{{- end }}
{{- if or $secretData.argusProxyUser $secretData.proxyUser .Values.proxy.user .Values.global.proxy.user }}
- name: PROXY_USER
valueFrom:
secretKeyRef:
name: {{ include "lmutil.secret-name" . }}
{{- if $secretData.argusProxyUser }}
key: argusProxyUser
{{- else }}
key: proxyUser
{{- end }}
{{- end }}
{{- if or $secretData.argusProxyPass $secretData.proxyPass .Values.proxy.pass .Values.global.proxy.pass }}
- name: PROXY_PASS
valueFrom:
secretKeyRef:
name: {{ include "lmutil.secret-name" . }}
{{- if $secretData.argusProxyPass }}
key: argusProxyPass
{{- else }}
key: proxyPass
{{- end }}
{{- end }}
{{- end }}
16 changes: 10 additions & 6 deletions charts/argus/templates/collectorset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,22 @@ spec:
{{- if .Values.collector.useEA }}
useEA: {{ .Values.collector.useEA }}
{{- end }}
{{/* TODO: create a function for the below logic */}}
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace .Values.global.userDefinedSecret) | default dict }}
{{- $secretData := (get $secretObj "data") | default dict }}
{{- if or $secretData.collectorProxyUser $secretData.proxyUser }}
secretName: {{ .Values.global.userDefinedSecret }}
{{- else if and (not (empty .Values.collector.proxy.user)) (empty .Values.global.userDefinedSecret ) }}
secretName: {{ include "lmutil.fullname" . }}-collector
{{- else if and (not (empty .Values.global.proxy.user)) (empty .Values.global.userDefinedSecret ) }}
secretName: {{ include "lmutil.fullname" . }}-collector
{{- end }}
{{- if .Values.collector.proxy.url }}
proxy:
url: {{ .Values.collector.proxy.url }}
{{- if .Values.collector.proxy.user }}
secretName: {{ include "lmutil.fullname" . }}-collector
{{- end }}
{{- else if .Values.global.proxy.url }}
proxy:
url: {{ .Values.global.proxy.url }}
{{- if .Values.global.proxy.user }}
secretName: {{ include "lmutil.fullname" . }}-collector
{{- end }}
{{- end }}
labels:
{{- include "collector.labels" . | nindent 4 }}
Expand Down
35 changes: 1 addition & 34 deletions charts/argus/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,37 +82,4 @@ spec:
value: {{ template "lmutil.name" . }}
- name: APP_KUBERNETES_IO_INSTANCE
value: {{ .Release.Name }}
- name: ACCESS_ID
valueFrom:
secretKeyRef:
name: {{ include "lmutil.fullname" . }}
key: accessID
- name: ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ include "lmutil.fullname" . }}
key: accessKey
- name: ACCOUNT
valueFrom:
secretKeyRef:
name: {{ include "lmutil.fullname" . }}
key: account
- name: ETCD_DISCOVERY_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "lmutil.fullname" . }}
key: etcdDiscoveryToken
{{- if .Values.proxy.user }}
- name: PROXY_USER
valueFrom:
secretKeyRef:
name: {{ include "lmutil.fullname" . }}
key: proxyUser
{{- end }}
{{- if .Values.proxy.pass }}
- name: PROXY_PASS
valueFrom:
secretKeyRef:
name: {{ include "lmutil.fullname" . }}
key: proxyPass
{{- end }}
{{ include "lm-credentials-and-proxy-details" . | nindent 12 }}
2 changes: 2 additions & 0 deletions charts/argus/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.global.userDefinedSecret -}}
apiVersion: v1
kind: Secret
metadata:
Expand Down Expand Up @@ -52,3 +53,4 @@ data:
proxyPass: {{ default "" .Values.global.proxy.pass | b64enc }}
{{- end }}
{{- end }}
{{- end }}
10 changes: 9 additions & 1 deletion charts/argus/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@
"image": {
"pullPolicy": "Always"
},
"collectorsetServiceNameSuffix": ""
"collectorsetServiceNameSuffix": "",
"userDefinedSecret": ""
},
"nameOverride": "",
"fullnameOverride": "",
Expand Down Expand Up @@ -2390,6 +2391,13 @@
"type": "string",
"default": "",
"description": "Suffix to be added to .Release.name to generate Collectorset controller service URL.\nKeep it empty while installing this chart individually, umbrella chart uses this to generate unique name across."
},
"userDefinedSecret": {
"$id": "#/properties/global/properties/userDefinedSecret",
"$comment": "tf:optional",
"type": "string",
"default": "",
"description": "User can provide LM credentials in a Secret instead of plain text. The secret should contain 'accessID', 'accessKey', 'account' along with optional params e.g. 'etcdDiscoveryToken', proxy credentials"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions charts/argus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ global:
repository: ""
pullPolicy: Always
collectorsetServiceNameSuffix: ""
userDefinedSecret: ""
imagePullSecrets: []

nameOverride: ""
Expand Down

0 comments on commit f2cae98

Please sign in to comment.