Skip to content

Commit

Permalink
moved redoc container from core to sandbox helm chart (#2258)
Browse files Browse the repository at this point in the history
* moved redoc container from core to sandbox helm chart

Signed-off-by: Yuvraj <[email protected]>

* more changes

Signed-off-by: Yuvraj <[email protected]>

* fix ingress

Signed-off-by: Yuvraj <[email protected]>

* make helm

Signed-off-by: Yuvraj <[email protected]>
  • Loading branch information
yindia authored Mar 25, 2022
1 parent 43c5f22 commit c22b55e
Show file tree
Hide file tree
Showing 19 changed files with 234 additions and 187 deletions.
2 changes: 1 addition & 1 deletion charts/flyte-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ helm install gateway bitnami/contour -n flyte
| db.datacatalog.database.host | string | `"postgres"` | |
| db.datacatalog.database.port | int | `5432` | |
| db.datacatalog.database.username | string | `"postgres"` | |
| deployRedoc | bool | `false` | |
| external_events | object | `{"aws":{"region":"us-east-2"},"enable":false,"eventsPublisher":{"eventTypes":["all"],"topicName":"arn:aws:sns:us-east-2:123456:123-my-topic"},"type":"aws"}` | **Optional Component** External events are used to send events (unprocessed, as Admin see them) to an SNS topic (or gcp equivalent) The config is here as an example only - if not enabled, it won't be used. |
| flyteadmin.additionalVolumeMounts | list | `[]` | |
| flyteadmin.additionalVolumes | list | `[]` | |
| flyteadmin.affinity | object | `{}` | affinity for Flyteadmin deployment |
| flyteadmin.configPath | string | `"/etc/flyte/config/*.yaml"` | Default regex string for searching configuration files |
| flyteadmin.deployRedoc | bool | `true` | Deploys a Redoc container in Flyteadmin's pod |
| flyteadmin.enabled | bool | `true` | |
| flyteadmin.env | list | `[]` | Additional flyteadmin container environment variables e.g. SendGrid's API key - name: SENDGRID_API_KEY value: "<your sendgrid api key>" e.g. secret environment variable (you can combine it with .additionalVolumes): - name: SENDGRID_API_KEY valueFrom: secretKeyRef: name: sendgrid-secret key: api_key |
| flyteadmin.extraArgs | object | `{}` | Appends extra command line arguments to the serve command |
Expand Down
22 changes: 0 additions & 22 deletions charts/flyte-core/templates/admin/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,28 +122,6 @@ spec:
{{- with .Values.flyteadmin.additionalVolumeMounts -}}
{{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- if .Values.flyteadmin.deployRedoc }}
- command:
- sh
- -c
- ln -s /usr/share/nginx/html /usr/share/nginx/html/openapi && sh /usr/local/bin/docker-run.sh
env:
- name: PAGE_TITLE
value: Flyte Admin OpenAPI
- name: SPEC_URL
value: /api/v1/openapi
- name: PORT
value: "8087"
image: docker.io/redocly/redoc
imagePullPolicy: IfNotPresent
name: redoc
ports:
- containerPort: 8087
resources:
limits:
cpu: "0.1"
memory: 200Mi
{{- end }}
serviceAccountName: {{ template "flyteadmin.name" . }}
volumes: {{- include "databaseSecret.volume" . | nindent 8 }}
- emptyDir: {}
Expand Down
32 changes: 17 additions & 15 deletions charts/flyte-core/templates/common/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,6 @@ spec:
servicePort: 80
{{- end }}
{{- end }}
# Port 87 in FlyteAdmin maps to the redoc container.
- path: /openapi
pathType: ImplementationSpecific
backend:
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
service:
name: flyteadmin
port:
number: 87
{{- else }}
serviceName: flyteadmin
servicePort: 87
{{- end }}
# NOTE: If you change this, you must update the BASE_URL value in flyteconsole.yaml
- path: /console
pathType: ImplementationSpecific
Expand Down Expand Up @@ -228,19 +215,34 @@ spec:
{{- else }}
serviceName: flyteadmin
servicePort: 80
{{- end }}
{{- if .Values.deployRedoc }}
# Port 87 in FlyteAdmin maps to the redoc container.
- path: /openapi
pathType: ImplementationSpecific
backend:
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
service:
name: redoc
port:
number: 87
{{- else }}
serviceName: redoc
servicePort: 87
{{- end }}
# Port 87 in FlyteAdmin maps to the redoc container.
- path: /openapi/*
pathType: ImplementationSpecific
backend:
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
service:
name: flyteadmin
name: redoc
port:
number: 87
{{- else }}
serviceName: flyteadmin
serviceName: redoc
servicePort: 87
{{- end }}
{{- end }}
- path: /.well-known
pathType: ImplementationSpecific
Expand Down
1 change: 0 additions & 1 deletion charts/flyte-core/values-eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ flyteadmin:
matchLabels:
app.kubernetes.io/name: flyteadmin
topologyKey: kubernetes.io/hostname
deployRedoc: false

#
# FLYTESCHEDULER
Expand Down
1 change: 0 additions & 1 deletion charts/flyte-core/values-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ userSettings:
#

flyteadmin:
deployRedoc: false
replicaCount: 1
serviceAccount:
# -- If the service account is created by you, make this false, else a new service account will be created and the flyteadmin role will be added
Expand Down
6 changes: 4 additions & 2 deletions charts/flyte-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ flyteadmin:
secrets: {}
additionalVolumes: []
additionalVolumeMounts: []
# -- Deploys a Redoc container in Flyteadmin's pod
deployRedoc: true
# -- Appends extra command line arguments to the serve command
extraArgs: {}
# -- Sets priorityClassName for flyteadmin pod(s).
Expand Down Expand Up @@ -273,6 +271,10 @@ flyteconsole:
# -- Sets priorityClassName for flyte console pod(s).
priorityClassName: ""


# It will enable the redoc route in ingress
deployRedoc: false

#
# Common secret auth for propeller & scheduler
#
Expand Down
16 changes: 14 additions & 2 deletions charts/flyte/README.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions charts/flyte/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,18 @@ app.kubernetes.io/instance: {{ .Release.Name }}
helm.sh/chart: {{ include "flyte.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{- define "redoc.name" -}}
redoc
{{- end -}}

{{- define "redoc.selectorLabels" -}}
app.kubernetes.io/name: {{ template "redoc.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

{{- define "redoc.labels" -}}
{{ include "redoc.selectorLabels" . }}
helm.sh/chart: {{ include "flyte.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
45 changes: 45 additions & 0 deletions charts/flyte/templates/redoc/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "redoc.name" . }}
namespace: {{ template "flyte.namespace" . }}
labels: {{ include "redoc.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.redoc.replicaCount }}
selector:
matchLabels: {{ include "redoc.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.redoc.podAnnotations }}
annotations: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
labels: {{ include "redoc.labels" . | nindent 8 }}
spec:
containers:
- image: "{{ .Values.redoc.image.repository }}:{{ .Values.redoc.image.tag }}"
imagePullPolicy: "{{ .Values.redoc.image.pullPolicy }}"
name: redoc
command:
- sh
- -c
- ln -s /usr/share/nginx/html /usr/share/nginx/html/openapi && sh /usr/local/bin/docker-run.sh
env:
- name: PAGE_TITLE
value: Flyte Admin OpenAPI
- name: SPEC_URL
value: /api/v1/openapi
- name: PORT
value: "8087"
ports:
- containerPort: 8087
resources: {{ toYaml .Values.redoc.resources | nindent 10 }}
{{- with .Values.minio.nodeSelector }}
nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.redoc.affinity }}
affinity: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.redoc.tolerations }}
tolerations: {{ tpl (toYaml .) $ | nindent 8 }}
{{- end }}

19 changes: 19 additions & 0 deletions charts/flyte/templates/redoc/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "redoc.name" . }}
namespace: {{ template "flyte.namespace" . }}
labels: {{ include "redoc.labels" . | nindent 4 }}
{{- with .Values.redoc.service.annotations }}
annotations: {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}
spec:
{{- with .Values.redoc.service.type}}
type: {{ . }}
{{- end }}
ports:
- name: redoc
protocol: TCP
port: 87
targetPort: 8087
selector: {{ include "redoc.selectorLabels" . | nindent 4 }}
40 changes: 38 additions & 2 deletions charts/flyte/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ flyte:
secrets: {}
additionalVolumes: []
additionalVolumeMounts: []
# -- Deploys a Redoc container in Flyteadmin's pod
deployRedoc: true

#
# FLYTESCHEDULER SETTINGS
Expand Down Expand Up @@ -274,6 +272,9 @@ flyte:
projectcontour.io/upstream-protocol.h2c: grpc
type: ClusterIP

# It will enable the re doc route in ingress
deployRedoc: true

# ------------------------------------------------
#
# COMMON SETTINGS
Expand Down Expand Up @@ -741,6 +742,41 @@ minio:
# -- affinity for Minio deployment
affinity: {}


redoc:
# --- enable or disable Minio deployment installation
enabled: true
# -- Replicas count for Minio deployment
replicaCount: 1
image:
# -- Docker image for Minio deployment
repository: docker.io/redocly/redoc
# -- Docker image tag
tag: latest
# -- Docker image pull policy
pullPolicy: IfNotPresent
# -- Default resources requests and limits for Minio deployment
resources:
# -- Requests are the minimum set of resources needed for this pod
requests:
cpu: 10m
memory: 128Mi
# -- Limits are the maximum set of resources needed for this pod
limits:
cpu: 200m
memory: 512Mi
# -- Service settings for Minio
service:
type: ClusterIP
# -- Annotations for Minio pods
podAnnotations: {}
# -- nodeSelector for Minio deployment
nodeSelector: {}
# -- tolerations for Minio deployment
tolerations: []
# -- affinity for Minio deployment
affinity: {}

#
# CONTOUR SETTINGS
#
Expand Down
16 changes: 0 additions & 16 deletions deployment/eks/flyte_aws_scheduler_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1371,14 +1371,6 @@ spec:
port:
name: use-annotation
# This is useful only for frontend development
# Port 87 in FlyteAdmin maps to the redoc container.
- path: /openapi
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
port:
number: 87
# NOTE: If you change this, you must update the BASE_URL value in flyteconsole.yaml
- path: /console
pathType: ImplementationSpecific
Expand Down Expand Up @@ -1422,14 +1414,6 @@ spec:
name: flyteadmin
port:
number: 80
# Port 87 in FlyteAdmin maps to the redoc container.
- path: /openapi/*
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
port:
number: 87
- path: /.well-known
pathType: ImplementationSpecific
backend:
Expand Down
16 changes: 0 additions & 16 deletions deployment/eks/flyte_helm_controlplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1006,14 +1006,6 @@ spec:
port:
name: use-annotation
# This is useful only for frontend development
# Port 87 in FlyteAdmin maps to the redoc container.
- path: /openapi
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
port:
number: 87
# NOTE: If you change this, you must update the BASE_URL value in flyteconsole.yaml
- path: /console
pathType: ImplementationSpecific
Expand Down Expand Up @@ -1057,14 +1049,6 @@ spec:
name: flyteadmin
port:
number: 80
# Port 87 in FlyteAdmin maps to the redoc container.
- path: /openapi/*
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
port:
number: 87
- path: /.well-known
pathType: ImplementationSpecific
backend:
Expand Down
16 changes: 0 additions & 16 deletions deployment/eks/flyte_helm_dataplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -534,14 +534,6 @@ spec:
port:
name: use-annotation
# This is useful only for frontend development
# Port 87 in FlyteAdmin maps to the redoc container.
- path: /openapi
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
port:
number: 87
# NOTE: If you change this, you must update the BASE_URL value in flyteconsole.yaml
- path: /console
pathType: ImplementationSpecific
Expand Down Expand Up @@ -585,14 +577,6 @@ spec:
name: flyteadmin
port:
number: 80
# Port 87 in FlyteAdmin maps to the redoc container.
- path: /openapi/*
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
port:
number: 87
- path: /.well-known
pathType: ImplementationSpecific
backend:
Expand Down
Loading

0 comments on commit c22b55e

Please sign in to comment.