Skip to content

Commit

Permalink
feat(rel-csc-6.0.0): release csc charts 6.0.0 (#114)
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 f2cae98 commit 838bc7d
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 44 deletions.
6 changes: 3 additions & 3 deletions charts/collectorset-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ maintainers:
- email: argus@logicmonitor.com
name: LogicMonitor
name: collectorset-controller
version: 5.4.0
version: 6.0.0
home: https://logicmonitor.github.io/helm-charts
appVersion: v7.3.0
appVersion: v8.0.0
dependencies:
- name: lmutil
repository: https://logicmonitor.github.io/helm-charts
# repository: file://../lmutil
version: 0.1.6
version: 0.1.9
annotations:
artifacthub.io/crds: |
- kind: CollectorSet
Expand Down
65 changes: 59 additions & 6 deletions charts/collectorset-controller/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ Create the name of the service account to use
{{- end }}
{{- end }}






{{- define "csc-image" -}}
{{- $registry := "" -}}
{{- $repo := "logicmonitor" -}}
Expand All @@ -62,4 +57,62 @@ Create the name of the service account to use
{{- else -}}
"{{ $repo }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- end -}}
{{- 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.collectorSetControllerProxyUser $secretData.proxyUser .Values.proxy.user .Values.global.proxy.user }}
- name: PROXY_USER
valueFrom:
secretKeyRef:
name: {{ include "lmutil.secret-name" . }}
{{- if $secretData.collectorSetControllerProxyUser }}
key: collectorSetControllerProxyUser
{{- else }}
key: proxyUser
{{- end }}
{{- end }}
{{- if or $secretData.collectorSetControllerProxyUser $secretData.proxyPass .Values.proxy.pass .Values.global.proxy.pass }}
- name: PROXY_PASS
valueFrom:
secretKeyRef:
name: {{ include "lmutil.secret-name" . }}
{{- if $secretData.collectorSetControllerProxyUser }}
key: collectorSetControllerProxyUser
{{- else }}
key: proxyPass
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/collectorset-controller/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ data:
{{- end }}
ignoreSSL: {{ default false .Values.ignoreSSL }}
collectorServiceAccountName: {{ include "collectorset-controller.serviceAccountName" . }}-collector
secretName: {{ include "lmutil.fullname" . }}
secretName: {{ include "lmutil.secret-name" . }}
1 change: 1 addition & 0 deletions charts/collectorset-controller/templates/csc-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ rules:
- ""
resources:
- pods
- secrets
verbs:
- "*"
- apiGroups:
Expand Down
35 changes: 1 addition & 34 deletions charts/collectorset-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,40 +81,7 @@ spec:
{{ toYaml . | nindent 12 }}
{{- end}}
env:
- 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 }}
volumeMounts:
- name: etc-collectorset-controller
mountPath: "/etc/collectorset-controller"
Expand Down
2 changes: 2 additions & 0 deletions charts/collectorset-controller/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 @@ -25,3 +26,4 @@ data:
{{- else if .Values.global.proxy.pass }}
proxyPass: {{ default "" .Values.global.proxy.pass | b64enc }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/collectorset-controller/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"accessKey": "",
"account": "",
"collectorsetServiceNameSuffix": "",
"userDefinedSecret": "",
"proxy": {
"url": "",
"user": "",
Expand Down Expand Up @@ -582,6 +583,13 @@
"type": "string",
"default": "",
"description": "Suffix to be added to .Release.name to generate Collectorset controller service name.\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/collectorset-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ global:
registry: ""
repository: ""
pullPolicy: Always
userDefinedSecret: ""
imagePullSecrets: []

podSecurityContext: {}
Expand Down

0 comments on commit 838bc7d

Please sign in to comment.