Skip to content
Snippets Groups Projects
Commit ddaa2d18 authored by richard.petersen's avatar richard.petersen :sailboat:
Browse files

Apply renaming from manifest-service to ui-middleware

parent 25858a61
No related branches found
No related tags found
No related merge requests found
Showing
with 59 additions and 40 deletions
......@@ -3,7 +3,7 @@ include:
file: '/gitlab-ci/node/kaniko.yml'
variables:
INGRESS_HOSTNAME: manifest-$CI_COMMIT_REF_SLUG
INGRESS_HOSTNAME: ui-middleware-$CI_COMMIT_REF_SLUG
build image:
before_script:
......@@ -18,7 +18,7 @@ deploy helm chart:
name: $CI_COMMIT_REF_SLUG
on_stop: tear down
auto_stop_in: 1 week
url: https://manifest-$CI_COMMIT_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
url: https://ui-middleware-$CI_COMMIT_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
after_script:
- envsubst < .gitlab-ci/kubernetes-resources.yaml > tmp-k8s-resources.yaml
- kubectl apply -f tmp-k8s-resources.yaml
......@@ -18,7 +18,7 @@ metadata:
name: ${OX_COMPONENT}
spec:
rules:
- host: manifest-${CI_COMMIT_REF_SLUG}.k3s.os2.oxui.de
- host: ui-middleware-${CI_COMMIT_REF_SLUG}.k3s.os2.oxui.de
http:
paths:
- path: /
......
# manifest-service
# ui-middleware
> Provides the collected manifest.json of services in a cluster as well as a list of dependencies
> for each source file. This information can be used to dynamically compile all ui components at
......@@ -20,18 +20,18 @@
**docker**
```
docker build -t manifest-service .
docker run -t -i -p 8080:8080 manifest-service
docker build -t ui-middleware .
docker run -t -i -p 8080:8080 ui-middleware
```
**kubernetes**
```
cd helm
helm upgrade -i -f manifest-service/values.yaml -f values/develop.yaml manifest-service ./manifest-service
helm upgrade -i -f ui-middleware/values.yaml -f values/develop.yaml ui-middleware ./ui-middleware
```
It is possible to horizontally scale the manifest service, as more clients are fetching resources from this service. Each instance maintains a cache of all files locally (in memory), allowing to scale easily.
It is possible to horizontally scale the UI Middleware, as more clients are fetching resources from this service. Each instance maintains a cache of all files locally (in memory), allowing to scale easily.
## Configuration
......@@ -57,4 +57,4 @@ When using Ingress to make the service available to the public, the service is i
configured as a "fallback" or "default" service to answer all requests that are not specified
to be served by one of the other services (e.g like everything under /api). This should simplify
the Ingress configuration. One example can be found
[in the manifest-service repository](https://gitlab.open-xchange.com/frontend/Infrastructure/manifest-service/-/blob/main/.gitlab-ci/kubernetes-resources.yaml).
[in the ui-middleware repository](https://gitlab.open-xchange.com/frontend/Infrastructure/ui-middleware/-/blob/main/.gitlab-ci/kubernetes-resources.yaml).
apiVersion: v2
name: core-manifest-service
description: Helm chart for core manifest service
name: core-ui-middleware
description: Helm chart for core ui middleware
# A chart can be either an 'application' or a 'library' chart.
#
......@@ -15,13 +15,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.0.5
version: 1.0.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.1.0"
appVersion: "1.0.0"
dependencies:
- name: ox-common
version: 1.0.17
......
......@@ -6,16 +6,16 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "core-manifest-service.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "core-ui-middleware.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "core-manifest-service.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "core-manifest-service.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "core-ui-middleware.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "core-ui-middleware.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "core-manifest-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "core-ui-middleware.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
......
{{/*
Expand the name of the chart.
*/}}
{{- define "core-manifest-service.name" -}}
{{- define "core-ui-middleware.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
......@@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "core-manifest-service.fullname" -}}
{{- define "core-ui-middleware.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
......@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "core-manifest-service.chart" -}}
{{- define "core-ui-middleware.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "core-manifest-service.labels" -}}
helm.sh/chart: {{ include "core-manifest-service.chart" . }}
{{ include "core-manifest-service.selectorLabels" . }}
{{- define "core-ui-middleware.labels" -}}
helm.sh/chart: {{ include "core-ui-middleware.chart" . }}
{{ include "core-ui-middleware.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
......@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "core-manifest-service.selectorLabels" -}}
app.kubernetes.io/name: {{ include "core-manifest-service.name" . }}
{{- define "core-ui-middleware.selectorLabels" -}}
app.kubernetes.io/name: {{ include "core-ui-middleware.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "core-manifest-service.serviceAccountName" -}}
{{- define "core-ui-middleware.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "core-manifest-service.fullname" .) .Values.serviceAccount.name }}
{{- default (include "core-ui-middleware.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
......
{{- define "core-manifest-service.ingressPathMappings" -}}
{{- define "core-ui-middleware.ingressPathMappings" -}}
paths:
- path: /
{{- end -}}
......@@ -2,14 +2,14 @@
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "core-manifest-service.fullname" . }}
name: {{ include "core-ui-middleware.fullname" . }}
labels:
{{- include "core-manifest-service.labels" . | nindent 4 }}
{{- include "core-ui-middleware.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "core-manifest-service.fullname" . }}
name: {{ include "core-ui-middleware.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
......
......@@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "core-manifest-service.serviceAccountName" . }}
name: {{ include "core-ui-middleware.serviceAccountName" . }}
labels:
{{- include "core-manifest-service.labels" . | nindent 4 }}
{{- include "core-ui-middleware.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
......
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "core-manifest-service.fullname" . }}-test-connection"
name: "{{ include "core-ui-middleware.fullname" . }}-test-connection"
labels:
{{- include "core-manifest-service.labels" . | nindent 4 }}
{{- include "core-ui-middleware.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
......@@ -11,5 +11,5 @@ spec:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "core-manifest-service.fullname" . }}:{{ .Values.service.port }}']
args: ['{{ include "core-ui-middleware.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
# Default values for core-manifest-service.
# Default values for core-ui-middleware.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
......@@ -9,7 +9,7 @@ defaultRegistry: registry.open-xchange.com
containerPort: 8080
image:
repository: "core-manifest-service"
repository: "core-ui-middleware"
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
......@@ -51,7 +51,7 @@ service:
ingress:
enabled: true
pathMappings: "core-manifest-service.ingressPathMappings"
pathMappings: "core-ui-middleware.ingressPathMappings"
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
......
replicaCount: 1
containerPort: 8080
baseUrls:
- https://manifest-service-dummy.k3s.os.oxui.de/manifest.json
- https://ui-middleware-dummy.k3s.os.oxui.de/manifest.json
ingress:
enabled: true
hosts:
- host: manifest-${CI_COMMIT_REF_SLUG}.k3s.os.oxui.de
- host: ui-middleware-${CI_COMMIT_REF_SLUG}.k3s.os.oxui.de
paths:
- path: /
pathType: ImplementationSpecific
......
name: main-core-manifest-service
name: main-core-ui-middleware
image: node:17-alpine
command: ["sh", "okteto-entrypoint.sh"]
workdir: /app
......
{
"name": "manifest-service",
"version": "1.1.0",
"name": "@open-xchange/ui-middleware",
"version": "1.0.0",
"description": "Provides a combined manifest.json",
"type": "module",
"main": "src/index.js",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment