Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working setup of flink via kuttl #285

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions repository/flink/docs/demo/tests/flink-demo/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Pod
metadata:
name: kudo-controller-manager-0
namespace: kudo-system
status:
phase: Running

# confirms that kudo is running
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary to check this here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fail fast and portability
frankly if kudo is running this is a quick sub second check... what are the concerns?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not a pattern we should promote: this is something that is covered beforeAll tests (by using kudo init --wait) option. I guess you could see it as very defensive programming but frankly, this shouldn't be necessary

11 changes: 11 additions & 0 deletions repository/flink/docs/demo/tests/flink-demo/01-errors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
storageclass.kubernetes.io/is-default-class: "true"
name: standard
provisioner: rancher.io/local-path
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

# default storage class for kind... it is an error if it exists
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl delete storageclass standard
- command: kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is applying the same StorageClass that has just been deleted, see https://github.com/rancher/local-path-provisioner/blob/master/deploy/local-path-storage.yaml#L82. Why is this necessary to do here? This also means that the error condition above will always fire.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kensipe I see this as an infra step. If we run these tests along with other tests present in this repository we might be changing the outcome of the tests. What about just using the storage class that is already present and which is being deleted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah... these tests are great for setting up and running / verifying the flink demo... perhaps we shouldn't hook them into the infra... is there any suggestion?

- command: kubectl annotate storageclass --overwrite local-path storageclass.kubernetes.io/is-default-class=true
27 changes: 27 additions & 0 deletions repository/flink/docs/demo/tests/flink-demo/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: kudo.dev/v1beta1
kind: OperatorVersion
metadata:
name: flink-0.2.1
spec:
appVersion: 1.7.2
operator:
kind: Operator
name: flink
---
apiVersion: kudo.dev/v1beta1
kind: OperatorVersion
metadata:
name: kafka-1.2.0
spec:
appVersion: 2.4.0
operator:
kind: Operator
---
apiVersion: kudo.dev/v1beta1
kind: OperatorVersion
metadata:
name: zookeeper-0.3.0
spec:
appVersion: 3.4.14
operator:
kind: Operator
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl kudo install zookeeper --operator-version=0.3.0 --skip-instance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use local packages here, i.e. relative paths instead of packages from the community repository. This will allow us to see if (local) changes to any of these operators break this test.
Here and for kafka and flink below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps these tests are different... and should be relocated or not hooked into the infra... this is under the "demo" folder and these teams are similar to our use of kuttl for MWT.. they setup a cluster with the flink demo.

On the other hand... I could see value in having the demo checked on PRs to confirm it still works... hmm..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these steps are necessary once #279 is merged

namespaced: true
- command: kubectl kudo install kafka --operator-version=1.2.0 --skip-instance
namespaced: true
- command: kubectl kudo install flink --operator-version=0.2.1 --skip-instance
namespaced: true
14 changes: 14 additions & 0 deletions repository/flink/docs/demo/tests/flink-demo/03-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 600
---
apiVersion: kudo.dev/v1beta1
kind: Instance
metadata:
name: zk
status:
planStatus:
deploy:
status: COMPLETE

# kubectl kudo plan status --instance zk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl kudo install ../../financial-fraud/demo-operator --instance flink-demo
namespaced: true
14 changes: 14 additions & 0 deletions repository/flink/docs/demo/tests/flink-demo/04-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 600
---
apiVersion: kudo.dev/v1beta1
kind: Instance
metadata:
name: kafka
status:
planStatus:
deploy:
status: COMPLETE

# kubectl kudo plan status --instance kafka
15 changes: 15 additions & 0 deletions repository/flink/docs/demo/tests/flink-demo/05-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 600
---
apiVersion: kudo.dev/v1beta1
kind: Instance
metadata:
name: flink
status:
planStatus:
deploy:
status: COMPLETE

# kubectl kudo plan status --instance flink
# this object does not exist until created by demo deploy plan
14 changes: 14 additions & 0 deletions repository/flink/docs/demo/tests/flink-demo/06-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 600
---
apiVersion: kudo.dev/v1beta1
kind: Instance
metadata:
name: flink-demo
status:
planStatus:
deploy:
status: COMPLETE

# similar to kubectl kudo plan status --instance flink-demo