-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsuperset.yaml
282 lines (253 loc) · 11.3 KB
/
superset.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
blocks:
- name: deploy_superset_ingress_blk
content:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: superset-ingress
namespace: superset
annotations:
cert-manager.io/cluster-issuer: cluster-issuer
kubernetes.io/tls-acme: "true"
external-dns.alpha.kubernetes.io/hostname: "{{ $cndi.get_prompt_response(superset_hostname) }}"
spec:
ingressClassName: public
tls:
- hosts:
- "{{ $cndi.get_prompt_response(superset_hostname) }}"
secretName: cluster-issuer-private-key-superset
rules:
- host: "{{ $cndi.get_prompt_response(superset_hostname) }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: superset
port:
number: 8088
prompts:
- $cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/common/cluster/core-prompts.yaml):
{}
- $cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/{{ $cndi.get_prompt_response(deployment_target_provider) }}/core-prompts.yaml):
{}
- name: deploy_argocd_ingress
default: true
message: >-
Do you want to expose ArgoCD to the web?
type: Confirm
- name: argocd_hostname
default: argocd.example.com
message: "What hostname should ArgoCD be accessible at?"
type: Input
validators:
- hostname # FQDN
condition:
- "{{ $cndi.get_prompt_response(deploy_argocd_ingress) }}"
- ==
- true
- name: deploy_superset_ingress
default: true
message: >-
Do you want to expose the Superset UI to the web?
type: Confirm
- name: superset_hostname
default: superset.example.com
message: What hostname should Superset UI be accessible at?
type: Input
validators:
- hostname # FQDN
- min_length: 3
condition:
- "{{ $cndi.get_prompt_response(deploy_superset_ingress) }}"
- ==
- true
outputs:
cndi_config:
cndi_version: v2
project_name: "{{ $cndi.get_prompt_response(project_name) }}"
provider: "{{ $cndi.get_prompt_response(deployment_target_provider) }}"
distribution: "{{ $cndi.get_prompt_response(deployment_target_distribution) }}"
infrastructure:
cndi:
$cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/common/cluster/observability-config.yaml):
condition:
- "{{ $cndi.get_prompt_response(deploy_grafana_ingress) }}"
- ==
- true
$cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/common/cluster/argocd-config.yaml):
condition:
- "{{ $cndi.get_prompt_response(deploy_argocd_ingress) }}"
- ==
- true
cert_manager:
email: "{{ $cndi.get_prompt_response(cert_manager_email) }}"
external_dns:
$cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/external-dns/config/{{ $cndi.get_prompt_response(dns_provider) }}.yaml):
condition:
- "{{ $cndi.get_prompt_response(enable_external_dns) }}"
- ==
- true
nodes:
$cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/{{ $cndi.get_prompt_response(deployment_target_provider) }}/basic-node-pool.yaml):
{}
open_ports:
- name: superset
namespace: superset
service: superset
number: 8088
cluster_manifests:
superset-namespace:
apiVersion: v1
kind: Namespace
metadata:
name: superset
superset-ingress:
$cndi.get_block(deploy_superset_ingress_blk):
condition:
- "{{ $cndi.get_prompt_response(deploy_superset_ingress) }}"
- ==
- true
superset-cnpg-cluster:
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: superset-cnpg-cluster
namespace: superset
annotations:
$cndi.comment(why_propagation_policy): PrunePropagationPolicy=background should prevent PDBs from blocking cluster destruction
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true,PrunePropagationPolicy=background
spec:
imageName: "ghcr.io/cloudnative-pg/postgresql:16"
instances: 3
storage:
size: 1Gi
replicationSlots:
highAvailability:
enabled: true
postgresql:
pg_hba:
- host superset-db superset all password
bootstrap:
initdb:
database: superset-db
owner: superset
secret:
name: superset-cnpg-database-user-auth-secret
superuserSecret:
name: superset-cnpg-cluster-superuser-auth-secret
superset-cnpg-cluster-superuser-auth-secret:
apiVersion: v1
kind: Secret
metadata:
name: superset-cnpg-cluster-superuser-auth-secret
namespace: superset
type: kubernetes.io/basic-auth
stringData:
username: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_POSTGRESQL_CLUSTER_SUPERUSER)
password: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_POSTGRESQL_CLUSTER_SUPERUSER_PASSWORD)
superset-cnpg-database-user-auth-secret:
apiVersion: v1
kind: Secret
metadata:
name: superset-cnpg-database-user-auth-secret
namespace: superset
type: kubernetes.io/basic-auth
stringData:
username: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_POSTGRESQL_USER)
password: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_POSTGRESQL_USER_PASSWORD)
superset-env-secret:
apiVersion: v1
kind: Secret
metadata:
name: superset-env
namespace: superset
type: Opaque
stringData:
SUPERSET_SECRET_KEY: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_SECRET_KEY)
REDIS_USER: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_REDIS_USER)
REDIS_HOST: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_REDIS_HOST)
REDIS_DB: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_REDIS_DB)
REDIS_PORT: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_REDIS_PORT)
REDIS_CELERY_DB: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_REDIS_CELERY_DB)
REDIS_PROTO: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_REDIS_PROTO)
DB_HOST: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_POSTGRESQL_HOST)
DB_PORT: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_POSTGRESQL_PORT)
DB_USER: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_POSTGRESQL_USER)
DB_PASS: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_POSTGRESQL_USER_PASSWORD)
DB_NAME: $cndi_on_ow.seal_secret_from_env_var(SUPERSET_POSTGRESQL_DB)
external-dns-secret:
$cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/external-dns/secret/{{ $cndi.get_prompt_response(dns_provider) }}.yaml):
condition:
- "{{ $cndi.get_prompt_response(enable_external_dns) }}"
- ==
- true
applications:
cnpg:
targetRevision: 0.18.0
destinationNamespace: cnpg-system
repoURL: "https://cloudnative-pg.github.io/charts"
chart: cloudnative-pg
superset:
repoURL: https://apache.github.io/superset
targetRevision: 0.12.11
chart: superset
destinationNamespace: superset
values:
secretEnv:
create: false
redis:
master:
persistence:
enabled: true
postgresql:
enabled: false
env:
$cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/common/git-credentials-{{ $cndi.get_prompt_response(git_credentials_mode) }}-env.yaml):
{}
$cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/{{ $cndi.get_prompt_response(deployment_target_provider) }}/env.yaml):
{}
$cndi.get_block(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/common/cluster/env.yaml):
{}
$cndi.comment(superset-heading): Superset Redis Connection Parameters
SUPERSET_SECRET_KEY: "{{ $cndi.get_random_string(24) }}"
SUPERSET_REDIS_USER: redis
SUPERSET_REDIS_DB: redis-db
SUPERSET_REDIS_HOST: superset-redis-headless
SUPERSET_REDIS_PORT: 6379
SUPERSET_REDIS_CELERY_DB: 0
SUPERSET_REDIS_PROTO: redis
$cndi.comment(postgres-heading): Superset PostgreSQL Connection Parameters
SUPERSET_POSTGRESQL_HOST: "superset-cnpg-cluster-rw"
SUPERSET_POSTGRESQL_PORT: "5432"
SUPERSET_POSTGRESQL_CLUSTER_SUPERUSER: postgres
SUPERSET_POSTGRESQL_CLUSTER_SUPERUSER_PASSWORD: "{{ $cndi.get_random_string(24) }}"
SUPERSET_POSTGRESQL_DB: superset-db
SUPERSET_POSTGRESQL_USER: superset
SUPERSET_POSTGRESQL_USER_PASSWORD: "{{ $cndi.get_random_string(16) }}"
readme:
project_name: "# {{ $cndi.get_prompt_response(project_name) }}"
$cndi.get_string(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/common/cluster/core-readme.md):
{}
$cndi.get_string(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/{{ $cndi.get_prompt_response(deployment_target_provider) }}/core.md):
{}
$cndi.get_string(https://raw.githubusercontent.com/polyseam/cndi/main/blocks/{{ $cndi.get_prompt_response(deployment_target_provider) }}/{{ $cndi.get_prompt_response(deployment_target_distribution) }}.md):
{}
superset: |
# Apache Superset Deployment Guide
This Template deploys a standalone production-ready [Apache Superset](https://superset.apache.org) application on a Kubernetes cluster using Helm.
Apache Superset is an open-source data exploration and visualization platform designed to be intuitive and easy to use.
It supports connection to a wide variety of databases and data warehouses, allowing you to visualize your data through rich, interactive dashboards.
## Customizing Your Deployment
Customize your Superset deployment by modifying the values.yaml file. Key configuration options include:
- **Persistence:** Enable and configure persistent storage for Superset metadata.
- **Database:** Configure external database connections for better performance and scalability.
- **Resources:** Set CPU and memory limits and requests for the Superset pods.
- **Ingress:** Customize Ingress settings for external access.
For a full list of configurable values, consult the Helm chart's documentation or the [values.yaml](https://github.com/apache/superset/tree/master/helm/superset/values.yaml) file in the chart source.
## Verifying Superset Accessibility
After deploying your Superset instance and configuring external access (either via port forwarding, Ingress, or ExternalDNS), it's crucial to ensure that Superset is properly accessible through your chosen domain.
**Access the Web Interface**:
- Open a web browser and navigate to the domain you've configured for Superset, e.g., `http://superset.yourdomain.com`.
- You should be greeted with Superset's login screen.