-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathknative.sh
95 lines (80 loc) · 3.51 KB
/
knative.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
#!/bin/bash
#
# Installiert die Erweiterung k-native (Serverless, FAAS) fuer Kubernetes - ohne Kafka
#
# Serving
sudo microk8s kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.14.1/serving-crds.yaml
sudo microk8s kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.14.1/serving-core.yaml
sudo microk8s kubectl apply -f https://github.com/knative/net-kourier/releases/download/knative-v1.14.0/kourier.yaml
sudo microk8s kubectl patch configmap/config-network --namespace knative-serving --type merge --patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}'
# sudo microk8s kubectl patch configmap/config-domain --namespace knative-serving --type merge --patch '{"data":{"microk8s.mshome.net":""}}'
# Eventing
sudo microk8s kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.14.2/eventing-crds.yaml
sudo microk8s kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.14.2/eventing-core.yaml
# InMemory Channel
sudo microk8s kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.14.2/in-memory-channel.yaml
# InMemory Broker
sudo microk8s kubectl apply -f https://github.com/knative/eventing/releases/download/knative-v1.14.4/mt-channel-broker.yaml
cat <<EOF | sudo microk8s kubectl apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
name: config-br-defaults
namespace: knative-eventing
data:
default-br-config: |
# This is the cluster-wide default broker channel.
clusterDefault:
brokerClass: MTChannelBasedBroker
apiVersion: v1
kind: ConfigMap
name: imc-channel
namespace: knative-eventing
# This allows you to specify different defaults per-namespace,
# in this case the "some-namespace" namespace will use the Kafka
# channel ConfigMap by default (only for example, you will need
# to install kafka also to make use of this).
namespaceDefaults:
some-namespace:
brokerClass: MTChannelBasedBroker
apiVersion: v1
kind: ConfigMap
name: kafka-channel
namespace: knative-eventing
---
apiVersion: v1
kind: ConfigMap
metadata:
name: imc-channel
namespace: knative-eventing
data:
channel-template-spec: |
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kafka-channel
namespace: knative-eventing
data:
channel-template-spec: |
apiVersion: messaging.knative.dev/v1alpha1
kind: KafkaChannel
spec:
numPartitions: 3
replicationFactor: 1
EOF
# CLI
sudo curl -o /usr/local/bin/kn -sL https://github.com/knative/client/releases/download/knative-v1.14.0/kn-linux-amd64
sudo chmod +x /usr/local/bin/kn
# Plug-ins
mkdir -p ~/.config/kn/plugins/
curl -o ~/.config/kn/plugins/kn-admin -sL https://github.com/knative-extensions/kn-plugin-admin/releases/download/knative-v1.14.0/kn-admin-linux-amd64
chmod +x ~/.config/kn/plugins/kn-admin
curl -o ~/.config/kn/plugins/kn-event -sL https://github.com/knative-extensions/kn-plugin-event/releases/download/knative-v1.14.1/kn-event-linux-amd64
chmod +x ~/.config/kn/plugins/kn-event
curl -o ~/.config/kn/plugins/kn-func -sL https://github.com/knative/func/releases/download/knative-v1.14.0/func_linux_amd64
chmod +x ~/.config/kn/plugins/kn-func
curl -o ~/.config/kn/plugins/kn-kafka -sL https://github.com/knative-extensions/kn-plugin-source-kafka/releases/download/knative-v1.14.0/kn-source-kafka-linux-amd64
chmod +x ~/.config/kn/plugins/kn-kafka