From af2aae493e657dc11c66678d3b6bf6367ee3724e Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Mon, 13 Oct 2025 20:35:40 +0000 Subject: [PATCH] Fix/docker (#60) --- charts/operator/templates/clusterrolebinding.yaml | 10 +++++----- charts/operator/templates/deployment.yaml | 1 + charts/operator/templates/serviceaccount.yaml | 1 + images/operator/Dockerfile | 2 ++ images/operator/package.json | 2 +- skaffold.yaml | 10 +++++----- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/charts/operator/templates/clusterrolebinding.yaml b/charts/operator/templates/clusterrolebinding.yaml index 636defe..444b1af 100644 --- a/charts/operator/templates/clusterrolebinding.yaml +++ b/charts/operator/templates/clusterrolebinding.yaml @@ -1,12 +1,12 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: {{ include "homelab-operator.fullname" . }} + name: '{{ include "homelab-operator.fullname" . }}' subjects: -- kind: ServiceAccount - name: {{ include "homelab-operator.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} + - kind: ServiceAccount + name: '{{ include "homelab-operator.serviceAccountName" . }}' + namespace: "{{ .Release.Namespace }}" roleRef: kind: ClusterRole - name: {{ include "homelab-operator.fullname" . }} + name: '{{ include "homelab-operator.fullname" . }}' apiGroup: rbac.authorization.k8s.io diff --git a/charts/operator/templates/deployment.yaml b/charts/operator/templates/deployment.yaml index 576ef8c..7cbc885 100644 --- a/charts/operator/templates/deployment.yaml +++ b/charts/operator/templates/deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "homelab-operator.fullname" . }} + namespace: "{{ .Release.Namespace }}" labels: {{- include "homelab-operator.labels" . | nindent 4 }} spec: diff --git a/charts/operator/templates/serviceaccount.yaml b/charts/operator/templates/serviceaccount.yaml index 313fd84..be8a0d3 100644 --- a/charts/operator/templates/serviceaccount.yaml +++ b/charts/operator/templates/serviceaccount.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "homelab-operator.serviceAccountName" . }} + namespace: "{{ .Release.Namespace }}" labels: {{- include "homelab-operator.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} diff --git a/images/operator/Dockerfile b/images/operator/Dockerfile index b36697a..23d2e54 100644 --- a/images/operator/Dockerfile +++ b/images/operator/Dockerfile @@ -1,6 +1,8 @@ FROM node:23-slim@sha256:86191b94d2a163be41f3dc7fe5e5fcaca8ba2f1be7275d98a06343483c17414a RUN corepack enable +WORKDIR /app COPY package.json pnpm-lock.yaml ./ +COPY patches ./patches RUN pnpm install --frozen-lockfile --prod COPY . . CMD ["node", "src/index.ts"] diff --git a/images/operator/package.json b/images/operator/package.json index 3d7da6f..c2e1e55 100644 --- a/images/operator/package.json +++ b/images/operator/package.json @@ -49,7 +49,7 @@ "sqlite3" ], "patchedDependencies": { - "@kubernetes/client-node": "patches/@kubernetes__client-node.patch" + "@kubernetes/client-node": "./patches/@kubernetes__client-node.patch" } }, "scripts": { diff --git a/skaffold.yaml b/skaffold.yaml index a03d783..fd2959c 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -4,10 +4,9 @@ metadata: name: homelab-operator build: - cluster: {} artifacts: - - image: homelaboperator - context: . + - image: zot.olsen.cloud/homelaboperator + context: ./images/operator docker: dockerfile: Dockerfile @@ -16,9 +15,10 @@ manifests: releases: - name: homelab-operator chartPath: charts/operator + namespace: homelab setValueTemplates: - image.repository: '{{.IMAGE_REPO_homelaboperator}}' - image.tag: '{{.IMAGE_TAG_homelaboperator}}' + image.repository: "zot.local/homelaboperator" + image.tag: "{{.IMAGE_TAG_zot_olsen_cloud_homelaboperator}}" deploy: # Use kubectl to apply the manifests.