Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from curuvija/feature/oracle-db-exporter-fix-se…
Browse files Browse the repository at this point in the history
…rvice

fix: fix service missing endpoint
  • Loading branch information
curuvija authored Sep 14, 2024
2 parents 9292f41 + d8a3781 commit 3eebf10
Show file tree
Hide file tree
Showing 11 changed files with 295 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dbConnection:
createDbConnectionSecret: true
dbDonnectionString: "oracle://system:192.168.88.222@oracle:1521/xe"
7 changes: 5 additions & 2 deletions source/oracledb-exporter/chart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# oracledb-exporter

## [1.0.0](https://github.com/curuvija/charts/releases/1.0.0) (2024-07-17)
## [1.0.1](https://github.com/curuvija/charts/releases/1.0.1) (2024-09-14)

### Fixed

* [3c2ea](https://github.com/curuvija/charts/commit/3c2eac6d5c83d9ab32189fda03500cdffe3735ea) fix: fix service missing endpoint (Milos Curuvija)

No changes.
2 changes: 1 addition & 1 deletion source/oracledb-exporter/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: oracledb-exporter
description: A Helm chart to export query results from Oracle DB
type: application
version: "1.0.0"
version: "1.0.1"
appVersion: "0.6.0"
maintainers:
- name: 'Milos Curuvija'
Expand Down
4 changes: 2 additions & 2 deletions source/oracledb-exporter/chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A Helm chart to export query results from Oracle DB

## Creating secret

You can create secret by enabling ``dbConnection`` in values but this is not recommended unless you use it for test environments
You can create secret by enabling ``dbConnection`` in values but this is not recommended unless you use it for test environments,
or you test connection string.

```yaml
Expand Down Expand Up @@ -156,4 +156,4 @@ There is an example Grafana dashboard here https://grafana.com/grafana/dashboard
| tolerations | list | `[]` | provide tolerations |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
1 change: 1 addition & 0 deletions source/oracledb-exporter/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 9161
name: http
protocol: TCP
env:
- name: DATA_SOURCE_NAME
Expand Down
4 changes: 0 additions & 4 deletions source/oracledb-exporter/chart/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if eq .Values.existingDbSecretName "" }}
{{- if eq .Values.dbConnection.createDbConnectionSecret true }}
apiVersion: v1
kind: Secret
Expand All @@ -7,7 +6,4 @@ metadata:
data:
datasource: {{ required "A valid .Values.dbConnection.dbDonnectionString entry required!" .Values.dbConnection.dbDonnectionString | b64enc }}
type: Opaque
{{- else }}
{{- fail "Unless you set .Values.dbConnection.createDbConnectionSecret to true you'll have to create DB connection secret manually and provide secret name in existingDbSecretName." }}
{{- end }}
{{- end }}
142 changes: 142 additions & 0 deletions source/oracledb-exporter/tests/golden/db-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
# Source: oracledb-exporter/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: release-name-oracledb-exporter
labels:
helm.sh/chart: oracledb-exporter-1.0.0
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
app.kubernetes.io/version: "0.6.0"
app.kubernetes.io/managed-by: Helm
---
# Source: oracledb-exporter/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: release-name-oracledb-exporter-secret
data:
datasource: b3JhY2xlOi8vc3lzdGVtOjE5Mi4xNjguODguMjIyQG9yYWNsZToxNTIxL3hl
type: Opaque
---
# Source: oracledb-exporter/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: release-name-oracledb-exporter-custom-metrics
data:
custom-metrics.toml: |-
[[metric]]
context = "test"
request = "SELECT 1 as value_1, 2 as value_2 FROM DUAL"
metricsdesc = { value_1 = "Simple example returning always 1.", value_2 = "Same but returning always 2." }
---
# Source: oracledb-exporter/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: release-name-oracledb-exporter
labels:
helm.sh/chart: oracledb-exporter-1.0.0
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
app.kubernetes.io/version: "0.6.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 9161
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
---
# Source: oracledb-exporter/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: release-name-oracledb-exporter
labels:
helm.sh/chart: oracledb-exporter-1.0.0
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
app.kubernetes.io/version: "0.6.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
template:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "9161"
prometheus.io/scrape: "true"
labels:
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
spec:
serviceAccountName: release-name-oracledb-exporter
securityContext:
{}
volumes:
- name: custom-metrics
configMap:
name: release-name-oracledb-exporter-custom-metrics
defaultMode: 420
containers:
- name: oracledb-exporter
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
image: "ghcr.io/iamseth/oracledb_exporter:0.6.0"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9161
name: http
protocol: TCP
env:
- name: DATA_SOURCE_NAME
valueFrom:
secretKeyRef:
name: release-name-oracledb-exporter-secret
key: datasource
- name: CUSTOM_METRICS
value: /tmp/custom-metrics.toml
volumeMounts:
- name: custom-metrics
mountPath: /tmp/custom-metrics.toml
subPath: custom-metrics.toml
livenessProbe:
httpGet:
path: /
port: 9161
readinessProbe:
httpGet:
path: /
port: 9161
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
7 changes: 4 additions & 3 deletions source/oracledb-exporter/tests/golden/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: ServiceAccount
metadata:
name: release-name-oracledb-exporter
labels:
helm.sh/chart: oracledb-exporter-1.1.0
helm.sh/chart: oracledb-exporter-1.0.0
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
Expand All @@ -31,7 +31,7 @@ kind: Service
metadata:
name: release-name-oracledb-exporter
labels:
helm.sh/chart: oracledb-exporter-1.1.0
helm.sh/chart: oracledb-exporter-1.0.0
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
Expand All @@ -57,7 +57,7 @@ kind: Deployment
metadata:
name: release-name-oracledb-exporter
labels:
helm.sh/chart: oracledb-exporter-1.1.0
helm.sh/chart: oracledb-exporter-1.0.0
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
Expand Down Expand Up @@ -102,6 +102,7 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9161
name: http
protocol: TCP
env:
- name: DATA_SOURCE_NAME
Expand Down
133 changes: 133 additions & 0 deletions source/oracledb-exporter/tests/golden/existing-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
---
# Source: oracledb-exporter/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: release-name-oracledb-exporter
labels:
helm.sh/chart: oracledb-exporter-1.0.0
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
app.kubernetes.io/version: "0.6.0"
app.kubernetes.io/managed-by: Helm
---
# Source: oracledb-exporter/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: release-name-oracledb-exporter-custom-metrics
data:
custom-metrics.toml: |-
[[metric]]
context = "test"
request = "SELECT 1 as value_1, 2 as value_2 FROM DUAL"
metricsdesc = { value_1 = "Simple example returning always 1.", value_2 = "Same but returning always 2." }
---
# Source: oracledb-exporter/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: release-name-oracledb-exporter
labels:
helm.sh/chart: oracledb-exporter-1.0.0
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
app.kubernetes.io/version: "0.6.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 9161
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
---
# Source: oracledb-exporter/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: release-name-oracledb-exporter
labels:
helm.sh/chart: oracledb-exporter-1.0.0
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
app.kubernetes.io/version: "0.6.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
template:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "9161"
prometheus.io/scrape: "true"
labels:
app.kubernetes.io/name: oracledb-exporter
app.kubernetes.io/instance: release-name
app: release-name
release: release-name
spec:
serviceAccountName: release-name-oracledb-exporter
securityContext:
{}
volumes:
- name: custom-metrics
configMap:
name: release-name-oracledb-exporter-custom-metrics
defaultMode: 420
containers:
- name: oracledb-exporter
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
image: "ghcr.io/iamseth/oracledb_exporter:0.6.0"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9161
name: http
protocol: TCP
env:
- name: DATA_SOURCE_NAME
valueFrom:
secretKeyRef:
name: some-secret-name
key: datasource
- name: CUSTOM_METRICS
value: /tmp/custom-metrics.toml
volumeMounts:
- name: custom-metrics
mountPath: /tmp/custom-metrics.toml
subPath: custom-metrics.toml
livenessProbe:
httpGet:
path: /
port: 9161
readinessProbe:
httpGet:
path: /
port: 9161
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
3 changes: 3 additions & 0 deletions source/oracledb-exporter/tests/values/db-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dbConnection:
createDbConnectionSecret: true
dbDonnectionString: "oracle://system:192.168.88.222@oracle:1521/xe"
1 change: 1 addition & 0 deletions source/oracledb-exporter/tests/values/existing-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
existingDbSecretName: "some-secret-name"

0 comments on commit 3eebf10

Please sign in to comment.