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