Skip to content

Commit 7376cb9

Browse files
sebrandon1rdavid
andauthored
Improve vagrant and Makefile for self-hosted runners (#225)
* Improve vagrant and Makefile for self-hosted runners * Simplify calico yaml downloading --------- Co-authored-by: David Rabkin <[email protected]>
1 parent bba269b commit 7376cb9

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ install:
2222
# ./scripts/install-prometheus-operator.sh
2323
./scripts/deploy-operator-crd-scaling.sh
2424

25+
# Bootstrap Fedora Machine Locally
26+
bootstrap-docker-fedora-local:
27+
cd config/vagrant/scripts; ./bootstrap-docker.sh
28+
29+
bootstrap-golang-fedora-local:
30+
cd config/vagrant/scripts; ./bootstrap-golang.sh
31+
32+
bootstrap-cluster-fedora-local:
33+
cd config/vagrant/scripts; ./bootstrap-cluster.sh
34+
2535
# creates a k8s cluster instance
2636
rebuild-cluster:
2737
./scripts/deploy-k8s-cluster.sh

config/vagrant/Vagrantfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,15 @@ Vagrant.configure('2') do |config|
2828
# Triggers reload to setup docker rootless permissions.
2929
k8shost.vm.provision :reload
3030

31-
# Configures kubernetes.
31+
# Download KIND and Kubectl/OC binaries
3232
k8shost.vm.provision 'shell',
3333
path: 'scripts/bootstrap-cluster.sh',
3434
privileged: false
35+
36+
# Build the KIND cluster and install the resources
37+
k8shost.vm.provision 'shell',
38+
inline: 'cd partner; make rebuild-cluster'
39+
k8shost.vm.provision 'shell',
40+
inline: 'cd partner; make install'
3541
end
3642
end

config/vagrant/scripts/bootstrap-cluster.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,3 @@ curl -Lo oc.tar.gz "${OC_DL_URL}"
1818
tar -xvf oc.tar.gz
1919
chmod +x oc kubectl
2020
sudo cp oc kubectl /usr/bin/.
21-
22-
# create cluster
23-
cd partner || exit 1
24-
make rebuild-cluster
25-
make install

scripts/deploy-k8s-cluster.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ kind delete cluster
55
# Kind base with kindnetcni and ipv4/ipv6
66
kind create cluster --config=config/k8s-cluster/config.yaml
77

8-
# deploy calico (not needed but more feature rich - for future use)
9-
oc create -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/calico.yaml
8+
# Download the calico YAML and change the image source to quay
9+
curl https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml |
10+
sed s/docker.io/quay.io/g >temp-calico.yaml
1011

12+
# Deploy calico (not needed but more feature rich - for future use)
13+
oc create -f temp-calico.yaml

scripts/deploy-multus-network.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ then
3030

3131
# Install macvlan and other default plugins
3232
echo "## install CNIs"
33+
sed 's/alpine/quay.io\/jitesoft\/alpine:latest/g' temp/multus-cni/e2e/cni-install.yml -i
3334
kubectl create -f temp/multus-cni/e2e/cni-install.yml
3435
kubectl -n kube-system wait --for=condition=ready -l name="cni-plugins" pod --timeout="$TNF_DEPLOYMENT_TIMEOUT"
3536

0 commit comments

Comments
 (0)