diff --git a/opencloud/dev-values.yaml b/opencloud/dev-values.yaml index 0f123eb..85e1d5e 100644 --- a/opencloud/dev-values.yaml +++ b/opencloud/dev-values.yaml @@ -281,6 +281,17 @@ ocWorkspace: cpu: "128m" memory: "256Mi" +ocShared: + enabled: true + image: oc/oc-shared:0.0.1 + resources: + limits: + cpu: "128m" + memory: "256Mi" + requests: + cpu: "128m" + memory: "256Mi" + loki: enabled: false diff --git a/opencloud/templates/oc-front/config.yaml b/opencloud/templates/oc-front/config.yaml index b593fab..f8dea2f 100644 --- a/opencloud/templates/oc-front/config.yaml +++ b/opencloud/templates/oc-front/config.yaml @@ -13,7 +13,7 @@ data: "LOGS_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/logs", "PEER_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/peers/oc", "DATACENTER_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/datacenter/oc", - "COLLABORATIVE_AREA_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/collaborative/oc", + "COLLABORATIVE_AREA_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/shared/oc", "HOST": "{{ .Values.scheme }}://{{ .Values.host }}/oc", "AUTH_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/auth/oc" } diff --git a/opencloud/templates/oc-front/ingress.yaml b/opencloud/templates/oc-front/ingress.yaml index 081ce4b..550df7b 100644 --- a/opencloud/templates/oc-front/ingress.yaml +++ b/opencloud/templates/oc-front/ingress.yaml @@ -9,7 +9,7 @@ spec: routes: - kind: Rule match: Host(`{{ .Values.host }}`) && PathPrefix(`/`) - priority: 10 + priority: 5 services: - kind: Service name: oc-front-svc diff --git a/opencloud/templates/oc-shared/deployment.yaml b/opencloud/templates/oc-shared/deployment.yaml new file mode 100644 index 0000000..1076b2a --- /dev/null +++ b/opencloud/templates/oc-shared/deployment.yaml @@ -0,0 +1,35 @@ +{{- if index .Values.ocShared.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: oc-shared + name: {{ .Release.Name }}-oc-shared +spec: + replicas: 1 + selector: + matchLabels: + app: oc-shared + template: + metadata: + labels: + app: oc-shared + spec: + containers: + - image: "{{ .Values.ocShared.image }}" + name: oc-shared + envFrom: + - configMapRef: + name: opencloud-config + ports: + - name: http + containerPort: 8080 + protocol: TCP + resources: + limits: + cpu: "{{ .Values.ocShared.resources.limits.cpu }}" + memory: "{{ .Values.ocShared.resources.limits.memory }}" + requests: + cpu: "{{ .Values.ocShared.resources.requests.cpu }}" + memory: "{{ .Values.ocShared.resources.requests.memory }}" + {{- end }} \ No newline at end of file diff --git a/opencloud/templates/oc-shared/ingress.yaml b/opencloud/templates/oc-shared/ingress.yaml new file mode 100644 index 0000000..5bc1dec --- /dev/null +++ b/opencloud/templates/oc-shared/ingress.yaml @@ -0,0 +1,29 @@ +{{- if index .Values.ocShared.enabled }} +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: oc-shared-ingress +spec: + entryPoints: + - web + routes: + - kind: Rule + match: Host(`{{ .Values.host }}`) && PathPrefix(`/shared`) + priority: 10 + services: + - kind: Service + name: oc-shared-svc + port: 8080 + middlewares: + - name: strip-shared-prefix + +--- +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: strip-shared-prefix +spec: + stripPrefix: + prefixes: + - "/shared" +{{- end }} \ No newline at end of file diff --git a/opencloud/templates/oc-shared/service.yaml b/opencloud/templates/oc-shared/service.yaml new file mode 100644 index 0000000..6a46dbb --- /dev/null +++ b/opencloud/templates/oc-shared/service.yaml @@ -0,0 +1,17 @@ +{{- if index .Values.ocShared.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: oc-shared-svc + labels: + app: oc-shared-svc +spec: + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: oc-shared + type: ClusterIP +{{- end }} \ No newline at end of file