diff --git a/.github/workflows/cd-pipeline.yml b/.github/workflows/cd-pipeline.yml index 8068c164f..dfad72b9b 100644 --- a/.github/workflows/cd-pipeline.yml +++ b/.github/workflows/cd-pipeline.yml @@ -49,6 +49,7 @@ on: # rebuild any PRs and main branch changes - 'bitnami/nginx-intel/**' - 'bitnami/nginx/**' - 'bitnami/node/**' + - 'bitnami/node-exporter/**' - 'bitnami/odoo/**' - 'bitnami/opencart/**' - 'bitnami/osclass/**' diff --git a/.vib/node-exporter/cypress/cypress.json b/.vib/node-exporter/cypress/cypress.json new file mode 100644 index 000000000..d6586ea93 --- /dev/null +++ b/.vib/node-exporter/cypress/cypress.json @@ -0,0 +1,3 @@ +{ + "baseUrl": "http://localhost/" +} diff --git a/.vib/node-exporter/cypress/cypress/integration/node_exporter_spec.js b/.vib/node-exporter/cypress/cypress/integration/node_exporter_spec.js new file mode 100644 index 000000000..b4a0a1f46 --- /dev/null +++ b/.vib/node-exporter/cypress/cypress/integration/node_exporter_spec.js @@ -0,0 +1,12 @@ +/// + +it('can check cluster health', () => { + cy.request({ + method: 'GET', + url: '/metrics', + form: true, + }).then((response) => { + expect(response.status).to.eq(200); + expect(response.body).to.contain('node_network_info gauge'); + }); +}); diff --git a/.vib/node-exporter/goss/goss.yaml b/.vib/node-exporter/goss/goss.yaml new file mode 100644 index 000000000..0d45dcfdc --- /dev/null +++ b/.vib/node-exporter/goss/goss.yaml @@ -0,0 +1,22 @@ +file: + /host/proc: + exists: true + filetype: directory + mode: "0555" + owner: root + /host/sys: + exists: true + filetype: directory + mode: "0555" + owner: root + /var/run/secrets/kubernetes.io/serviceaccount: + exists: {{ .Vars.serviceAccount.automountServiceAccountToken }} + filetype: directory + mode: "3777" +command: + check-user-info: + exec: id + exit-status: 0 + stdout: + - uid={{ .Vars.containerSecurityContext.runAsUser }} + - /groups=.*{{ .Vars.podSecurityContext.fsGroup }}/ diff --git a/.vib/node-exporter/goss/vars.yaml b/.vib/node-exporter/goss/vars.yaml new file mode 100644 index 000000000..801c56d7f --- /dev/null +++ b/.vib/node-exporter/goss/vars.yaml @@ -0,0 +1,9 @@ +serviceAccount: + automountServiceAccountToken: true +podSecurityContext: + fsGroup: 1002 +containerSecurityContext: + runAsUser: 1002 +service: + ports: + metrics: 80 diff --git a/.vib/node-exporter/vib-publish.json b/.vib/node-exporter/vib-publish.json index d74c12111..32017f7d7 100644 --- a/.vib/node-exporter/vib-publish.json +++ b/.vib/node-exporter/vib-publish.json @@ -22,11 +22,11 @@ "url": "{SHA_ARCHIVE}", "path": "/bitnami/node-exporter" }, - "runtime_parameters": "InNlcnZpY2UiOgogICJwb3J0cyI6IAogICAgIm1ldHJpY3MiOiA4MAogICJ0eXBlIjogIkxvYWRCYWxhbmNlciIK", + "runtime_parameters": "cmJhYzoKICBjcmVhdGU6IHRydWUKICBwc3BFbmFibGVkOiB0cnVlCnNlcnZpY2VBY2NvdW50OgogIGNyZWF0ZTogdHJ1ZQogIGF1dG9tb3VudFNlcnZpY2VBY2NvdW50VG9rZW46IHRydWUKY29udGFpbmVyUG9ydHM6CiAgbWV0cmljczogOTEwMQpwb2RTZWN1cml0eUNvbnRleHQ6CiAgZW5hYmxlZDogdHJ1ZQogIGZzR3JvdXA6IDEwMDIKY29udGFpbmVyU2VjdXJpdHlDb250ZXh0OgogIGVuYWJsZWQ6IHRydWUKICBydW5Bc1VzZXI6IDEwMDIKc2VydmljZToKICBwb3J0czogCiAgICBtZXRyaWNzOiA4MAogIHR5cGU6IExvYWRCYWxhbmNlcg==", "target_platform": { "target_platform_id": "{VIB_ENV_TARGET_PLATFORM}", "size": { - "name": "S4" + "name": "L4" } } }, @@ -37,6 +37,28 @@ "endpoint": "lb-node-exporter-metrics", "app_protocol": "HTTP" } + }, + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib/node-exporter/goss" + }, + "remote": { + "workload": "ds-node-exporter" + }, + "vars_file": "vars.yaml" + } + }, + { + "action_id": "cypress", + "params": { + "resources": { + "path": "/.vib/node-exporter/cypress" + }, + "endpoint": "lb-node-exporter-metrics", + "app_protocol": "HTTP" + } } ] }, diff --git a/.vib/node-exporter/vib-verify.json b/.vib/node-exporter/vib-verify.json index 8d6dbd0fc..d01ae2f83 100644 --- a/.vib/node-exporter/vib-verify.json +++ b/.vib/node-exporter/vib-verify.json @@ -22,11 +22,11 @@ "url": "{SHA_ARCHIVE}", "path": "/bitnami/node-exporter" }, - "runtime_parameters": "InNlcnZpY2UiOgogICJwb3J0cyI6IAogICAgIm1ldHJpY3MiOiA4MAogICJ0eXBlIjogIkxvYWRCYWxhbmNlciIK", + "runtime_parameters": "cmJhYzoKICBjcmVhdGU6IHRydWUKICBwc3BFbmFibGVkOiB0cnVlCnNlcnZpY2VBY2NvdW50OgogIGNyZWF0ZTogdHJ1ZQogIGF1dG9tb3VudFNlcnZpY2VBY2NvdW50VG9rZW46IHRydWUKY29udGFpbmVyUG9ydHM6CiAgbWV0cmljczogOTEwMQpwb2RTZWN1cml0eUNvbnRleHQ6CiAgZW5hYmxlZDogdHJ1ZQogIGZzR3JvdXA6IDEwMDIKY29udGFpbmVyU2VjdXJpdHlDb250ZXh0OgogIGVuYWJsZWQ6IHRydWUKICBydW5Bc1VzZXI6IDEwMDIKc2VydmljZToKICBwb3J0czogCiAgICBtZXRyaWNzOiA4MAogIHR5cGU6IExvYWRCYWxhbmNlcg==", "target_platform": { "target_platform_id": "{VIB_ENV_TARGET_PLATFORM}", "size": { - "name": "S4" + "name": "L4" } } }, @@ -37,6 +37,28 @@ "endpoint": "lb-node-exporter-metrics", "app_protocol": "HTTP" } + }, + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib/node-exporter/goss" + }, + "remote": { + "workload": "ds-node-exporter" + }, + "vars_file": "vars.yaml" + } + }, + { + "action_id": "cypress", + "params": { + "resources": { + "path": "/.vib/node-exporter/cypress" + }, + "endpoint": "lb-node-exporter-metrics", + "app_protocol": "HTTP" + } } ] } diff --git a/bitnami/node-exporter/Chart.yaml b/bitnami/node-exporter/Chart.yaml index 86001f7d9..33c4ff987 100644 --- a/bitnami/node-exporter/Chart.yaml +++ b/bitnami/node-exporter/Chart.yaml @@ -24,4 +24,4 @@ sources: - https://github.com/bitnami/containers/tree/main/bitnami/node-exporter - https://github.com/prometheus/node_exporter - https://prometheus.io/ -version: 3.1.4 +version: 3.2.0 diff --git a/bitnami/node-exporter/templates/psp-clusterrole.yaml b/bitnami/node-exporter/templates/psp-clusterrole.yaml index 60934830e..07772eaa2 100644 --- a/bitnami/node-exporter/templates/psp-clusterrole.yaml +++ b/bitnami/node-exporter/templates/psp-clusterrole.yaml @@ -3,7 +3,7 @@ kind: ClusterRole apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} metadata: - name: {{ template "common.names.fullname" . }}-psp + name: {{ printf "%s-%s" (include "common.names.fullname.namespace" .) "psp" }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} @@ -17,7 +17,7 @@ rules: resources: ['podsecuritypolicies'] verbs: ['use'] resourceNames: - - {{ template "common.names.fullname" . }} + - {{ template "common.names.fullname.namespace" . }} {{- if .Values.rbac.rules }} {{- include "common.tplvalues.render" ( dict "value" .Values.rbac.rules "context" $ ) | nindent 2 }} {{- end }} diff --git a/bitnami/node-exporter/templates/psp-clusterrolebinding.yaml b/bitnami/node-exporter/templates/psp-clusterrolebinding.yaml index 6a1bcfb00..d6fbe445f 100644 --- a/bitnami/node-exporter/templates/psp-clusterrolebinding.yaml +++ b/bitnami/node-exporter/templates/psp-clusterrolebinding.yaml @@ -3,7 +3,7 @@ apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} kind: ClusterRoleBinding metadata: - name: {{ template "common.names.fullname" . }}-psp + name: {{ printf "%s-%s" (include "common.names.fullname.namespace" .) "psp" }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }} @@ -15,7 +15,7 @@ metadata: roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: {{ template "common.names.fullname" . }}-psp + name: {{ printf "%s-%s" (include "common.names.fullname.namespace" .) "psp" }} subjects: - kind: ServiceAccount name: {{ template "node-exporter.serviceAccountName" . }} diff --git a/bitnami/node-exporter/templates/psp.yaml b/bitnami/node-exporter/templates/psp.yaml index d6ed72ae1..962fe19eb 100644 --- a/bitnami/node-exporter/templates/psp.yaml +++ b/bitnami/node-exporter/templates/psp.yaml @@ -3,7 +3,7 @@ apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: - name: {{ template "common.names.fullname" . }} + name: {{ template "common.names.fullname.namespace" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} {{- if .Values.commonLabels }}