-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add override integration tests (#615)
* add recapturing to immutable, fix broken link * add integration test for overrides with pod overrides * move security.properties evaluation and bump stackable-operator version * fix formatting * remove recapturing for now * rename test step files * test for env overrides * test config overrides * fix yaml lint --------- Co-authored-by: Razvan-Daniel Mihai <[email protected]>
- Loading branch information
Showing
16 changed files
with
545 additions
and
197 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: druid-zk-server-default | ||
status: | ||
availableReplicas: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
apiVersion: zookeeper.stackable.tech/v1alpha1 | ||
kind: ZookeeperCluster | ||
metadata: | ||
name: druid-zk | ||
spec: | ||
image: | ||
productVersion: "{{ test_scenario['values']['zookeeper-latest'] }}" | ||
servers: | ||
roleGroups: | ||
default: | ||
replicas: 1 | ||
--- | ||
apiVersion: zookeeper.stackable.tech/v1alpha1 | ||
kind: ZookeeperZnode | ||
metadata: | ||
name: druid-znode | ||
spec: | ||
clusterRef: | ||
name: druid-zk | ||
--- | ||
apiVersion: zookeeper.stackable.tech/v1alpha1 | ||
kind: ZookeeperZnode | ||
metadata: | ||
name: hdfs-znode | ||
spec: | ||
clusterRef: | ||
name: druid-zk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% if test_scenario['values']['openshift'] == 'true' %} | ||
# see https://github.com/stackabletech/issues/issues/566 | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: kubectl patch namespace $NAMESPACE -p '{"metadata":{"labels":{"pod-security.kubernetes.io/enforce":"privileged"}}}' | ||
timeout: 120 | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: hdfs-namenode-default | ||
status: | ||
availableReplicas: 2 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: hdfs-datanode-default | ||
status: | ||
availableReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: hdfs-journalnode-default | ||
status: | ||
availableReplicas: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
apiVersion: hdfs.stackable.tech/v1alpha1 | ||
kind: HdfsCluster | ||
metadata: | ||
name: hdfs | ||
spec: | ||
image: | ||
productVersion: "{{ test_scenario['values']['hadoop-latest'] }}" | ||
clusterConfig: | ||
dfsReplication: 1 | ||
zookeeperConfigMapName: hdfs-znode | ||
nameNodes: | ||
roleGroups: | ||
default: | ||
replicas: 2 | ||
dataNodes: | ||
roleGroups: | ||
default: | ||
replicas: 1 | ||
journalNodes: | ||
roleGroups: | ||
default: | ||
replicas: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: druid-broker-default | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
level: role | ||
status: | ||
readyReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: druid-coordinator-default | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
level: role-group | ||
status: | ||
readyReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: druid-historical-default | ||
status: | ||
readyReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: druid-middlemanager-default | ||
status: | ||
readyReplicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: druid-router-default | ||
status: | ||
readyReplicas: 1 |
123 changes: 123 additions & 0 deletions
123
tests/templates/kuttl/overrides/20-install-druid.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
--- | ||
apiVersion: druid.stackable.tech/v1alpha1 | ||
kind: DruidCluster | ||
metadata: | ||
name: druid | ||
spec: | ||
image: | ||
productVersion: "{{ test_scenario['values']['druid-latest'] }}" | ||
clusterConfig: | ||
deepStorage: | ||
hdfs: | ||
configMapName: hdfs | ||
directory: /data | ||
metadataStorageDatabase: | ||
dbType: derby | ||
connString: jdbc:derby://localhost:1527/var/druid/metadata.db;create=true | ||
host: localhost | ||
port: 1527 | ||
tls: null | ||
zookeeperConfigMapName: druid-znode | ||
brokers: | ||
envOverrides: | ||
ROLE_VAR: role-value | ||
COMMON_VAR: role-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: role-value | ||
prop.role: role-value | ||
podOverrides: | ||
metadata: | ||
labels: | ||
level: role | ||
roleGroups: | ||
default: | ||
replicas: 1 | ||
envOverrides: | ||
GROUP_VAR: group-value | ||
COMMON_VAR: group-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: group-value | ||
prop.group: group-value | ||
coordinators: | ||
envOverrides: | ||
ROLE_VAR: role-value | ||
COMMON_VAR: role-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: role-value | ||
prop.role: role-value | ||
podOverrides: | ||
metadata: | ||
labels: | ||
level: role | ||
roleGroups: | ||
default: | ||
replicas: 1 | ||
podOverrides: | ||
metadata: | ||
labels: | ||
level: role-group | ||
envOverrides: | ||
GROUP_VAR: group-value | ||
COMMON_VAR: group-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: group-value | ||
prop.group: group-value | ||
|
||
historicals: | ||
envOverrides: | ||
ROLE_VAR: role-value | ||
COMMON_VAR: role-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: role-value | ||
prop.role: role-value | ||
roleGroups: | ||
default: | ||
replicas: 1 | ||
envOverrides: | ||
GROUP_VAR: group-value | ||
COMMON_VAR: group-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: group-value | ||
prop.group: group-value | ||
middleManagers: | ||
envOverrides: | ||
ROLE_VAR: role-value | ||
COMMON_VAR: role-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: role-value | ||
prop.role: role-value | ||
roleGroups: | ||
default: | ||
replicas: 1 | ||
envOverrides: | ||
GROUP_VAR: group-value | ||
COMMON_VAR: group-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: group-value | ||
prop.group: group-value | ||
routers: | ||
envOverrides: | ||
ROLE_VAR: role-value | ||
COMMON_VAR: role-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: role-value | ||
prop.role: role-value | ||
roleGroups: | ||
default: | ||
replicas: 1 | ||
envOverrides: | ||
GROUP_VAR: group-value | ||
COMMON_VAR: group-value | ||
configOverrides: | ||
runtime.properties: | ||
prop.common: group-value | ||
prop.group: group-value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 600 | ||
commands: | ||
# | ||
# Test envOverrides | ||
# | ||
- script: | | ||
kubectl -n $NAMESPACE get sts druid-broker-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "COMMON_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-broker-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "GROUP_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-broker-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "ROLE_VAR" and .value == "role-value")' | ||
- script: | | ||
kubectl -n $NAMESPACE get sts druid-coordinator-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "COMMON_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-coordinator-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "GROUP_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-coordinator-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "ROLE_VAR" and .value == "role-value")' | ||
- script: | | ||
kubectl -n $NAMESPACE get sts druid-historical-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "COMMON_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-historical-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "GROUP_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-historical-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "ROLE_VAR" and .value == "role-value")' | ||
- script: | | ||
kubectl -n $NAMESPACE get sts druid-middlemanager-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "COMMON_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-middlemanager-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "GROUP_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-middlemanager-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "ROLE_VAR" and .value == "role-value")' | ||
- script: | | ||
kubectl -n $NAMESPACE get sts druid-router-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "COMMON_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-router-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "GROUP_VAR" and .value == "group-value")' | ||
kubectl -n $NAMESPACE get sts druid-router-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "druid") | .env[] | select (.name == "ROLE_VAR" and .value == "role-value")' |
Oops, something went wrong.