Skip to content

Commit edef131

Browse files
authored
Merge pull request #114 from zvlb/main
Prepare repo for UI
2 parents 7fde88a + 723c36d commit edef131

File tree

13 files changed

+323
-100
lines changed

13 files changed

+323
-100
lines changed

.github/workflows/build-image.yaml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,46 @@
1-
name: Build and Test
1+
name: Build and Push
22

33
# This workflow will run on master branch and on any pull requests targeting master
44
on:
55
push:
66
tags:
77
- 'v*'
88
jobs:
9-
build-and-push-docker-image:
10-
name: Build and push Docker image
9+
build-and-push:
10+
name: Build and push Docker images
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515

1616
- name: Get tag
1717
id: tag
1818
run: echo "TAG=$(git describe --tags HEAD)" >> $GITHUB_OUTPUT
1919

2020
- name: Set up QEMU
21-
uses: docker/setup-qemu-action@v1
21+
uses: docker/setup-qemu-action@v3
2222

2323
- name: Set up Docker Buildx
24-
uses: docker/setup-buildx-action@v2
24+
uses: docker/setup-buildx-action@v3
2525

2626
- name: Login to DockerHub
27-
uses: docker/login-action@v2
27+
uses: docker/login-action@v3
2828
with:
2929
username: ${{ secrets.DOCKERHUB_USERNAME }}
3030
password: ${{ secrets.DOCKERHUB_TOKEN }}
3131

32-
- name: Build image and push to Docker Hub
32+
- name: Build Main image and push to Docker Hub
3333
uses: docker/build-push-action@v2
3434
with:
3535
context: .
3636
platforms: linux/amd64,linux/arm64
3737
push: true
38-
tags: ${{ github.repository }}:${{ steps.tag.outputs.TAG }},${{ github.repository }}:latest
38+
tags: ${{ github.repository }}:${{ steps.tag.outputs.TAG }},${{ github.repository }}:latest
39+
40+
- name: Build UI image and push to Docker Hub
41+
uses: docker/build-push-action@v2
42+
with:
43+
context: ./ui
44+
platforms: linux/amd64,linux/arm64
45+
push: true
46+
tags: ${{ github.repository }}-ui:${{ steps.tag.outputs.TAG }},${{ github.repository }}-ui:latest

helm/charts/envoy-xds-controller/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: "0.44"
18+
version: "0.45"
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "v0.1.40"
24+
appVersion: "v0.1.41"
2525

2626
home: https://github.com/kaasops/envoy-xds-controller
2727
sources:

helm/charts/envoy-xds-controller/templates/_helpers.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4343
app.kubernetes.io/managed-by: {{ .Release.Service }}
4444
{{- end -}}
4545

46+
{{- define "chart.labels-ui" -}}
47+
helm.sh/chart: {{ include "chart.chart" . }}
48+
{{ include "chart.selectorLabels-ui" . }}
49+
{{- if .Chart.AppVersion }}
50+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
51+
{{- end }}
52+
app.kubernetes.io/managed-by: {{ .Release.Service }}
53+
{{- end -}}
54+
4655
{{/*
4756
Selector labels
4857
*/}}
@@ -51,6 +60,11 @@ app.kubernetes.io/name: {{ include "chart.name" . }}
5160
app.kubernetes.io/instance: {{ .Release.Name }}
5261
{{- end -}}
5362

63+
{{- define "chart.selectorLabels-ui" -}}
64+
app.kubernetes.io/name: {{ include "chart.name" . }}-ui
65+
app.kubernetes.io/instance: {{ .Release.Name }}
66+
{{- end -}}
67+
5468
{{/*
5569
Create the name of the service account to use
5670
*/}}

helm/charts/envoy-xds-controller/templates/ingress-cache-api.yaml renamed to helm/charts/envoy-xds-controller/templates/cache-api/ingress.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{- if .Values.cacheAPI.enabled -}}
2+
{{- if .Values.cacheAPI.ingress.enabled -}}
23
{{- $fullName := include "chart.fullname" . -}}
34
{{- $svcPort := .Values.cacheAPI.port -}}
45
apiVersion: networking.k8s.io/v1
@@ -13,7 +14,7 @@ metadata:
1314
{{- end }}
1415
spec:
1516
{{- if .Values.cacheAPI.ingress.className }}
16-
ingressClassName: {{ .Values.ingress.className }}
17+
ingressClassName: {{ .Values.cacheAPI.ingress.className }}
1718
{{- end }}
1819
{{- if .Values.cacheAPI.ingress.tls }}
1920
tls:
@@ -41,3 +42,4 @@ spec:
4142
{{- end }}
4243
{{- end }}
4344
{{- end }}
45+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if .Values.cacheAPI.enabled }}
2+
---
3+
apiVersion: v1
4+
kind: Service
5+
metadata:
6+
name: {{ template "chart.fullname" . }}-cache-api
7+
labels:
8+
{{- include "chart.labels" . | nindent 4 }}
9+
{{- with .Values.extraLabels }}
10+
{{ toYaml . | indent 4 }}
11+
{{- end }}
12+
spec:
13+
type: {{ .Values.service.type }}
14+
ports:
15+
- port: {{ .Values.cacheAPI.port }}
16+
targetPort: {{ .Values.cacheAPI.port }}
17+
protocol: TCP
18+
name: http
19+
selector:
20+
{{- include "chart.selectorLabels" . | nindent 4 }}
21+
{{- end }}

helm/charts/envoy-xds-controller/templates/service.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,3 @@ spec:
1616
name: grpc
1717
selector:
1818
{{- include "chart.selectorLabels" . | nindent 4 }}
19-
20-
{{- if .Values.cacheAPI.enabled }}
21-
---
22-
apiVersion: v1
23-
kind: Service
24-
metadata:
25-
name: {{ template "chart.fullname" . }}-cache-api
26-
labels:
27-
{{- include "chart.labels" . | nindent 4 }}
28-
{{- with .Values.extraLabels }}
29-
{{ toYaml . | indent 4 }}
30-
{{- end }}
31-
spec:
32-
type: {{ .Values.service.type }}
33-
ports:
34-
- port: {{ .Values.cacheAPI.port }}
35-
targetPort: {{ .Values.cacheAPI.port }}
36-
protocol: TCP
37-
name: http
38-
selector:
39-
{{- include "chart.selectorLabels" . | nindent 4 }}
40-
{{- end }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{{- if .Values.ui.enabled -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ include "chart.fullname" . }}-ui
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "chart.labels-ui" . | nindent 4 }}
9+
{{- with .Values.extraLabels }}
10+
{{ toYaml . | indent 4 }}
11+
{{- end }}
12+
{{- with .Values.annotations }}
13+
annotations:
14+
{{- toYaml . | nindent 4 }}
15+
{{- end }}
16+
spec:
17+
replicas: 1
18+
{{- with .Values.strategy }}
19+
strategy:
20+
{{- toYaml . | nindent 4 }}
21+
{{- end }}
22+
selector:
23+
matchLabels:
24+
{{- include "chart.selectorLabels-ui" . | nindent 6 }}
25+
template:
26+
metadata:
27+
labels:
28+
{{- include "chart.selectorLabels-ui" . | nindent 8 }}
29+
spec:
30+
{{- with .Values.imagePullSecrets }}
31+
imagePullSecrets:
32+
{{- toYaml . | nindent 8 }}
33+
{{- end }}
34+
{{- with .Values.tolerations }}
35+
tolerations:
36+
{{- toYaml . | nindent 8 }}
37+
{{- end }}
38+
serviceAccountName: {{ include "chart.serviceAccountName" . }}
39+
{{- with .Values.podSecurityContext }}
40+
securityContext:
41+
{{- toYaml . | nindent 8 }}
42+
{{- end }}
43+
containers:
44+
- image: {{ .Values.ui.image.repository }}:{{ default .Chart.AppVersion .Values.ui.image.tag }}
45+
{{- if .Values.ui.args }}
46+
args:
47+
{{- toYaml .Values.ui.args | nindent 10 }}
48+
{{- end }}
49+
env:
50+
- name: VITE_ROOT_API_URL
51+
value: "{{ template "chart.fullname" . }}-cache-api:{{ .Values.cacheAPI.port }}"
52+
{{- with .Values.ui.envs }}
53+
{{- tpl . $ | nindent 10 }}
54+
{{- end }}
55+
ports:
56+
- name: http
57+
containerPort: {{ .Values.ui.port }}
58+
protocol: TCP
59+
{{- with .Values.securityContext }}
60+
securityContext:
61+
{{- toYaml . | nindent 10 }}
62+
{{- end }}
63+
imagePullPolicy: {{ .Values.image.pullPolicy }}
64+
name: envoy-xds-controller-ui
65+
resources:
66+
{{ toYaml .Values.ui.resources | indent 12 }}
67+
{{- end }}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{- if .Values.ui.enabled -}}
2+
{{- if .Values.ui.ingress.enabled -}}
3+
{{- $fullName := include "chart.fullname" . -}}
4+
{{- $svcPort := .Values.ui.port -}}
5+
apiVersion: networking.k8s.io/v1
6+
kind: Ingress
7+
metadata:
8+
name: {{ $fullName }}-ui
9+
labels:
10+
{{- include "chart.labels-ui" . | nindent 4 }}
11+
{{- with .Values.ui.ingress.annotations }}
12+
annotations:
13+
{{- toYaml . | nindent 4 }}
14+
{{- end }}
15+
spec:
16+
{{- if .Values.ui.ingress.className }}
17+
ingressClassName: {{ .Values.ui.ingress.className }}
18+
{{- end }}
19+
{{- if .Values.ui.ingress.tls }}
20+
tls:
21+
{{- range .Values.ui.ingress.tls }}
22+
- hosts:
23+
{{- range .hosts }}
24+
- {{ . | quote }}
25+
{{- end }}
26+
secretName: {{ .secretName }}
27+
{{- end }}
28+
{{- end }}
29+
rules:
30+
{{- range .Values.ui.ingress.hosts }}
31+
- host: {{ .host | quote }}
32+
http:
33+
paths:
34+
{{- range .paths }}
35+
- path: {{ .path }}
36+
pathType: {{ .pathType }}
37+
backend:
38+
service:
39+
name: {{ $fullName }}-ui
40+
port:
41+
number: {{ $svcPort }}
42+
{{- end }}
43+
{{- end }}
44+
{{- end }}
45+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if .Values.ui.enabled }}
2+
---
3+
apiVersion: v1
4+
kind: Service
5+
metadata:
6+
name: {{ template "chart.fullname" . }}-ui
7+
labels:
8+
{{- include "chart.labels-ui" . | nindent 4 }}
9+
{{- with .Values.extraLabels }}
10+
{{ toYaml . | indent 4 }}
11+
{{- end }}
12+
spec:
13+
type: {{ .Values.service.type }}
14+
ports:
15+
- port: {{ .Values.ui.port }}
16+
targetPort: {{ .Values.ui.port }}
17+
protocol: TCP
18+
name: http
19+
selector:
20+
{{- include "chart.selectorLabels-ui" . | nindent 4 }}
21+
{{- end }}

helm/charts/envoy-xds-controller/values.yaml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,57 @@ nameOverride: ""
33
namespaceOverride: ""
44

55
xds:
6-
port: 8080
6+
port: 9000
77

88
cacheAPI:
99
enabled: false
1010
port: 9999
1111
address: "localhost:9999"
1212
scheme: "http"
13+
ingress:
14+
enabled: false
15+
annotations: {}
16+
className: ""
17+
hosts: []
18+
# - host: envoy-xds-controller-api.<DOMAIN-ZONE>
19+
# paths:
20+
# - path: /
21+
# pathType: Prefix
22+
tls: []
23+
# - hosts:
24+
# - envoy-xds-controller-api.<DOMAIN-ZONE>
25+
26+
27+
ui:
28+
enabled: false
29+
image:
30+
repository: kaasops/envoy-xds-controller-ui
31+
tag: "" # rewrites Chart.AppVersion
32+
pullPolicy: IfNotPresent
33+
args: []
34+
envs: {}
35+
resources:
36+
limits:
37+
cpu: "1"
38+
memory: 1Gi
39+
requests:
40+
cpu: 100m
41+
memory: 50Mi
42+
port: 80
43+
ingress:
44+
enabled: false
45+
annotations:
46+
nginx.ingress.kubernetes.io/app-root: /nodeIDs
47+
className: ""
48+
hosts: []
49+
# - host: envoy-xds-controller-ui.<DOMAIN-ZONE>
50+
# paths:
51+
# - path: /
52+
# pathType: Prefix
53+
tls: []
54+
# - hosts:
55+
# - envoy-xds-controller-ui.<DOMAIN-ZONE>
56+
1357

1458

1559
replicaCount: 1
@@ -62,6 +106,16 @@ service:
62106

63107
ingress:
64108
enabled: false
109+
annotations: {}
110+
className: ""
111+
hosts: []
112+
# - host: envoy-xds-controller.<DOMAIN-ZONE>
113+
# paths:
114+
# - path: /
115+
# pathType: Prefix
116+
tls: []
117+
# - hosts:
118+
# - envoy-xds-controller.<DOMAIN-ZONE>
65119

66120
serviceAccount:
67121
# Specifies whether a service account should be created

0 commit comments

Comments
 (0)