Integrating front and workspace service

This commit is contained in:
plm
2025-01-08 23:05:38 +01:00
parent 10b01fdc40
commit f868400b7a
11 changed files with 236 additions and 31 deletions

View File

@@ -0,0 +1,20 @@
{{- if index .Values.ocFront.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: front-config
data:
config.json: |
{
"WORKSPACE_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/workspace/oc",
"WORKFLOW_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/workflow/oc",
"ITEM_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/item/oc",
"SCHEDULER_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/scheduler/oc",
"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",
"HOST": "{{ .Values.scheme }}://{{ .Values.host }}/oc",
"AUTH_HOST": "{{ .Values.scheme }}://{{ .Values.host }}/auth/oc"
}
{{- end }}

View File

@@ -0,0 +1,40 @@
{{- if index .Values.ocFront.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: oc-front
name: {{ .Release.Name }}-oc-front
spec:
replicas: 1
selector:
matchLabels:
app: oc-front
template:
metadata:
labels:
app: oc-front
spec:
volumes:
- name: config-volume
configMap:
name: front-config
containers:
- image: "{{ .Values.ocFront.image }}"
name: oc-front
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
limits:
cpu: "{{ .Values.ocFront.resources.limits.cpu }}"
memory: "{{ .Values.ocFront.resources.limits.memory }}"
requests:
cpu: "{{ .Values.ocFront.resources.requests.cpu }}"
memory: "{{ .Values.ocFront.resources.requests.memory }}"
volumeMounts:
- name: config-volume
mountPath: /usr/share/nginx/html/assets/assets/config/front.json
subPath: config.json
{{- end }}

View File

@@ -0,0 +1,17 @@
{{- if index .Values.ocFront.enabled }}
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: oc-front-ingress
spec:
entryPoints:
- web
routes:
- kind: Rule
match: Host(`{{ .Values.host }}`) && PathPrefix(`/`)
priority: 10
services:
- kind: Service
name: oc-front-svc
port: 8080
{{- end }}

View File

@@ -0,0 +1,17 @@
{{- if index .Values.ocFront.enabled }}
apiVersion: v1
kind: Service
metadata:
name: oc-front-svc
labels:
app: oc-front-svc
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 80
selector:
app: oc-front
type: ClusterIP
{{- end }}