Skip to content

Commit

Permalink
Added values.yaml changes. (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
raresgaia123 authored Nov 14, 2023
1 parent f7490f7 commit 6acb55c
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 0 deletions.
27 changes: 27 additions & 0 deletions fiab/helm-chart/control/templates/dashboard-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2023 Cisco Systems, Inc. and its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-dashboard-configmap
namespace: {{ .Release.Namespace }}
data:
api-config.js: |
window.env = {};
window.env.REACT_APP_API_URL="http://{{ .Release.Name }}-apiserver:{{ .Values.servicePort.apiserver }}";
window.env.REACT_APP_MLFLOW_URL="http://{{ .Release.Name }}-mlflow:{{ .Values.mlflow.servicePort }}/ajax-api/2.0/mlflow";
48 changes: 48 additions & 0 deletions fiab/helm-chart/control/templates/dashboard-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2023 Cisco Systems, Inc. and its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-dashboard
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: {{ .Release.Name }}-dashboard
template:
metadata:
labels:
app: {{ .Release.Name }}-dashboard
spec:
containers:
- name: {{ .Release.Name }}-dashboard
image: {{ .Values.imageName }}:{{ .Values.imageTag }}
imagePullPolicy: IfNotPresent
ports:
- containerPort: {{ .Values.servicePort.dashboard }}
command: ["serve", "-s", "dashboard"]
volumeMounts:
- name: config-volume
mountPath: /dashboard/api-config.js
subPath: api-config.js
volumes:
- name: config-volume
configMap:
name: {{ .Release.Name }}-dashboard-configmap

47 changes: 47 additions & 0 deletions fiab/helm-chart/control/templates/dashboard-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2023 Cisco Systems, Inc. and its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: {{ .Values.ingress.apiVersion }}
kind: Ingress
metadata:
name: {{ .Release.Name }}-dashboard
namespace: {{ .Release.Namespace }}
{{- if .Values.ingress.annotations }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.ingressClassName }}
rules:
- host: {{ .Values.frontDoorUrl.dashboard }}
http:
paths:
{{ if eq .Values.ingress.apiVersion "networking.k8s.io/v1" }}
- backend:
service:
name: {{ .Release.Name }}-dashboard
port:
number: {{ .Values.servicePort.dashboard }}
pathType: Prefix
path: /
{{ else }}
- backend:
serviceName: {{ .Release.Name }}-dashboard
servicePort: {{ .Values.servicePort.dashboard }}
path: /
{{ end }}
34 changes: 34 additions & 0 deletions fiab/helm-chart/control/templates/dashboard-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2023 Cisco Systems, Inc. and its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: {{ .Release.Name }}-dashboard
tier: backend
name: {{ .Release.Name }}-dashboard
namespace: {{ .Release.Namespace }}
spec:
ports:
- name: dashboard
protocol: TCP
port: {{ .Values.servicePort.dashboard }}
targetPort: {{ .Values.servicePort.dashboard }}
selector:
app: {{ .Release.Name }}-dashboard
type: ClusterIP
2 changes: 2 additions & 0 deletions fiab/helm-chart/control/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ frontDoorUrl:
apiserver: apiserver.flame.test
notifier: notifier.flame.test
mlflow: mlflow.flame.test
dashboard: dashboard.flame.test

mlflow:
s3EndpointUrl: http://minio.flame.test
Expand All @@ -131,6 +132,7 @@ servicePort:
agent: "10103"
metaserver: "10104"
mqtt: "1883"
dashboard: "3000"

replicas: 1

Expand Down

0 comments on commit 6acb55c

Please sign in to comment.