Initial version of spring demo1
This commit is contained in:
parent
4213a9edc6
commit
401b03a247
22 changed files with 645 additions and 67 deletions
6
2024/07/k8s_scratch_demo1/master/Vagrantfile
vendored
6
2024/07/k8s_scratch_demo1/master/Vagrantfile
vendored
|
@ -16,7 +16,7 @@ Vagrant.configure("2") do |config|
|
|||
|
||||
|
||||
config.vm.hostname = "master.local"
|
||||
config.vm.network :private_network, ip: "10.1.0.2"
|
||||
config.vm.network :public_network, ip: "10.1.0.2"
|
||||
|
||||
# Disable automatic box update checking. If you disable this, then
|
||||
# boxes will only be checked for updates when the user runs
|
||||
|
@ -78,7 +78,7 @@ end
|
|||
config.vm.provision "shell", inline: <<-SHELL
|
||||
apt-get update
|
||||
grep "master.local" /etc/hosts || cat /vagrant/hosts.txt >> /etc/hosts
|
||||
test -f /etc/kubernetes/manifests/kube-scheduler.yaml || \\
|
||||
test -f init.log || \\
|
||||
( kubeadm init --control-plane-endpoint master.local:6443 --pod-network-cidr 10.2.0.0/22 | tee init.log )
|
||||
export KUBECONFIG=/etc/kubernetes/admin.conf
|
||||
test -f tigera-operator.yaml || ( wget https://raw.githubusercontent.com/projectcalico/calico/v3.27.0/manifests/tigera-operator.yaml \\
|
||||
|
@ -86,6 +86,8 @@ end
|
|||
test -f custom-resources.yaml || wget https://raw.githubusercontent.com/projectcalico/calico/v3.27.0/manifests/custom-resources.yaml
|
||||
sed -i.bak -E "s#cidr.*#cidr: 10\.2\.0\.0/22#g" custom-resources.yaml
|
||||
kubectl apply -f custom-resources.yaml
|
||||
grep "\-\-token" sample.txt | awk '{ print ($5) }' | tail -n 1 >> /vagrant/token.secret
|
||||
grep "discovery:" init.log | awk '{print($2)}' | tail -n 1 >> /vagrant/discovery.secret
|
||||
cat init.log
|
||||
SHELL
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue