diff --git a/templates/prometheus-fail2ban-exporter/_common.tpl b/templates/_common.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_common.tpl rename to templates/_common.tpl diff --git a/templates/prometheus-fail2ban-exporter/_configMap.tpl b/templates/_configMap.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_configMap.tpl rename to templates/_configMap.tpl diff --git a/templates/prometheus-fail2ban-exporter/_daemonSet.tpl b/templates/_daemonSet.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_daemonSet.tpl rename to templates/_daemonSet.tpl diff --git a/templates/prometheus-fail2ban-exporter/_ingress.tpl b/templates/_ingress.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_ingress.tpl rename to templates/_ingress.tpl diff --git a/templates/prometheus-fail2ban-exporter/_networkPolicies.tpl b/templates/_networkPolicies.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_networkPolicies.tpl rename to templates/_networkPolicies.tpl diff --git a/templates/prometheus-fail2ban-exporter/_pod.tpl b/templates/_pod.tpl similarity index 93% rename from templates/prometheus-fail2ban-exporter/_pod.tpl rename to templates/_pod.tpl index 280a267..8bf79e5 100644 --- a/templates/prometheus-fail2ban-exporter/_pod.tpl +++ b/templates/_pod.tpl @@ -16,7 +16,7 @@ {{- $secret := default (dict "data" (dict)) (lookup "v1" "Secret" .Release.Namespace .Values.config.webConfig.existingSecret.secretName ) }} checksum/secret-web-config: {{ print $secret.spec | sha256sum }} {{- else }} -checksum/secret-web-config: {{ include (print $.Template.BasePath "/prometheus-fail2ban-exporter/secretWebConfig.yaml") . | sha256sum }} +checksum/secret-web-config: {{ include (print $.Template.BasePath "/secretWebConfig.yaml") . | sha256sum }} {{- end }} {{- end }} diff --git a/templates/prometheus-fail2ban-exporter/_podMonitors.tpl b/templates/_podMonitors.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_podMonitors.tpl rename to templates/_podMonitors.tpl diff --git a/templates/prometheus-fail2ban-exporter/_prometheusRules.tpl b/templates/_prometheusRules.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_prometheusRules.tpl rename to templates/_prometheusRules.tpl diff --git a/templates/prometheus-fail2ban-exporter/_secrets.tpl b/templates/_secrets.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_secrets.tpl rename to templates/_secrets.tpl diff --git a/templates/prometheus-fail2ban-exporter/_serviceAccount.tpl b/templates/_serviceAccount.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_serviceAccount.tpl rename to templates/_serviceAccount.tpl diff --git a/templates/prometheus-fail2ban-exporter/_serviceMonitors.tpl b/templates/_serviceMonitors.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_serviceMonitors.tpl rename to templates/_serviceMonitors.tpl diff --git a/templates/prometheus-fail2ban-exporter/_services.tpl b/templates/_services.tpl similarity index 100% rename from templates/prometheus-fail2ban-exporter/_services.tpl rename to templates/_services.tpl diff --git a/templates/prometheus-fail2ban-exporter/configMapGrafanaDashboardFail2BanExporter.yaml b/templates/configMapGrafanaDashboardFail2BanExporter.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/configMapGrafanaDashboardFail2BanExporter.yaml rename to templates/configMapGrafanaDashboardFail2BanExporter.yaml diff --git a/templates/prometheus-fail2ban-exporter/daemonSet.yaml b/templates/daemonSet.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/daemonSet.yaml rename to templates/daemonSet.yaml diff --git a/templates/prometheus-fail2ban-exporter/ingress.yaml b/templates/ingress.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/ingress.yaml rename to templates/ingress.yaml diff --git a/templates/prometheus-fail2ban-exporter/networkPolicies.yaml b/templates/networkPolicies.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/networkPolicies.yaml rename to templates/networkPolicies.yaml diff --git a/templates/prometheus-fail2ban-exporter/podMonitor.yaml b/templates/podMonitor.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/podMonitor.yaml rename to templates/podMonitor.yaml diff --git a/templates/prometheus-fail2ban-exporter/prometheusRules.yaml b/templates/prometheusRules.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/prometheusRules.yaml rename to templates/prometheusRules.yaml diff --git a/templates/prometheus-fail2ban-exporter/secretWebConfig.yaml b/templates/secretWebConfig.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/secretWebConfig.yaml rename to templates/secretWebConfig.yaml diff --git a/templates/prometheus-fail2ban-exporter/serviceAccount.yaml b/templates/serviceAccount.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/serviceAccount.yaml rename to templates/serviceAccount.yaml diff --git a/templates/prometheus-fail2ban-exporter/serviceHTTP.yaml b/templates/serviceHTTP.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/serviceHTTP.yaml rename to templates/serviceHTTP.yaml diff --git a/templates/prometheus-fail2ban-exporter/serviceMonitorHTTP.yaml b/templates/serviceMonitorHTTP.yaml similarity index 100% rename from templates/prometheus-fail2ban-exporter/serviceMonitorHTTP.yaml rename to templates/serviceMonitorHTTP.yaml diff --git a/unittests/configMaps/grafanaDashboardPostgresExporter.yaml b/unittests/configMaps/grafanaDashboardPostgresExporter.yaml index e107155..9052c26 100644 --- a/unittests/configMaps/grafanaDashboardPostgresExporter.yaml +++ b/unittests/configMaps/grafanaDashboardPostgresExporter.yaml @@ -6,7 +6,7 @@ release: name: prometheus-fail2ban-exporter-unittest namespace: testing templates: -- templates/prometheus-fail2ban-exporter/configMapGrafanaDashboardFail2BanExporter.yaml +- templates/configMapGrafanaDashboardFail2BanExporter.yaml tests: - it: Rendering fail2banExporter asserts: diff --git a/unittests/daemonset/daemonset.yaml b/unittests/daemonset/daemonset.yaml index c995960..2d4b059 100644 --- a/unittests/daemonset/daemonset.yaml +++ b/unittests/daemonset/daemonset.yaml @@ -6,23 +6,23 @@ release: name: prometheus-fail2ban-exporter-unittest namespace: testing templates: -- templates/prometheus-fail2ban-exporter/daemonSet.yaml -- templates/prometheus-fail2ban-exporter/secretWebConfig.yaml +- templates/daemonSet.yaml +- templates/secretWebConfig.yaml tests: - it: Rendering default asserts: - hasDocuments: count: 1 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - containsDocument: apiVersion: apps/v1 kind: DaemonSet name: prometheus-fail2ban-exporter-unittest namespace: testing - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: metadata.annotations - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: metadata.labels value: @@ -31,10 +31,10 @@ tests: app.kubernetes.io/name: prometheus-fail2ban-exporter app.kubernetes.io/version: 0.1.0 helm.sh/chart: prometheus-fail2ban-exporter-0.1.0 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - exists: path: spec.template.metadata.annotations.checksum/secret-web-config - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.metadata.labels value: @@ -43,19 +43,19 @@ tests: app.kubernetes.io/name: prometheus-fail2ban-exporter app.kubernetes.io/version: 0.1.0 helm.sh/chart: prometheus-fail2ban-exporter-0.1.0 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.affinity - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.containers[0].envFrom - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.containers[0].args value: # - --web.config.file=/etc/prometheus-fail2ban-exporter/config.d/webConfig.yaml - --web.listen-address=:9191 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.containers[0].volumeMounts value: @@ -63,7 +63,7 @@ tests: name: socket - mountPath: /etc/prometheus-fail2ban-exporter/config.d name: config-d - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.volumes value: @@ -74,59 +74,59 @@ tests: - name: config-d secret: secretName: prometheus-fail2ban-exporter-unittest-web-config - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.containers[0].image value: git.cryptic.systems/volker.raschek/prometheus-fail2ban-exporter:0.1.0 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.containers[0].imagePullPolicy value: IfNotPresent - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.containers[0].resources - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.containers[0].securityContext - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.dnsConfig - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.dnsPolicy - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.hostname - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.hostNetwork value: false - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.imagePullSecrets - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.nodeSelector - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.priorityClassName - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.restartPolicy - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.subdomain - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.terminationGracePeriodSeconds value: 60 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.tolerations - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - notExists: path: spec.template.spec.topologySpreadConstraints - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.updateStrategy value: @@ -134,7 +134,7 @@ tests: maxSurge: 1 maxUnavailable: 0 type: "RollingUpdate" - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test custom affinity set: @@ -161,7 +161,7 @@ tests: values: - antarctica-east1 - antarctica-west1 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test additional arguments set: @@ -176,7 +176,7 @@ tests: - --web.listen-address=:9191 - --foo=bar - --bar=foo - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test custom imageRegistry and imageRepository set: @@ -186,7 +186,7 @@ tests: - equal: path: spec.template.spec.containers[0].image value: registry.example.local/path/special/prometheus-fail2ban-exporter:0.1.0 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test custom imagePullPolicy set: @@ -195,7 +195,7 @@ tests: - equal: path: spec.template.spec.containers[0].imagePullPolicy value: Always - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test config.webConfig.existingSecret set: @@ -209,7 +209,7 @@ tests: name: socket - mountPath: /etc/prometheus-fail2ban-exporter/config.d name: config-d - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.volumes value: @@ -220,7 +220,7 @@ tests: - name: config-d secret: secretName: web-config-secret - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test custom resource limits and requests set: @@ -240,7 +240,7 @@ tests: resourceFieldRef: divisor: "1" resource: limits.cpu - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.containers[0].resources value: @@ -250,7 +250,7 @@ tests: requests: cpu: 25m memory: 100MB - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test custom securityContext set: @@ -277,7 +277,7 @@ tests: readOnlyRootFilesystem: true runAsNonRoot: true runAsUser: 1000 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test dnsConfig set: @@ -292,7 +292,7 @@ tests: nameservers: - "8.8.8.8" - "8.8.4.4" - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test dnsPolicy set: @@ -301,7 +301,7 @@ tests: - equal: path: spec.template.spec.dnsPolicy value: ClusterFirst - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test hostNetwork, hostname, subdomain set: @@ -312,15 +312,15 @@ tests: - equal: path: spec.template.spec.hostNetwork value: true - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.hostname value: pg-exporter - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.subdomain value: exporters.internal - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test imagePullSecrets set: @@ -333,7 +333,7 @@ tests: value: - name: my-pull-secret - name: my-special-secret - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test nodeSelector set: @@ -344,7 +344,7 @@ tests: path: spec.template.spec.nodeSelector value: foo: bar - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test priorityClassName set: @@ -353,7 +353,7 @@ tests: - equal: path: spec.template.spec.priorityClassName value: my-priority - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test restartPolicy set: @@ -362,7 +362,7 @@ tests: - equal: path: spec.template.spec.restartPolicy value: Always - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test terminationGracePeriodSeconds set: @@ -371,7 +371,7 @@ tests: - equal: path: spec.template.spec.terminationGracePeriodSeconds value: 120 - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test tolerations set: @@ -388,7 +388,7 @@ tests: operator: Equal value: fail2ban effect: NoSchedule - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test topologySpreadConstraints set: @@ -407,7 +407,7 @@ tests: labelSelector: matchLabels: app.kubernetes.io/instance: prometheus-fail2ban-exporter - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - it: Test additional volumeMounts and volumes set: @@ -426,7 +426,7 @@ tests: mountPath: /usr/lib/prometheus-fail2ban-exporter/data - name: config-d mountPath: /etc/prometheus-fail2ban-exporter/config.d - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml + template: templates/daemonSet.yaml - equal: path: spec.template.spec.volumes value: @@ -436,4 +436,4 @@ tests: - name: config-d secret: secretName: prometheus-fail2ban-exporter-unittest-web-config - template: templates/prometheus-fail2ban-exporter/daemonSet.yaml \ No newline at end of file + template: templates/daemonSet.yaml \ No newline at end of file diff --git a/unittests/ingress/ingress.yaml b/unittests/ingress/ingress.yaml index 875f8ca..0b7bce2 100644 --- a/unittests/ingress/ingress.yaml +++ b/unittests/ingress/ingress.yaml @@ -6,7 +6,7 @@ release: name: prometheus-fail2ban-exporter-unittest namespace: testing templates: -- templates/prometheus-fail2ban-exporter/ingress.yaml +- templates/ingress.yaml tests: - it: Skip ingress by default. asserts: diff --git a/unittests/networkPolicies/default.yaml b/unittests/networkPolicies/default.yaml index 426b022..8581b07 100644 --- a/unittests/networkPolicies/default.yaml +++ b/unittests/networkPolicies/default.yaml @@ -6,7 +6,7 @@ release: name: prometheus-fail2ban-exporter-unittest namespace: testing templates: -- templates/prometheus-fail2ban-exporter/networkPolicies.yaml +- templates/networkPolicies.yaml tests: - it: Skip networkPolicies in general disabled. set: diff --git a/unittests/podMonitors/podMonitorHTTP.yaml b/unittests/podMonitors/podMonitorHTTP.yaml index 0f75d55..56d988f 100644 --- a/unittests/podMonitors/podMonitorHTTP.yaml +++ b/unittests/podMonitors/podMonitorHTTP.yaml @@ -6,7 +6,7 @@ release: name: prometheus-fail2ban-exporter-unittest namespace: testing templates: -- templates/prometheus-fail2ban-exporter/podMonitor.yaml +- templates/podMonitor.yaml tests: - it: Skip podMonitor when metrics are disabled. set: diff --git a/unittests/secrets/webconfig.yaml b/unittests/secrets/webconfig.yaml index c4d4989..112e70b 100644 --- a/unittests/secrets/webconfig.yaml +++ b/unittests/secrets/webconfig.yaml @@ -6,7 +6,7 @@ release: name: prometheus-fail2ban-exporter-unittest namespace: testing templates: -- templates/prometheus-fail2ban-exporter/secretWebConfig.yaml +- templates/secretWebConfig.yaml tests: - it: Rendering default secret. asserts: diff --git a/unittests/serviceAccounts/serviceAccount.yaml b/unittests/serviceAccounts/serviceAccount.yaml index 203c0b9..d359d67 100644 --- a/unittests/serviceAccounts/serviceAccount.yaml +++ b/unittests/serviceAccounts/serviceAccount.yaml @@ -6,7 +6,7 @@ release: name: prometheus-fail2ban-exporter-unittest namespace: testing templates: -- templates/prometheus-fail2ban-exporter/serviceAccount.yaml +- templates/serviceAccount.yaml tests: - it: Skip rendering. set: diff --git a/unittests/serviceMonitors/serviceMonitorHTTP.yaml b/unittests/serviceMonitors/serviceMonitorHTTP.yaml index 9be89c5..e32ee75 100644 --- a/unittests/serviceMonitors/serviceMonitorHTTP.yaml +++ b/unittests/serviceMonitors/serviceMonitorHTTP.yaml @@ -6,7 +6,7 @@ release: name: prometheus-fail2ban-exporter-unittest namespace: testing templates: -- templates/prometheus-fail2ban-exporter/serviceMonitorHTTP.yaml +- templates/serviceMonitorHTTP.yaml tests: - it: Skip serviceMonitor when service is disabled. set: diff --git a/unittests/services/http.yaml b/unittests/services/http.yaml index c0995d0..5ce21d7 100644 --- a/unittests/services/http.yaml +++ b/unittests/services/http.yaml @@ -6,7 +6,7 @@ release: name: prometheus-fail2ban-exporter-unittest namespace: testing templates: -- templates/prometheus-fail2ban-exporter/serviceHTTP.yaml +- templates/serviceHTTP.yaml tests: - it: Skip service when disabled. set: