From fb5aed882fe196af00418dc78eb78bba34dbc860 Mon Sep 17 00:00:00 2001 From: plm Date: Fri, 10 Jan 2025 11:43:01 +0100 Subject: [PATCH] Integrating workflow microservice --- opencloud/dev-values.yaml | 12 +++++++ .../templates/oc-workflow/deployment.yaml | 35 +++++++++++++++++++ opencloud/templates/oc-workflow/ingress.yaml | 29 +++++++++++++++ opencloud/templates/oc-workflow/service.yaml | 17 +++++++++ 4 files changed, 93 insertions(+) create mode 100644 opencloud/templates/oc-workflow/deployment.yaml create mode 100644 opencloud/templates/oc-workflow/ingress.yaml create mode 100644 opencloud/templates/oc-workflow/service.yaml diff --git a/opencloud/dev-values.yaml b/opencloud/dev-values.yaml index 85e1d5e..893669b 100644 --- a/opencloud/dev-values.yaml +++ b/opencloud/dev-values.yaml @@ -292,6 +292,18 @@ ocShared: cpu: "128m" memory: "256Mi" +ocWorkflow: + enabled: true + image: oc/oc-workflow:0.0.1 + resources: + limits: + cpu: "128m" + memory: "256Mi" + requests: + cpu: "128m" + memory: "256Mi" + + loki: enabled: false diff --git a/opencloud/templates/oc-workflow/deployment.yaml b/opencloud/templates/oc-workflow/deployment.yaml new file mode 100644 index 0000000..5140005 --- /dev/null +++ b/opencloud/templates/oc-workflow/deployment.yaml @@ -0,0 +1,35 @@ +{{- if index .Values.ocWorkflow.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: oc-workflow + name: {{ .Release.Name }}-oc-workflow +spec: + replicas: 1 + selector: + matchLabels: + app: oc-workflow + template: + metadata: + labels: + app: oc-workflow + spec: + containers: + - image: "{{ .Values.ocWorkflow.image }}" + name: oc-shared + envFrom: + - configMapRef: + name: opencloud-config + ports: + - name: http + containerPort: 8080 + protocol: TCP + resources: + limits: + cpu: "{{ .Values.ocWorkflow.resources.limits.cpu }}" + memory: "{{ .Values.ocWorkflow.resources.limits.memory }}" + requests: + cpu: "{{ .Values.ocWorkflow.resources.requests.cpu }}" + memory: "{{ .Values.ocWorkflow.resources.requests.memory }}" + {{- end }} \ No newline at end of file diff --git a/opencloud/templates/oc-workflow/ingress.yaml b/opencloud/templates/oc-workflow/ingress.yaml new file mode 100644 index 0000000..214c934 --- /dev/null +++ b/opencloud/templates/oc-workflow/ingress.yaml @@ -0,0 +1,29 @@ +{{- if index .Values.ocWorkflow.enabled }} +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: oc-workflow-ingress +spec: + entryPoints: + - web + routes: + - kind: Rule + match: Host(`{{ .Values.host }}`) && PathPrefix(`/workflow`) + priority: 10 + services: + - kind: Service + name: oc-workflow-svc + port: 8080 + middlewares: + - name: strip-workflow-prefix + +--- +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: strip-workflow-prefix +spec: + stripPrefix: + prefixes: + - "/workflow" +{{- end }} \ No newline at end of file diff --git a/opencloud/templates/oc-workflow/service.yaml b/opencloud/templates/oc-workflow/service.yaml new file mode 100644 index 0000000..03cca9c --- /dev/null +++ b/opencloud/templates/oc-workflow/service.yaml @@ -0,0 +1,17 @@ +{{- if index .Values.ocWorkflow.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: oc-workflow-svc + labels: + app: oc-workflow-svc +spec: + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app: oc-workflow + type: ClusterIP +{{- end }} \ No newline at end of file