diff --git a/Dockerfile b/Dockerfile index 626ab5a..4f03efb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ FROM ${ARCH}alpine:3.18 as container WORKDIR /app COPY --from=builder /app/src/idrac_exporter /app/bin/ -RUN apk add -U bash gettext +RUN apk add -U bash COPY default-config.yml /etc/prometheus/idrac.yml COPY entrypoint.sh /app ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/charts/idrac-exporter/templates/config.yaml b/charts/idrac-exporter/templates/config.yaml index c83b9f5..3f8ac7f 100644 --- a/charts/idrac-exporter/templates/config.yaml +++ b/charts/idrac-exporter/templates/config.yaml @@ -6,9 +6,5 @@ metadata: labels: {{- include "idrac-exporter.labels" . | nindent 4 }} stringData: -{{- if default .Values.idracConfigIsTemplate false }} - idrac.yml.template: {{ tpl .Values.idracConfig . | quote }} -{{- else }} idrac.yml: {{ tpl .Values.idracConfig . | quote }} {{ end }} -{{ end }} \ No newline at end of file diff --git a/charts/idrac-exporter/templates/deployment.yaml b/charts/idrac-exporter/templates/deployment.yaml index 5ca1769..17b4d78 100644 --- a/charts/idrac-exporter/templates/deployment.yaml +++ b/charts/idrac-exporter/templates/deployment.yaml @@ -26,14 +26,22 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "idrac-exporter.serviceAccountName" . }} + {{- with .Values.podSecurityContext }} securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} + {{- with .Values.securityContext }} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.extraArgs }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} ports: - name: http containerPort: {{ .Values.service.port }} @@ -42,14 +50,14 @@ spec: {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: {{- toYaml .Values.readinessProbe | nindent 12 }} + {{- with .Values.resources }} resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- if .Values.env }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.env }} env: - {{- range .Values.env }} - - {{ toYaml . | indent 14 | trim }} + {{- toYaml . | nindent 12 }} {{- end }} - {{- end -}} {{- if or (.Values.idracConfig) (.Values.volumeMounts) }} volumeMounts: {{- end }} diff --git a/charts/idrac-exporter/values.yaml b/charts/idrac-exporter/values.yaml index d45022a..ffa3b1b 100644 --- a/charts/idrac-exporter/values.yaml +++ b/charts/idrac-exporter/values.yaml @@ -78,18 +78,16 @@ tolerations: [] affinity: {} -# If true idracConfig mounts as "idrac.yml.template" to be used with environment -# variables in entrypoint.sh for container deployments. -idracConfigIsTemplate: false +extraArgs: [] idracConfig: | - address: 0.0.0.0 # Running in a container, this makes sense - port: 9348 # Listen port - timeout: 60 # HTTP timeout (in seconds) for Redfish API calls + address: 0.0.0.0 + port: 9348 + timeout: 60 hosts: default: - username: IDRAC_USERNAME - password: IDRAC_PASSWORD + username: USERNAME + password: PASSWORD metrics: system: true sensors: true @@ -100,9 +98,9 @@ idracConfig: | network: true env: [] -# - name: IDRAC_USERNAME +# - name: CONFIG_DEFAULT_USERNAME # value: root -# - name: IDRAC_PASSWORD +# - name: CONFIG_DEFAULT_PASSWORD # valueFrom: # secretKeyRef: # name: my-external-idrac-secret