Skip to content

Commit bb541b8

Browse files
committed
added versioning integration test
1 parent 1768854 commit bb541b8

18 files changed

+417
-0
lines changed
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-airflow-postgresql
6+
timeout: 480
7+
---
8+
apiVersion: apps/v1
9+
kind: StatefulSet
10+
metadata:
11+
name: airflow-postgresql
12+
status:
13+
readyReplicas: 1
14+
replicas: 1
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
- script: >-
6+
helm install airflow-postgresql
7+
--namespace $NAMESPACE
8+
--version 16.4.2
9+
-f helm-bitnami-postgresql-values.yaml
10+
oci://registry-1.docker.io/bitnamicharts/postgresql
11+
timeout: 600
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
5+
---
6+
apiVersion: v1
7+
kind: ConfigMap
8+
metadata:
9+
name: vector-aggregator-discovery
10+
{% endif %}
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: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: airflow-spark-clusterrole
6+
rules:
7+
- apiGroups:
8+
- spark.stackable.tech
9+
resources:
10+
- sparkapplications
11+
verbs:
12+
- create
13+
- get
14+
- list
15+
---
16+
apiVersion: rbac.authorization.k8s.io/v1
17+
kind: ClusterRoleBinding
18+
metadata:
19+
name: airflow-spark-clusterrole-binding
20+
roleRef:
21+
apiGroup: rbac.authorization.k8s.io
22+
kind: ClusterRole
23+
name: airflow-spark-clusterrole
24+
subjects:
25+
- apiGroup: rbac.authorization.k8s.io
26+
kind: Group
27+
name: system:serviceaccounts
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
metadata:
5+
name: test-airflow-cluster
6+
timeout: 1200
7+
---
8+
apiVersion: apps/v1
9+
kind: StatefulSet
10+
metadata:
11+
name: airflow-webserver-default
12+
status:
13+
readyReplicas: 1
14+
replicas: 1
15+
---
16+
apiVersion: apps/v1
17+
kind: StatefulSet
18+
metadata:
19+
name: airflow-scheduler-default
20+
status:
21+
readyReplicas: 1
22+
replicas: 1
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
metadata:
4+
name: install-airflow
5+
timeout: 480
6+
---
7+
apiVersion: v1
8+
kind: Secret
9+
metadata:
10+
name: git-credentials
11+
type: Opaque
12+
data:
13+
# This is a fine-grained access token for the owner of the repo (stackable-airflow/dags) which has read only access
14+
# to *only* this repo. Contact github users @razvan or @adwk67 for details.
15+
# This token doesn't expire.
16+
user: c3RhY2thYmxlLWFpcmZsb3c=
17+
password: Z2l0aHViX3BhdF8xMUJLUURCRVkwSk1EWlNVQk1RYTdoX0c2OGlhbWtpRkpFV1RMTTF0ajFwbHFTVFNyZ3p3dHZneXI5b2tubGRXaGpVRDZITFRFV0JJcm9yT0dXCg==
18+
---
19+
apiVersion: v1
20+
kind: Secret
21+
metadata:
22+
name: test-airflow-credentials
23+
type: Opaque
24+
stringData:
25+
adminUser.username: airflow
26+
adminUser.firstname: Airflow
27+
adminUser.lastname: Admin
28+
adminUser.email: [email protected]
29+
adminUser.password: airflow
30+
connections.sqlalchemyDatabaseUri: postgresql+psycopg2://airflow:airflow@airflow-postgresql/airflow
31+
---
32+
apiVersion: airflow.stackable.tech/v1alpha1
33+
kind: AirflowCluster
34+
metadata:
35+
name: airflow
36+
spec:
37+
image:
38+
{% if test_scenario['values']['airflow-latest'].find(",") > 0 %}
39+
custom: "{{ test_scenario['values']['airflow-latest'].split(',')[1] }}"
40+
productVersion: "{{ test_scenario['values']['airflow-latest'].split(',')[0] }}"
41+
{% else %}
42+
productVersion: "{{ test_scenario['values']['airflow-latest'] }}"
43+
{% endif %}
44+
pullPolicy: IfNotPresent
45+
clusterConfig:
46+
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
47+
vectorAggregatorConfigMapName: vector-aggregator-discovery
48+
{% endif %}
49+
credentialsSecret: test-airflow-credentials
50+
dagsGitSync:
51+
- repo: https://github.com/stackable-airflow/dags
52+
# v1alpha1 field which should be converted to an enum
53+
# N.B. only works for the existing v1 field
54+
credentialsSecret: git-credentials
55+
gitFolder: "mount-dags-gitsync/dags_airflow3"
56+
webservers:
57+
roleConfig:
58+
listenerClass: external-unstable
59+
config:
60+
logging:
61+
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
62+
roleGroups:
63+
default:
64+
envOverrides: &envOverrides
65+
AIRFLOW_CONN_KUBERNETES_IN_CLUSTER: '{"conn_type": "kubernetes", "extra": {"extra__kubernetes__in_cluster": true}}'
66+
replicas: 1
67+
kubernetesExecutors:
68+
envOverrides: *envOverrides
69+
config:
70+
logging:
71+
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
72+
schedulers:
73+
config:
74+
gracefulShutdownTimeout: 10s
75+
logging:
76+
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
77+
roleGroups:
78+
default:
79+
envOverrides: *envOverrides
80+
replicas: 1
81+
dagProcessors:
82+
config:
83+
gracefulShutdownTimeout: 10s
84+
logging:
85+
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
86+
roleGroups:
87+
default:
88+
envOverrides: *envOverrides
89+
replicas: 1
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-airflow-python
6+
timeout: 240
7+
---
8+
apiVersion: apps/v1
9+
kind: StatefulSet
10+
metadata:
11+
name: test-airflow-python
12+
status:
13+
readyReplicas: 1
14+
replicas: 1
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: StatefulSet
4+
metadata:
5+
name: test-airflow-python
6+
labels:
7+
app: test-airflow-python
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: test-airflow-python
13+
template:
14+
metadata:
15+
labels:
16+
app: test-airflow-python
17+
spec:
18+
containers:
19+
- name: test-airflow-python
20+
image: oci.stackable.tech/sdp/testing-tools:0.2.0-stackable0.0.0-dev
21+
imagePullPolicy: IfNotPresent
22+
stdin: true
23+
tty: true

0 commit comments

Comments
 (0)