-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathtest-olm-deployment.sh
executable file
·147 lines (140 loc) · 3.19 KB
/
test-olm-deployment.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/bash
#
# Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set +x
source ./env.sh
yes_or_no() {
read -p "$1 (y/n)? " choice
case "$choice" in
y|Y ) ;;
n|N ) exit 1;;
* ) yes_or_no "$1";;
esac
}
./generate-olm-bundle.sh
current_context=$(kubectl config current-context)
if [[ -z "$current_context" ]]; then
echo "No kubectl context is set. Please set a context and try again."
exit 1
fi
current_namespace=$(kubectl config get-contexts "$current_context" | tail -n1 | awk '{print $5}')
yes_or_no "The pulsar cluster will be installed in the context $current_context, namespace $current_namespace."
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.22.0/install.sh | bash -s v0.22.0
# Deploy the catalog src
cat <<EOF | kubectl apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: olm-kaap-catalog
namespace: default
spec:
sourceType: grpc
image: "${DOCKER_REGISTRY}/${DOCKER_ORG}/kaap-op-catalog:${IMAGE_TAG}"
EOF
# 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:
# if not set, default to watch all namespaces
targetNamespaces:
- default
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: kaap
namespace: default
spec:
channel: alpha
name: kaap
source: olm-kaap-catalog
sourceNamespace: default
EOF
cat <<EOF | kubectl apply -f -
global:
name: pulsar
image: apachepulsar/pulsar:3.0.0
restartOnConfigMapChange: true
zookeeper:
replicas: 1
dataVolume:
name: data
size: 100M
resources:
requests:
cpu: "0.2"
memory: "128Mi"
bookkeeper:
replicas: 1
volumes:
journal:
size: 1Gi
ledgers:
size: 1Gi
resources:
requests:
cpu: "0.2"
memory: "128Mi"
broker:
replicas: 1
config:
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultWriteQuorum: "1"
resources:
requests:
cpu: "0.2"
memory: "128Mi"
proxy:
replicas: 1
resources:
requests:
cpu: "0.2"
memory: "128Mi"
webSocket:
resources:
requests:
cpu: "0.2"
memory: "128Mi"
autorecovery:
replicas: 1
resources:
requests:
cpu: "0.2"
memory: "128Mi"
bastion:
replicas: 1
resources:
requests:
cpu: "0.2"
memory: "128Mi"
functionsWorker:
replicas: 1
runtime: kubernetes
config:
numFunctionPackageReplicas: 1
functionInstanceMaxResources:
disk: 10000000000
ram: 500000000
cpu: 0.3
resources:
requests:
cpu: "0.3"
EOF