Skip to content

Commit

Permalink
Move deployment artifacts for Superset
Browse files Browse the repository at this point in the history
Previously our superset deployment pulled from the kustomize artifacts
in the upstream odh-contrib-manifests repo. To simplify the deployment
of superset, this pulls all of the artifacts into this repo.
  • Loading branch information
accorvin committed Oct 3, 2023
1 parent e943202 commit 35eb57d
Show file tree
Hide file tree
Showing 43 changed files with 609 additions and 75 deletions.
23 changes: 0 additions & 23 deletions kfdefs/base/superset/kfdef.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions kfdefs/base/superset/kustomization.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions kfdefs/base/superset/superset-deployment.yaml

This file was deleted.

1 change: 0 additions & 1 deletion kfdefs/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ kind: Kustomization

resources:
- dh-dev-trino
- dh-dev-superset
1 change: 0 additions & 1 deletion kfdefs/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ kind: Kustomization

resources:
- dh-prod-trino
- dh-prod-superset
1 change: 0 additions & 1 deletion kfdefs/overlays/stage/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ kind: Kustomization

resources:
- dh-stage-trino
- dh-stage-superset
98 changes: 98 additions & 0 deletions superset/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: superset
labels:
app: superset
spec:
replicas: 1
selector:
matchLabels:
deployment: superset
template:
metadata:
labels:
app: superset
deployment: superset
spec:
initContainers:
- name: superset-init
env:
- name: SUPERSET_CONFIG_PATH
value: /etc/superset/superset_config.py
- name: POSTGRESQL_USERNAME
valueFrom:
secretKeyRef:
key: database-user
name: $(superset_db_secret)
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
key: database-password
name: $(superset_db_secret)
- name: POSTGRESQL_DATABASE
valueFrom:
secretKeyRef:
key: database-name
name: $(superset_db_secret)
envFrom:
- secretRef:
name: $(superset_secret)
image: superset
command: ['sh', '-c', "sleep 30; superset-init --username $SUPERSET_ADMIN_USER --firstname $SUPERSET_ADMIN_FNAME --lastname $SUPERSET_ADMIN_LNAME --email $SUPERSET_ADMIN_EMAIL --password $SUPERSET_ADMIN_PASSWORD"]
volumeMounts:
- mountPath: /etc/superset
name: superset-config
containers:
- name: superset
env:
- name: SUPERSET_ADDITIONAL_CONFIG
value: /etc/superset/superset_additional_config.py
- name: SUPERSET_SECRET_KEY
valueFrom:
secretKeyRef:
key: SUPERSET_SECRET_KEY
name: $(superset_secret)
- name: POSTGRESQL_USERNAME
valueFrom:
secretKeyRef:
key: database-user
name: $(superset_db_secret)
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
key: database-password
name: $(superset_db_secret)
- name: POSTGRESQL_DATABASE
valueFrom:
secretKeyRef:
key: database-name
name: $(superset_db_secret)
- name: SUPERSET_CONFIG_PATH
value: /etc/superset/superset_config.py
image: superset
ports:
- containerPort: 8088
protocol: TCP
volumeMounts:
- mountPath: "/etc/certs"
name: trino-route-certificate-secret
readOnly: true
- mountPath: /etc/superset
name: superset-config
resources:
requests:
cpu: $(superset_cpu_requests)
memory: $(superset_memory_requests)
limits:
cpu: $(superset_cpu_limits)
memory: $(superset_memory_limits)
serviceAccountName: superset
volumes:
- name: superset-config
configMap:
name: superset-config-py
defaultMode: 420
- name: trino-route-certificate-secret
secret:
secretName: trino-route-certificate-secret
125 changes: 125 additions & 0 deletions superset/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- secret-superset.yaml
- deployment.yaml
- service.yaml
- route.yaml
- supersetdb-deployment.yaml
- supersetdb-pvc.yaml
- supersetdb-secret.yaml
- supersetdb-service.yaml
- superset-rbac-viewer-role.yaml
- superset-rbac-viewer-rolebinding.yaml
- superset-service-account.yaml

commonLabels:
opendatahub.io/component: "true"
component.opendatahub.io/name: superset
app: superset
app.kubernetes.io/part-of: superset

generators:
- ./secret-generator.yaml

configMapGenerator:
- name: superset-config
envs:
- params.env
- name: superset-config-py
files:
- superset_config.py
- superset_additional_config.py

vars:
- name: superset_secret
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_secret
- name: superset_db_secret
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_db_secret
- name: superset_memory_requests
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_memory_requests
- name: superset_memory_limits
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_memory_limits
- name: superset_cpu_requests
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_cpu_requests
- name: superset_cpu_limits
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_cpu_limits
- name: superset_db_memory_requests
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_db_memory_requests
- name: superset_db_memory_limits
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_db_memory_limits
- name: superset_db_cpu_requests
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_db_cpu_requests
- name: superset_db_cpu_limits
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.superset_db_cpu_limits
- name: storage_class
objref:
name: superset-config
kind: ConfigMap
apiVersion: v1
fieldref:
fieldpath: data.storage_class

configurations:
- params.yaml

generatorOptions:
disableNameSuffixHash: true

images:
- name: superset
newName: quay.io/opendatahub/superset
newTag: "1.5.2-ubi"
- name: supersetdb
newName: quay.io/internaldatahub/postgresql-96-centos7
newTag: "9.6"
11 changes: 11 additions & 0 deletions superset/base/params.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
storage_class=default
superset_secret=superset
superset_db_secret=supersetdb
superset_memory_requests=1Gi
superset_memory_limits=2Gi
superset_cpu_requests=300m
superset_cpu_limits=2
superset_db_memory_requests=300Mi
superset_db_memory_limits=1Gi
superset_db_cpu_requests=300m
superset_db_cpu_limits=1
24 changes: 24 additions & 0 deletions superset/base/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
varReference:
- path: data
kind: ConfigMap
- path: stringData
kind: Secret
- path: metadata/annotations/volume.beta.kubernetes.io\/storage-class
kind: PersistentVolumeClaim
- path: spec/template/spec/containers[]/resources/requests/cpu
kind: Deployment
- path: spec/template/spec/containers[]/resources/limits/cpu
kind: Deployment
- path: spec/template/spec/containers[]/resources/requests/memory
kind: Deployment
- path: spec/template/spec/containers[]/resources/limits/memory
kind: Deployment
- path: spec/template/spec/containers[]/envFrom/secretRef/name
kind: Deployment
- path: spec/template/spec/initContainers[]/envFrom/secretRef/name
kind: Deployment
- path: spec/template/spec/containers[]/env[]/valueFrom/secretKeyRef/name
kind: Deployment
- path: spec/template/spec/initContainers[]/env[]/valueFrom/secretKeyRef/name
kind: Deployment
15 changes: 15 additions & 0 deletions superset/base/route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: superset
labels:
app: superset
spec:
port:
targetPort: 8088-tcp
to:
kind: Service
name: superset
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
File renamed without changes.
13 changes: 13 additions & 0 deletions superset/base/secret-superset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: superset
labels:
app: superset
stringData:
SUPERSET_ADMIN_USER: admin
SUPERSET_ADMIN_FNAME: admin
SUPERSET_ADMIN_LNAME: admin
SUPERSET_ADMIN_EMAIL: [email protected]
SUPERSET_ADMIN_PASSWORD: admin
SUPERSET_SECRET_KEY: thisISaSECRET_1234
7 changes: 7 additions & 0 deletions superset/base/service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: superset
labels:
app: superset
service: superset
Loading

0 comments on commit 35eb57d

Please sign in to comment.