From c8df276dc183ca65719627035ff32b281b36eda7 Mon Sep 17 00:00:00 2001 From: "andreas.dinauer" Date: Sun, 26 Oct 2025 15:19:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20Init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 8 +++++++ .idea/misc.xml | 6 +++++ .idea/modules.xml | 8 +++++++ .idea/vcs.xml | 6 +++++ Jenkinsfile | 28 ++++++++++++++++++++++++ chart/Chart.yaml | 3 +++ chart/templates/database/cluster.yaml | 0 chart/templates/database/database.yaml | 0 chart/templates/frontend/deployment.yaml | 27 +++++++++++++++++++++++ chart/templates/frontend/service.yaml | 13 +++++++++++ chart/templates/ingress.yaml | 19 ++++++++++++++++ chart/values.yaml | 2 ++ helm.iml | 8 +++++++ 13 files changed, 128 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 Jenkinsfile create mode 100644 chart/Chart.yaml create mode 100644 chart/templates/database/cluster.yaml create mode 100644 chart/templates/database/database.yaml create mode 100644 chart/templates/frontend/deployment.yaml create mode 100644 chart/templates/frontend/service.yaml create mode 100644 chart/templates/ingress.yaml create mode 100644 chart/values.yaml create mode 100644 helm.iml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6d6890d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f6b81bd --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,28 @@ +pipeline { + agent any + + stages { + stage('Log into harbor') { + steps { + withCredentials([usernamePassword(credentialsId: 'harbor', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) { + sh 'helm registry login harbor.dinauer.dev -u ${USERNAME} -p ${PASSWORD}' + } + } + } + stage('Package helm chart') { + steps { + sh 'helm package ./chart' + } + } + stage('Push helm chart') { + steps { + sh 'helm push kubooboo-chart-*.tgz oci://harbor.dinauer.dev/kubooboo' + } + } + stage('Clean workspace') { + steps { + cleanWs() + } + } + } +} \ No newline at end of file diff --git a/chart/Chart.yaml b/chart/Chart.yaml new file mode 100644 index 0000000..8de6700 --- /dev/null +++ b/chart/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +name: kubooboo-chart +version: 0.0.1 \ No newline at end of file diff --git a/chart/templates/database/cluster.yaml b/chart/templates/database/cluster.yaml new file mode 100644 index 0000000..e69de29 diff --git a/chart/templates/database/database.yaml b/chart/templates/database/database.yaml new file mode 100644 index 0000000..e69de29 diff --git a/chart/templates/frontend/deployment.yaml b/chart/templates/frontend/deployment.yaml new file mode 100644 index 0000000..84758a7 --- /dev/null +++ b/chart/templates/frontend/deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: frontend-deployment + labels: + app: frontend +spec: + replicas: {{ .Values.frontend.replicas }} + selector: + matchLabels: + app: frontend + template: + metadata: + labels: + app: frontend + spec: + containers: + - name: frontend-pod + resources: + requests: + memory: "64Mi" + cpu: "100m" + limits: + memory: "128Mi" + image: harbor.dinauer.dev/kubooboo/frontend:4 + ports: + - containerPort: 3000 \ No newline at end of file diff --git a/chart/templates/frontend/service.yaml b/chart/templates/frontend/service.yaml new file mode 100644 index 0000000..1ab4fff --- /dev/null +++ b/chart/templates/frontend/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: frontend-service + labels: + app: frontend +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 3000 + selector: + app: frontend \ No newline at end of file diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml new file mode 100644 index 0000000..f0733db --- /dev/null +++ b/chart/templates/ingress.yaml @@ -0,0 +1,19 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: / +spec: + ingressClassName: nginx + rules: + - host: kubooboo.dinauer.dev + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: frontend + port: + number: 80 \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml new file mode 100644 index 0000000..f79e03e --- /dev/null +++ b/chart/values.yaml @@ -0,0 +1,2 @@ +frontend: + replicas: 1 \ No newline at end of file diff --git a/helm.iml b/helm.iml new file mode 100644 index 0000000..9a5cfce --- /dev/null +++ b/helm.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file