-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutomatedOLMBuildAndDeploy.sh
executable file
·71 lines (60 loc) · 1.65 KB
/
AutomatedOLMBuildAndDeploy.sh
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
#!/bin/bash
set +x
# Script that Automates the OLM Creation and test of Flink Operator
# Load the env that the person wants to build:
. env.sh
# Run the generate-olm-bundle.sh script
./generate-olm-bundle.sh
# Reset Cluster
kind delete cluster
kind create cluster
kubectl cluster-info --context kind-kind
operator-sdk olm install
# Deploy the catalog src
cat <<EOF | kubectl apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: olm-flink-operator-catalog
namespace: default
spec:
sourceType: grpc
image: "${DOCKER_REGISTRY}/${DOCKER_ORG}/flink-op-catalog:${BUNDLE_VERSION}"
EOF
# sleep 20 seconds
echo "Sleeping 20 seconds"
sleep 20
# Check that the image is up:
kubectl get pods -n default |grep flink
# Deploy the subscription in the default namespace:
cat <<EOF | kubectl apply -f -
apiVersion: operators.coreos.com/v1alpha2
kind: OperatorGroup
metadata:
name: default-og
namespace: default
spec:
targetNamespaces:
- default
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: flink-kubernetes-operator
namespace: default
spec:
channel: alpha
name: flink-kubernetes-operator
source: olm-flink-operator-catalog
sourceNamespace: default
# For testing upgrade from previous version
#installPlanApproval: Automatic # Manual
#startingCSV: "flink-kubernetes-operator.v${PREVIOUS_BUNDLE_VERSION}"
EOF
# sleep 40 seconds
echo "Sleeping 40 seconds"
sleep 40
# Check the image is running
kubectl get pods,csv,ip,sub
# Deploy the sample:
echo "Run a Flink job, use: kubectl create -f https://raw.githubusercontent.com/apache/flink-kubernetes-operator/release-1.2/examples/basic.yaml"