Skip to content

Commit f12b021

Browse files
authored
Pin kubevela and knative to control-plane (#74)
This way they don't interfere with resources dedicated to deployed apps.
1 parent 3dc7b6c commit f12b021

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

installation-scripts-onm/MASTER_START_SCRIPT.sh

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,31 @@ echo "Installing Vela CLI"
4949
$dau bash -c 'curl -fsSl https://kubevela.io/script/install.sh | bash'
5050
echo "Configuration complete."
5151

52+
cat > /home/ubuntu/kubevela-values.yaml << EOF
53+
nodeSelector:
54+
"node-role.kubernetes.io/control-plane": ""
55+
tolerations:
56+
- key: "node-role.kubernetes.io/control-plane"
57+
operator: "Exists"
58+
effect: "NoSchedule"
59+
EOF
60+
61+
$dau bash -c 'helm repo add kubevela https://kubevela.github.io/chart && helm repo update'
62+
63+
cat > /home/ubuntu/patch-pin-to-control-plane.yaml << EOF
64+
apiVersion: apps/v1
65+
kind: Deployment
66+
spec:
67+
template:
68+
spec:
69+
nodeSelector:
70+
"node-role.kubernetes.io/control-plane": ""
71+
tolerations:
72+
- key: "node-role.kubernetes.io/control-plane"
73+
operator: "Exists"
74+
effect: "NoSchedule"
75+
EOF
76+
5277
echo "Setting KubeVela..."
5378
# Function to check for worker nodes and install KubeVela
5479
cat > /home/ubuntu/install_kubevela.sh << 'EOF'
@@ -57,7 +82,7 @@ echo "Start install_kubevela.sh"
5782
echo "-----${KUBECONFIG}---------"
5883
sudo cat ${KUBECONFIG}
5984
echo "--------------"
60-
sudo -H -E -u ubuntu bash -c 'vela install -y --version 1.9.11'
85+
sudo -H -E -u ubuntu bash -c 'helm upgrade --install --create-namespace -n vela-system kubevela kubevela/vela-core --version 1.9.11 --values /home/ubuntu/kubevela-values.yaml --wait'
6186
echo "Vela installation done."
6287
if [ "$SERVERLESS_ENABLED" == "yes" ]; then
6388
echo "Serverless installation."
@@ -75,6 +100,10 @@ if [ "$SERVERLESS_ENABLED" == "yes" ]; then
75100
# Apply Knative Serving CRDs and core components
76101
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-crds.yaml
77102
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-core.yaml
103+
kubectl patch deployment -n knative-serving activator --patch "$(cat /home/ubuntu/patch-pin-to-control-plane.yaml)"
104+
kubectl patch deployment -n knative-serving autoscaler --patch "$(cat /home/ubuntu/patch-pin-to-control-plane.yaml)"
105+
kubectl patch deployment -n knative-serving controller --patch "$(cat /home/ubuntu/patch-pin-to-control-plane.yaml)"
106+
kubectl patch deployment -n knative-serving webhook --patch "$(cat /home/ubuntu/patch-pin-to-control-plane.yaml)"
78107
79108
# Download and apply Kourier
80109
sudo wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/kourier.yaml

serverless/kourier.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ spec:
399399
memory: 500Mi
400400
restartPolicy: Always
401401
serviceAccountName: net-kourier
402+
nodeSelector:
403+
"node-role.kubernetes.io/control-plane": ""
404+
tolerations:
405+
- key: "node-role.kubernetes.io/control-plane"
406+
operator: "Exists"
407+
effect: "NoSchedule"
402408
---
403409
apiVersion: v1
404410
kind: Service
@@ -543,6 +549,12 @@ spec:
543549
configMap:
544550
name: kourier-bootstrap
545551
restartPolicy: Always
552+
nodeSelector:
553+
"node-role.kubernetes.io/control-plane": ""
554+
tolerations:
555+
- key: "node-role.kubernetes.io/control-plane"
556+
operator: "Exists"
557+
effect: "NoSchedule"
546558
---
547559
apiVersion: v1
548560
kind: Service

0 commit comments

Comments
 (0)