From 72717bb09e184d02a4000b986ceb4ce22c5a5edb Mon Sep 17 00:00:00 2001 From: subochev Date: Tue, 7 Apr 2026 18:18:06 +0300 Subject: [PATCH] =?UTF-8?q?DEVX-190:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D1=82=D1=8C=20=D0=B4=D1=83=D0=B1=D0=BB=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=B3=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2=D0=BA=D0=B0=20Transfer-Encoding=20=D0=B2=20?= =?UTF-8?q?=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D0=B0=D1=85=20api-service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devspc/devspace-gateway/Chart.yaml | 10 ++ .../devspace-gateway/templates/configmap.yaml | 29 +++++ .../templates/deployment.yaml | 113 ++++++++++++++++++ .../devspace-gateway/templates/ingress.yaml | 19 +++ .../templates/middleware.yaml | 9 ++ devspc/devspace-gateway/templates/route.yaml | 16 +++ devspc/devspace-gateway/values.yaml | 18 +++ 7 files changed, 214 insertions(+) create mode 100644 devspc/devspace-gateway/Chart.yaml create mode 100644 devspc/devspace-gateway/templates/configmap.yaml create mode 100644 devspc/devspace-gateway/templates/deployment.yaml create mode 100644 devspc/devspace-gateway/templates/ingress.yaml create mode 100644 devspc/devspace-gateway/templates/middleware.yaml create mode 100644 devspc/devspace-gateway/templates/route.yaml create mode 100644 devspc/devspace-gateway/values.yaml diff --git a/devspc/devspace-gateway/Chart.yaml b/devspc/devspace-gateway/Chart.yaml new file mode 100644 index 0000000..6f21cb7 --- /dev/null +++ b/devspc/devspace-gateway/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: devspace-gateway +description: KuberService +home: https://tlsys.ru/ +icon: https://lk.tlsys.org/favicon.png +keywords: + - test +type: application +version: "9.9.9" +appVersion: "9.9.9" diff --git a/devspc/devspace-gateway/templates/configmap.yaml b/devspc/devspace-gateway/templates/configmap.yaml new file mode 100644 index 0000000..e83fca0 --- /dev/null +++ b/devspc/devspace-gateway/templates/configmap.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{$.Release.Name}}-{{$.Chart.Name}}-main-config +data: + application.yaml: | + server: + port: {{ $.Values.port }} + management: + server: + port: {{ $.Values.managementPort }} + spring: + cloud: + vault: + enabled: true + app-role.role-id: '{{$.Values.vault.appRole.roleId}}' + app-role.secret-id: '{{$.Values.vault.appRole.secretId}}' + config.lifecycle.enabled: true + session.lifecycle.enabled: true + fail-fast: true + api-registry-core: + url: 'http://{{$.Values.services.core}}' + api-registry-generator: + url: 'http://{{$.Values.services.generator}}' + app: + auth: + enabled: true + jwk-uri: 'http://{{$.Values.keycloak.jwk}}' + jwt-service-claim-name: '{{$.Values.keycloak.claimName}}' \ No newline at end of file diff --git a/devspc/devspace-gateway/templates/deployment.yaml b/devspc/devspace-gateway/templates/deployment.yaml new file mode 100644 index 0000000..67d58be --- /dev/null +++ b/devspc/devspace-gateway/templates/deployment.yaml @@ -0,0 +1,113 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{$.Release.Name}}-{{$.Values.name}}" + annotations: + devspace.isb/name: {{ $.Values.repository.name | quote }} + devspace.isb/branch: {{ $.Values.repository.branch | quote }} + rollme: {{ .Release.Revision | quote }} + labels: + {{- if $.Values.labels}} + {{- toYaml $.Values.labels | nindent 4 }} + {{- end}} + app.kubernetes.io/name: {{$.Values.name}} + app.kubernetes.io/instance: {{ $.Release.Name }} + app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }} +spec: + {{- if not $.Values.autoscaling.enabled }} + {{ if $.Values.replicaCount }} + replicas: {{ $.Values.replicaCount }} + {{ else }} + replicas: 1 + {{end}} + {{- end }} + selector: + matchLabels: + app.kubernetes.io/name: {{$.Values.name}} + app.kubernetes.io/instance: {{ $.Release.Name }} + template: + metadata: + annotations: + rollme: {{ .Release.Revision | quote }} + metric.binom.pw/enabled: '{{$.Values.metrics}}' + {{ if ($.Values.metrics) }} + metric.binom.pw/url: ":9090/prometheus" + {{ end }} + {{- with $.Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app.kubernetes.io/name: {{$.Values.name}} + app.kubernetes.io/instance: {{ $.Release.Name }} +{{/* app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}*/}} + spec: + {{- with $.Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{ if $.Values.serviceAccount }} + serviceAccountName: {{ $.Values.serviceAccount.name }} + {{ end }} + volumes: + - name: application-properties-volume + configMap: + name: {{$.Release.Name}}-{{$.Chart.Name}}-main-config + items: + - key: application.yaml + path: application.yaml + - name: dependencies-data + persistentVolumeClaim: + claimName: "{{$.Release.Name}}-{{$.Values.name}}-dependencies" + securityContext: + {{- toYaml $.Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ $.Chart.Name }} + securityContext: + {{- toYaml $.Values.securityContext | nindent 12 }} + image: "{{ $.Values.image.name }}:{{ $.Values.image.version }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} + env: + - name: SPRING_CONFIG_ADDITIONAL_LOCATION + value: "file:/opt/app/config/application.yaml" + volumeMounts: + - mountPath: '/opt/app/config' + name: application-properties-volume + - name: dependencies-data + mountPath: /storage + ports: + - name: http + containerPort: {{ $.Values.port }} + protocol: TCP + - name: management + containerPort: {{ $.Values.managementPort }} + protocol: TCP + livenessProbe: + httpGet: + path: '/actuator/health/liveness' + port: management + initialDelaySeconds: 20 + periodSeconds: 10 + readinessProbe: + httpGet: + path: '/actuator/health/readiness' + port: management + initialDelaySeconds: 10 + periodSeconds: 10 + {{- if $.Values.resources}} + resources: + {{- toYaml $.Values.resources | nindent 12}} + {{- else}} + resources: { } + {{end}} + {{- with $.Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $.Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $.Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} \ No newline at end of file diff --git a/devspc/devspace-gateway/templates/ingress.yaml b/devspc/devspace-gateway/templates/ingress.yaml new file mode 100644 index 0000000..eaa9fe3 --- /dev/null +++ b/devspc/devspace-gateway/templates/ingress.yaml @@ -0,0 +1,19 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{$.Release.Name}}-{{$.Values.name}} + namespace: {{$.Release.Namespace}} + annotations: + traefik.ingress.kubernetes.io/router.middlewares: {{$.Release.Namespace}}-{{$.Release.Name}}-url-prefix@kubernetescrd +spec: + rules: + - host: {{tpl $.Values.ingress.host .}} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: "{{ $.Release.Name }}-{{ $.Values.name }}" + port: + number: {{ $.Values.port }} \ No newline at end of file diff --git a/devspc/devspace-gateway/templates/middleware.yaml b/devspc/devspace-gateway/templates/middleware.yaml new file mode 100644 index 0000000..055c83b --- /dev/null +++ b/devspc/devspace-gateway/templates/middleware.yaml @@ -0,0 +1,9 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: {{$.Release.Name}}-url-prefix + namespace: {{$.Release.Namespace}} +spec: + stripPrefix: + prefixes: + - {{$.Values.ingress.prefix}} \ No newline at end of file diff --git a/devspc/devspace-gateway/templates/route.yaml b/devspc/devspace-gateway/templates/route.yaml new file mode 100644 index 0000000..1e3bc9a --- /dev/null +++ b/devspc/devspace-gateway/templates/route.yaml @@ -0,0 +1,16 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: {{ $.Release.Name }}-{{ $.Values.name }}-route + namespace: devx +spec: + entryPoints: + - web + routes: + - match: Host(`{{tpl $.Values.ingress.host .}}`) + kind: Rule + middlewares: + - name: {{$.Release.Name}}-cors + services: + - name: "{{ $.Release.Name }}-{{ $.Values.name }}" + port: {{ $.Values.port }} \ No newline at end of file diff --git a/devspc/devspace-gateway/values.yaml b/devspc/devspace-gateway/values.yaml new file mode 100644 index 0000000..ff5c0b1 --- /dev/null +++ b/devspc/devspace-gateway/values.yaml @@ -0,0 +1,18 @@ +ingress: + host: 'gateway.devx.kube.xx' +port: 8080 +managementPort: 9090 +name: agent +vault: + appRole: + roleId: '85a3c725-075b-b107-b948-a076625a1a37' + secretId: 'b36b7b4c-5da4-d5cf-1cdf-f367bd52b475' +services: + core: 'devspace-apiregistry-core-service-agent' + generator: 'devspace-apiregistry-generator-service-agent' +keycloak: + jwk: 'http://192.168.76.150:8080/realms/devspace-dev/protocol/openid-connect/certs' + claimName: 'development-space' +ingress: + host: 'ui.devx.kube.xx' + prefix: '/devspace-ui' \ No newline at end of file