-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path2-create-crc.sh
52 lines (39 loc) · 1.73 KB
/
2-create-crc.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
sudo apt-get update
sudo apt-get install --assume-yes qemu-kvm libvirt-daemon libvirt-daemon-system dnsmasq network-manager
sudo usermod -a -G libvirt $(whoami)
sudo usermod -a -G libvirt-qemu $(whoami)
sudo usermod -a -G libvirt-dnsmasq $(whoami)
sudo reboot
cat << EOF | sudo tee /etc/systemd/resolved.conf > /dev/null
[Resolve]
DNS=127.0.0.2
Domains=apps-crc.testing crc.testing
EOF
sudo sed -i 's/#listen-address=/listen-address=127.0.0.2/g' /etc/dnsmasq.conf
cat << EOF | sudo tee /etc/default/dnsmasq > /dev/null
DOMAIN_SUFFIX=``
ENABLED=1
CONFIG_DIR=/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new
IGNORE_RESOLVCONF=yes
EOF
cat << EOF | sudo tee /etc/dnsmasq.d/crc.conf > /dev/null
address=/crc.testing/192.168.130.11
address=/apps-crc.testing/192.168.130.11
server=/#/8.8.8.8
EOF
sudo systemctl restart systemd-resolved
sudo systemctl restart dnsmasq
dig foo.apps-crc.testing | echo $(grep 192.168.130.11)
dig api.crc.testing | echo $(grep 192.168.130.11)
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz && tar -Jxvf crc-linux-amd64.tar.xz && mkdir -p ~/bin && export PATH=$PATH:~/bin && mv crc-linux*/crc ~/bin/ && rm -rf crc*
crc config set skip-check-network-manager-installed true
crc config set skip-check-systemd-networkd-running true
crc config set skip-check-network-manager-running true
crc config set skip-check-crc-dnsmasq-file true
crc setup
# Download crc pull secret from https://cloud.redhat.com/openshift/install/crc/installer-provisioned and keep it in ~/.crc-pull-secret
nohup crc start -m 20480 -p ~/.crc-pull-secret &
References:
===========
https://github.com/code-ready/crc/issues/549#issuecomment-529379181
https://github.com/code-ready/crc/issues/549#issuecomment-573676404