From 9c1220fbf68e7e46fa8f0e29ceb9299b77445ce7 Mon Sep 17 00:00:00 2001 From: subochev Date: Fri, 20 Feb 2026 13:08:31 +0300 Subject: [PATCH] init --- .../templates/ingress.yaml | 19 ++++++++++++++++++ .../templates/middleware.yaml | 20 +++++++++++++++++++ .../values.yaml | 2 ++ 3 files changed, 41 insertions(+) create mode 100644 devspc/devspace-apiregistry-core-service/templates/ingress.yaml create mode 100644 devspc/devspace-apiregistry-core-service/templates/middleware.yaml diff --git a/devspc/devspace-apiregistry-core-service/templates/ingress.yaml b/devspc/devspace-apiregistry-core-service/templates/ingress.yaml new file mode 100644 index 0000000..1295ee8 --- /dev/null +++ b/devspc/devspace-apiregistry-core-service/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}}-cors@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-apiregistry-core-service/templates/middleware.yaml b/devspc/devspace-apiregistry-core-service/templates/middleware.yaml new file mode 100644 index 0000000..3a04043 --- /dev/null +++ b/devspc/devspace-apiregistry-core-service/templates/middleware.yaml @@ -0,0 +1,20 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware +metadata: + name: {{$.Release.Name}}-cors + namespace: {{$.Release.Namespace}} +spec: + headers: + accessControlAllowMethods: + - "GET" + - "POST" + - "PUT" + - "DELETE" + - "OPTIONS" + accessControlAllowHeaders: + - "Content-Type" + - "Authorization" + accessControlAllowOriginList: + - "*" # или конкретный домен + accessControlMaxAge: 100 + addVaryHeader: true \ No newline at end of file diff --git a/devspc/devspace-apiregistry-core-service/values.yaml b/devspc/devspace-apiregistry-core-service/values.yaml index b2a3f6a..6dd60c1 100644 --- a/devspc/devspace-apiregistry-core-service/values.yaml +++ b/devspc/devspace-apiregistry-core-service/values.yaml @@ -10,6 +10,8 @@ image: name: null pullPolicy: Always version: '' +ingress: + host: 'devspace.xx' name: agent securityContext: privileged: true \ No newline at end of file