Skip to content

Commit 534ea34

Browse files
committed
chore: upgrade tests for superset 6.1.0
1 parent 69c8fe5 commit 534ea34

36 files changed

Lines changed: 1181 additions & 6 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% if test_scenario['values']['openshift'] == 'true' %}
2+
# see https://github.com/stackabletech/issues/issues/566
3+
---
4+
apiVersion: kuttl.dev/v1beta1
5+
kind: TestStep
6+
commands:
7+
- script: kubectl patch namespace $NAMESPACE -p '{"metadata":{"labels":{"pod-security.kubernetes.io/enforce":"privileged"}}}'
8+
timeout: 120
9+
{% endif %}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
metadata:
5+
name: test-superset-postgresql
6+
timeout: 480
7+
---
8+
apiVersion: apps/v1
9+
kind: StatefulSet
10+
metadata:
11+
name: superset-postgresql
12+
status:
13+
readyReplicas: 1
14+
replicas: 1
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
- script: >-
6+
helm install superset-postgresql
7+
--namespace $NAMESPACE
8+
--version 12.5.6
9+
-f 10_helm-bitnami-postgresql-values.yaml
10+
--repo https://charts.bitnami.com/bitnami postgresql
11+
--wait
12+
timeout: 600
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
global:
3+
security:
4+
allowInsecureImages: true # needed starting with Chart version 16.3.0 if modifying images
5+
6+
image:
7+
repository: bitnamilegacy/postgresql
8+
9+
volumePermissions:
10+
enabled: false
11+
image:
12+
repository: bitnamilegacy/os-shell
13+
securityContext:
14+
runAsUser: auto
15+
16+
metrics:
17+
image:
18+
repository: bitnamilegacy/postgres-exporter
19+
20+
primary:
21+
podSecurityContext:
22+
{% if test_scenario['values']['openshift'] == 'true' %}
23+
enabled: false
24+
{% else %}
25+
enabled: true
26+
{% endif %}
27+
containerSecurityContext:
28+
enabled: false
29+
resources:
30+
requests:
31+
memory: "128Mi"
32+
cpu: "512m"
33+
limits:
34+
memory: "128Mi"
35+
cpu: "1"
36+
37+
shmVolume:
38+
chmod:
39+
enabled: false
40+
41+
auth:
42+
username: superset
43+
password: superset
44+
database: superset
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
2+
---
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: vector-aggregator-discovery
7+
data:
8+
ADDRESS: {{ lookup('env', 'VECTOR_AGGREGATOR') }}
9+
{% endif %}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
metadata:
5+
name: test-keycloak
6+
timeout: 480
7+
---
8+
apiVersion: apps/v1
9+
kind: Deployment
10+
metadata:
11+
name: keycloak1
12+
status:
13+
readyReplicas: 1
14+
replicas: 1
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
- script: |
6+
INSTANCE_NAME=keycloak1 \
7+
REALM=test1 \
8+
USERNAME=jane.doe \
9+
FIRST_NAME=Jane \
10+
LAST_NAME=Doe \
11+
EMAIL=jane.doe@stackable.tech \
12+
PASSWORD=T8mn72D9 \
13+
CLIENT_ID=superset1 \
14+
CLIENT_SECRET=R1bxHUD569vHeQdw \
15+
envsubst < 30_install-keycloak.yaml | kubectl apply -n $NAMESPACE -f -
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# The environment variables must be replaced.
2+
---
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: $INSTANCE_NAME-realms
7+
data:
8+
test-realm.json: |
9+
{
10+
"realm": "$REALM",
11+
"enabled": true,
12+
"users": [
13+
{
14+
"enabled": true,
15+
"username": "$USERNAME",
16+
"firstName" : "$FIRST_NAME",
17+
"lastName" : "$LAST_NAME",
18+
"email" : "$EMAIL",
19+
"credentials": [
20+
{
21+
"type": "password",
22+
"value": "$PASSWORD"
23+
}
24+
],
25+
"realmRoles": [
26+
"user"
27+
]
28+
}
29+
],
30+
"roles": {
31+
"realm": [
32+
{
33+
"name": "user",
34+
"description": "User privileges"
35+
}
36+
]
37+
},
38+
"clients": [
39+
{
40+
"clientId": "$CLIENT_ID",
41+
"enabled": true,
42+
"clientAuthenticatorType": "client-secret",
43+
"secret": "$CLIENT_SECRET",
44+
"redirectUris": [
45+
"*"
46+
],
47+
"webOrigins": [
48+
"*"
49+
],
50+
"standardFlowEnabled": true,
51+
"protocol": "openid-connect"
52+
}
53+
]
54+
}
55+
---
56+
apiVersion: apps/v1
57+
kind: Deployment
58+
metadata:
59+
name: $INSTANCE_NAME
60+
labels:
61+
app: $INSTANCE_NAME
62+
spec:
63+
replicas: 1
64+
selector:
65+
matchLabels:
66+
app: $INSTANCE_NAME
67+
template:
68+
metadata:
69+
labels:
70+
app: $INSTANCE_NAME
71+
spec:
72+
serviceAccountName: keycloak
73+
containers:
74+
- name: keycloak
75+
image: quay.io/keycloak/keycloak:23.0.4
76+
args:
77+
- start-dev
78+
- --import-realm
79+
- --https-certificate-file=/tls/tls.crt
80+
- --https-certificate-key-file=/tls/tls.key
81+
env:
82+
- name: KEYCLOAK_ADMIN
83+
value: admin
84+
- name: KEYCLOAK_ADMIN_PASSWORD
85+
value: admin
86+
ports:
87+
- name: https
88+
containerPort: 8443
89+
volumeMounts:
90+
- name: realms
91+
mountPath: /opt/keycloak/data/import
92+
- name: tls
93+
mountPath: /tls
94+
readinessProbe:
95+
httpGet:
96+
scheme: HTTPS
97+
path: /realms/$REALM
98+
port: 8443
99+
volumes:
100+
- name: realms
101+
configMap:
102+
name: $INSTANCE_NAME-realms
103+
- name: tls
104+
ephemeral:
105+
volumeClaimTemplate:
106+
metadata:
107+
annotations:
108+
secrets.stackable.tech/class: tls
109+
secrets.stackable.tech/scope: service=$INSTANCE_NAME
110+
spec:
111+
storageClassName: secrets.stackable.tech
112+
accessModes:
113+
- ReadWriteOnce
114+
resources:
115+
requests:
116+
storage: "1"
117+
---
118+
apiVersion: v1
119+
kind: Service
120+
metadata:
121+
name: $INSTANCE_NAME
122+
spec:
123+
selector:
124+
app: $INSTANCE_NAME
125+
ports:
126+
- protocol: TCP
127+
port: 8443
128+
---
129+
apiVersion: authentication.stackable.tech/v1alpha1
130+
kind: AuthenticationClass
131+
metadata:
132+
name: $INSTANCE_NAME-$NAMESPACE
133+
spec:
134+
provider:
135+
oidc:
136+
hostname: $INSTANCE_NAME.$NAMESPACE.svc.cluster.local
137+
port: 8443
138+
rootPath: /realms/$REALM/
139+
scopes:
140+
- email
141+
- openid
142+
- profile
143+
principalClaim: preferred_username
144+
providerHint: Keycloak
145+
tls:
146+
verification:
147+
server:
148+
caCert:
149+
secretClass: tls
150+
---
151+
apiVersion: v1
152+
kind: ServiceAccount
153+
metadata:
154+
name: keycloak
155+
---
156+
kind: Role
157+
apiVersion: rbac.authorization.k8s.io/v1
158+
metadata:
159+
name: keycloak
160+
{% if test_scenario['values']['openshift'] == 'true' %}
161+
rules:
162+
- apiGroups: ["security.openshift.io"]
163+
resources: ["securitycontextconstraints"]
164+
resourceNames: ["privileged"]
165+
verbs: ["use"]
166+
{% endif %}
167+
---
168+
kind: RoleBinding
169+
apiVersion: rbac.authorization.k8s.io/v1
170+
metadata:
171+
name: keycloak
172+
subjects:
173+
- kind: ServiceAccount
174+
name: keycloak
175+
roleRef:
176+
kind: Role
177+
name: keycloak
178+
apiGroup: rbac.authorization.k8s.io
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
metadata:
5+
name: install-superset
6+
timeout: 600
7+
commands:
8+
- script: kubectl -n $NAMESPACE wait --for=condition=available=true supersetclusters.superset.stackable.tech/superset --timeout 601s
9+
---
10+
apiVersion: apps/v1
11+
kind: StatefulSet
12+
metadata:
13+
name: superset-node-default
14+
status:
15+
readyReplicas: 1
16+
replicas: 1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
timeout: 300
5+
commands:
6+
- script: >
7+
envsubst '$NAMESPACE' < 40_install-superset.yaml |
8+
kubectl apply -n $NAMESPACE -f -

0 commit comments

Comments
 (0)