From 01acddb8c331ede6bad9b79278701a6e0b29b7be Mon Sep 17 00:00:00 2001 From: izuddin Date: Wed, 26 Aug 2026 16:07:10 +0700 Subject: [PATCH] Update helm --- helm/.gitkeep | 0 helm/sidata/.gitkeep | 0 helm/sidata/Chart.yaml | 6 +++ helm/sidata/templates/configmap.yaml | 29 +++++++++++ helm/sidata/templates/deployment.yaml | 70 +++++++++++++++++++++++++++ helm/sidata/templates/ingress.yaml | 20 ++++++++ helm/sidata/templates/middleware.yaml | 9 ++++ helm/sidata/templates/secret.yaml | 9 ++++ helm/sidata/templates/service.yaml | 13 +++++ helm/sidata/values.yaml | 45 +++++++++++++++++ 10 files changed, 201 insertions(+) create mode 100644 helm/.gitkeep create mode 100644 helm/sidata/.gitkeep create mode 100644 helm/sidata/Chart.yaml create mode 100644 helm/sidata/templates/configmap.yaml create mode 100644 helm/sidata/templates/deployment.yaml create mode 100644 helm/sidata/templates/ingress.yaml create mode 100644 helm/sidata/templates/middleware.yaml create mode 100644 helm/sidata/templates/secret.yaml create mode 100644 helm/sidata/templates/service.yaml create mode 100644 helm/sidata/values.yaml diff --git a/helm/.gitkeep b/helm/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/helm/sidata/.gitkeep b/helm/sidata/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/helm/sidata/Chart.yaml b/helm/sidata/Chart.yaml new file mode 100644 index 0000000..4a67a51 --- /dev/null +++ b/helm/sidata/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: sidata-app +description: Helm chart untuk aplikasi Laravel SIDATA +type: application +version: 0.1.0 +appVersion: "1.0.0" \ No newline at end of file diff --git a/helm/sidata/templates/configmap.yaml b/helm/sidata/templates/configmap.yaml new file mode 100644 index 0000000..689ed63 --- /dev/null +++ b/helm/sidata/templates/configmap.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: sidata-nginx-config + namespace: sidata-prod +data: + default.conf: | + server { + listen 80; + server_name _; + root /var/www/html/public; + index index.php index.html; + + fastcgi_param HTTPS on; + fastcgi_param HTTP_X_FORWARDED_PROTO https; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location ~ \.php$ { + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + fastcgi_param HTTPS on; + fastcgi_param HTTP_X_FORWARDED_PROTO https; + } + } \ No newline at end of file diff --git a/helm/sidata/templates/deployment.yaml b/helm/sidata/templates/deployment.yaml new file mode 100644 index 0000000..3da71ad --- /dev/null +++ b/helm/sidata/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app: {{ .Release.Name }} +spec: + replicas: {{ .Values.replicaCount | default 1 }} + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy | default "Always" }} + ports: + - containerPort: {{ .Values.service.targetPort | default 80 }} + volumeMounts: + - name: nginx-config-volume + mountPath: /etc/nginx/http.d/default.conf + subPath: default.conf + env: + {{- if .Values.env }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- end }} + # --- KONFIGURASI UTAMA SUB-PATH & REVERSE PROXY LARAVEL --- + - name: APP_URL + value: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" + - name: ASSET_URL + value: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" + - name: SESSION_DRIVER + value: "file" + - name: SESSION_DOMAIN + value: "" + - name: SESSION_PATH + value: "/" + - name: SESSION_SECURE_COOKIE + value: "false" + - name: SESSION_SAME_SITE + value: "lax" + - name: TRUSTED_PROXIES + value: "*" + # --- SECRETS --- + - name: APP_KEY + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-secret + key: APP_KEY + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-secret + key: DB_PASSWORD + - name: ORA_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-secret + key: ORA_PASSWORD + volumes: + - name: nginx-config-volume + configMap: + name: sidata-nginx-config \ No newline at end of file diff --git a/helm/sidata/templates/ingress.yaml b/helm/sidata/templates/ingress.yaml new file mode 100644 index 0000000..7821419 --- /dev/null +++ b/helm/sidata/templates/ingress.yaml @@ -0,0 +1,20 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: sidata-ingress + namespace: sidata-prod + annotations: + traefik.ingress.kubernetes.io/router.middlewares: sidata-prod-fix-sidata-prefix@kubernetescrd +spec: + ingressClassName: traefik + rules: + - host: dashboard-bpkd.drc-bpkd.data-center.id + http: + paths: + - path: /sidata + pathType: Prefix + backend: + service: + name: sidata-service + port: + number: 80 \ No newline at end of file diff --git a/helm/sidata/templates/middleware.yaml b/helm/sidata/templates/middleware.yaml new file mode 100644 index 0000000..b8cda95 --- /dev/null +++ b/helm/sidata/templates/middleware.yaml @@ -0,0 +1,9 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: fix-sidata-prefix + namespace: sidata-prod +spec: + replacePathRegex: + regex: "^/sidata/(.*)" + replacement: "/$1" \ No newline at end of file diff --git a/helm/sidata/templates/secret.yaml b/helm/sidata/templates/secret.yaml new file mode 100644 index 0000000..ce7cd8f --- /dev/null +++ b/helm/sidata/templates/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Release.Name }}-secret +type: Opaque +stringData: + APP_KEY: {{ .Values.secrets.APP_KEY | quote }} + DB_PASSWORD: {{ .Values.secrets.DB_PASSWORD | quote }} + ORA_PASSWORD: {{ .Values.secrets.ORA_PASSWORD | quote }} \ No newline at end of file diff --git a/helm/sidata/templates/service.yaml b/helm/sidata/templates/service.yaml new file mode 100644 index 0000000..eeab364 --- /dev/null +++ b/helm/sidata/templates/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: sidata-service +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: 9000 + protocol: TCP + name: http + selector: + app: sidata \ No newline at end of file diff --git a/helm/sidata/values.yaml b/helm/sidata/values.yaml new file mode 100644 index 0000000..46d6d7f --- /dev/null +++ b/helm/sidata/values.yaml @@ -0,0 +1,45 @@ +replicaCount: 2 + +image: + repository: 10.15.39.186:8083/eosbpkd/sidata + pullPolicy: Always + tag: "latest" + +service: + type: NodePort + port: 80 + targetPort: 9000 + nodePort: 32180 + +ingress: + enabled: true + className: "nginx" + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/proxy-body-size: "64m" + hosts: + - host: "dashboard-bpkd.drc-bpkd.data-center.id" + paths: + - path: "/sidata" + pathType: "Prefix" + +# Environment Variables Aplikasi +env: + APP_NAME: "SIDATA" + APP_ENV: "production" + APP_DEBUG: "false" + APP_URL: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" + ASSET_URL: "https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" + FORCE_HTTPS: "true" + DB_CONNECTION: "mysql" + DB_HOST: "10.15.39.185" + DB_PORT: "3306" + DB_DATABASE: "sidata" + DB_USERNAME: "aplikasi" + ORA_HOST: "10.15.39.193" + +# Rahasia Sensitive +secrets: + APP_KEY: "base64:HiyJqrnWz8zB6WUCXTVb6lZsC3EraX/vFIn66Hx/dVM=" + DB_PASSWORD: "pusdatin" + ORA_PASSWORD: "123456" \ No newline at end of file