diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 3f5d157..67b77a4 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -44,12 +44,12 @@ jobs: cache-to: type=inline - name: Package Helm chart - run: helm package web/charts/factorio-dashboard + run: helm package web/charts/factorio-signal-exporter - name: Push Helm chart to Gitea run: | curl -u ${{ secrets.GITEA_USERNAME }}:${{ secrets.GITEA_TOKEN }} \ -X POST \ https://${{ env.REGISTRY }}/api/packages/sebse/helm/api/charts \ - -F "chart=@factorio-dashboard-0.1.0.tgz" \ + -F "chart=@factorio-signal-exporter-0.1.0.tgz" \ --fail-with-body \ No newline at end of file diff --git a/web/charts/factorio-dashboard/templates/secret.yaml b/web/charts/factorio-dashboard/templates/secret.yaml deleted file mode 100644 index 9248866..0000000 --- a/web/charts/factorio-dashboard/templates/secret.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if not .Values.app.existingSecret }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "factorio-dashboard.fullname" . }}-secret - labels: - {{- include "factorio-dashboard.labels" . | nindent 4 }} -type: Opaque -stringData: - API_TOKEN: {{ .Values.app.apiToken | required "app.apiToken is required" | quote }} - DATABASE_URL: {{ include "factorio-dashboard.databaseUrl" . | quote }} -{{- end }} \ No newline at end of file diff --git a/web/charts/factorio-dashboard/templates/service.yaml b/web/charts/factorio-dashboard/templates/service.yaml deleted file mode 100644 index 1e032b3..0000000 --- a/web/charts/factorio-dashboard/templates/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "factorio-dashboard.fullname" . }} - labels: - {{- include "factorio-dashboard.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - selector: - {{- include "factorio-dashboard.selectorLabels" . | nindent 4 }} - ports: - - port: {{ .Values.service.port }} - targetPort: 3000 \ No newline at end of file diff --git a/web/charts/factorio-dashboard/Chart.yaml b/web/charts/factorio-signal-exporter/Chart.yaml similarity index 82% rename from web/charts/factorio-dashboard/Chart.yaml rename to web/charts/factorio-signal-exporter/Chart.yaml index ea48685..4473887 100644 --- a/web/charts/factorio-dashboard/Chart.yaml +++ b/web/charts/factorio-signal-exporter/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: factorio-dashboard +name: factorio-signal-exporter description: Factorio Signal Exporter — Next.js dashboard with TimescaleDB type: application version: 0.1.0 diff --git a/web/charts/factorio-dashboard/templates/_helpers.tpl b/web/charts/factorio-signal-exporter/templates/_helpers.tpl similarity index 52% rename from web/charts/factorio-dashboard/templates/_helpers.tpl rename to web/charts/factorio-signal-exporter/templates/_helpers.tpl index 58c0407..d65edf6 100644 --- a/web/charts/factorio-dashboard/templates/_helpers.tpl +++ b/web/charts/factorio-signal-exporter/templates/_helpers.tpl @@ -1,23 +1,23 @@ {{/* Expand the name of the chart. */}} -{{- define "factorio-dashboard.name" -}} +{{- define "factorio-signal-exporter.name" -}} {{- .Chart.Name | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Create a fully qualified app name. */}} -{{- define "factorio-dashboard.fullname" -}} -{{- printf "%s" (include "factorio-dashboard.name" .) | trunc 63 | trimSuffix "-" }} +{{- define "factorio-signal-exporter.fullname" -}} +{{- printf "%s" (include "factorio-signal-exporter.name" .) | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels. */}} -{{- define "factorio-dashboard.labels" -}} +{{- define "factorio-signal-exporter.labels" -}} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} -app.kubernetes.io/name: {{ include "factorio-dashboard.name" . }} +app.kubernetes.io/name: {{ include "factorio-signal-exporter.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} @@ -26,25 +26,25 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels. */}} -{{- define "factorio-dashboard.selectorLabels" -}} -app.kubernetes.io/name: {{ include "factorio-dashboard.name" . }} +{{- define "factorio-signal-exporter.selectorLabels" -}} +app.kubernetes.io/name: {{ include "factorio-signal-exporter.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Name of the secret that holds API_TOKEN and DATABASE_URL. */}} -{{- define "factorio-dashboard.secretName" -}} +{{- define "factorio-signal-exporter.secretName" -}} {{- if .Values.app.existingSecret }} {{- .Values.app.existingSecret }} {{- else }} -{{- include "factorio-dashboard.fullname" . }}-secret +{{- include "factorio-signal-exporter.fullname" . }}-secret {{- end }} {{- end }} {{/* Construct DATABASE_URL from db values. */}} -{{- define "factorio-dashboard.databaseUrl" -}} -{{- printf "postgresql://%s:%s@%s-db:%d/%s" .Values.db.user .Values.db.password (include "factorio-dashboard.fullname" .) (int .Values.db.port) .Values.db.name }} +{{- define "factorio-signal-exporter.databaseUrl" -}} +{{- printf "postgresql://%s:%s@%s-db:%d/%s" .Values.db.user .Values.db.password (include "factorio-signal-exporter.fullname" .) (int .Values.db.port) .Values.db.name }} {{- end }} \ No newline at end of file diff --git a/web/charts/factorio-dashboard/templates/db-service.yaml b/web/charts/factorio-signal-exporter/templates/db-service.yaml similarity index 53% rename from web/charts/factorio-dashboard/templates/db-service.yaml rename to web/charts/factorio-signal-exporter/templates/db-service.yaml index abd4638..7cfe37f 100644 --- a/web/charts/factorio-dashboard/templates/db-service.yaml +++ b/web/charts/factorio-signal-exporter/templates/db-service.yaml @@ -1,14 +1,14 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "factorio-dashboard.fullname" . }}-db + name: {{ include "factorio-signal-exporter.fullname" . }}-db labels: - {{- include "factorio-dashboard.labels" . | nindent 4 }} + {{- include "factorio-signal-exporter.labels" . | nindent 4 }} app.kubernetes.io/component: db spec: clusterIP: None selector: - {{- include "factorio-dashboard.selectorLabels" . | nindent 4 }} + {{- include "factorio-signal-exporter.selectorLabels" . | nindent 4 }} app.kubernetes.io/component: db ports: - port: {{ .Values.db.port }} diff --git a/web/charts/factorio-dashboard/templates/db-statefulset.yaml b/web/charts/factorio-signal-exporter/templates/db-statefulset.yaml similarity index 77% rename from web/charts/factorio-dashboard/templates/db-statefulset.yaml rename to web/charts/factorio-signal-exporter/templates/db-statefulset.yaml index b61ea8f..de3f503 100644 --- a/web/charts/factorio-dashboard/templates/db-statefulset.yaml +++ b/web/charts/factorio-signal-exporter/templates/db-statefulset.yaml @@ -1,21 +1,21 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: {{ include "factorio-dashboard.fullname" . }}-db + name: {{ include "factorio-signal-exporter.fullname" . }}-db labels: - {{- include "factorio-dashboard.labels" . | nindent 4 }} + {{- include "factorio-signal-exporter.labels" . | nindent 4 }} app.kubernetes.io/component: db spec: - serviceName: {{ include "factorio-dashboard.fullname" . }}-db + serviceName: {{ include "factorio-signal-exporter.fullname" . }}-db replicas: 1 selector: matchLabels: - {{- include "factorio-dashboard.selectorLabels" . | nindent 6 }} + {{- include "factorio-signal-exporter.selectorLabels" . | nindent 6 }} app.kubernetes.io/component: db template: metadata: labels: - {{- include "factorio-dashboard.selectorLabels" . | nindent 8 }} + {{- include "factorio-signal-exporter.selectorLabels" . | nindent 8 }} app.kubernetes.io/component: db spec: containers: @@ -29,7 +29,7 @@ spec: - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: - name: {{ include "factorio-dashboard.secretName" . }} + name: {{ include "factorio-signal-exporter.secretName" . }} key: DATABASE_URL optional: false - name: POSTGRES_PASSWORD diff --git a/web/charts/factorio-dashboard/templates/deployment.yaml b/web/charts/factorio-signal-exporter/templates/deployment.yaml similarity index 77% rename from web/charts/factorio-dashboard/templates/deployment.yaml rename to web/charts/factorio-signal-exporter/templates/deployment.yaml index d56dd79..f6df85a 100644 --- a/web/charts/factorio-dashboard/templates/deployment.yaml +++ b/web/charts/factorio-signal-exporter/templates/deployment.yaml @@ -1,18 +1,18 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "factorio-dashboard.fullname" . }} + name: {{ include "factorio-signal-exporter.fullname" . }} labels: - {{- include "factorio-dashboard.labels" . | nindent 4 }} + {{- include "factorio-signal-exporter.labels" . | nindent 4 }} spec: replicas: {{ .Values.app.replicaCount }} selector: matchLabels: - {{- include "factorio-dashboard.selectorLabels" . | nindent 6 }} + {{- include "factorio-signal-exporter.selectorLabels" . | nindent 6 }} template: metadata: labels: - {{- include "factorio-dashboard.selectorLabels" . | nindent 8 }} + {{- include "factorio-signal-exporter.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -27,7 +27,7 @@ spec: - name: DATABASE_URL valueFrom: secretKeyRef: - name: {{ include "factorio-dashboard.secretName" . }} + name: {{ include "factorio-signal-exporter.secretName" . }} key: DATABASE_URL containers: - name: app @@ -39,12 +39,12 @@ spec: - name: API_TOKEN valueFrom: secretKeyRef: - name: {{ include "factorio-dashboard.secretName" . }} + name: {{ include "factorio-signal-exporter.secretName" . }} key: API_TOKEN - name: DATABASE_URL valueFrom: secretKeyRef: - name: {{ include "factorio-dashboard.secretName" . }} + name: {{ include "factorio-signal-exporter.secretName" . }} key: DATABASE_URL readinessProbe: httpGet: diff --git a/web/charts/factorio-dashboard/templates/ingress.yaml b/web/charts/factorio-signal-exporter/templates/ingress.yaml similarity index 73% rename from web/charts/factorio-dashboard/templates/ingress.yaml rename to web/charts/factorio-signal-exporter/templates/ingress.yaml index 1e7909a..f2f6139 100644 --- a/web/charts/factorio-dashboard/templates/ingress.yaml +++ b/web/charts/factorio-signal-exporter/templates/ingress.yaml @@ -2,9 +2,9 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "factorio-dashboard.fullname" . }} + name: {{ include "factorio-signal-exporter.fullname" . }} labels: - {{- include "factorio-dashboard.labels" . | nindent 4 }} + {{- include "factorio-signal-exporter.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -17,7 +17,7 @@ spec: tls: - hosts: - {{ .Values.ingress.host | quote }} - secretName: {{ .Values.ingress.tlsSecretName | default (printf "%s-tls" (include "factorio-dashboard.fullname" .)) | quote }} + secretName: {{ .Values.ingress.tlsSecretName | default (printf "%s-tls" (include "factorio-signal-exporter.fullname" .)) | quote }} {{- end }} rules: - host: {{ .Values.ingress.host | quote }} @@ -27,7 +27,7 @@ spec: pathType: Prefix backend: service: - name: {{ include "factorio-dashboard.fullname" . }} + name: {{ include "factorio-signal-exporter.fullname" . }} port: number: {{ .Values.service.port }} {{- end }} \ No newline at end of file diff --git a/web/charts/factorio-signal-exporter/templates/secret.yaml b/web/charts/factorio-signal-exporter/templates/secret.yaml new file mode 100644 index 0000000..8ef18a0 --- /dev/null +++ b/web/charts/factorio-signal-exporter/templates/secret.yaml @@ -0,0 +1,12 @@ +{{- if not .Values.app.existingSecret }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "factorio-signal-exporter.fullname" . }}-secret + labels: + {{- include "factorio-signal-exporter.labels" . | nindent 4 }} +type: Opaque +stringData: + API_TOKEN: {{ .Values.app.apiToken | required "app.apiToken is required" | quote }} + DATABASE_URL: {{ include "factorio-signal-exporter.databaseUrl" . | quote }} +{{- end }} \ No newline at end of file diff --git a/web/charts/factorio-signal-exporter/templates/service.yaml b/web/charts/factorio-signal-exporter/templates/service.yaml new file mode 100644 index 0000000..50cea3f --- /dev/null +++ b/web/charts/factorio-signal-exporter/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "factorio-signal-exporter.fullname" . }} + labels: + {{- include "factorio-signal-exporter.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + selector: + {{- include "factorio-signal-exporter.selectorLabels" . | nindent 4 }} + ports: + - port: {{ .Values.service.port }} + targetPort: 3000 \ No newline at end of file diff --git a/web/charts/factorio-dashboard/values.yaml b/web/charts/factorio-signal-exporter/values.yaml similarity index 100% rename from web/charts/factorio-dashboard/values.yaml rename to web/charts/factorio-signal-exporter/values.yaml