在云 VM 上安装 MiniShift 的行之有效的方法是什么?
GCP 支持安装 Minishift 所需的嵌套虚拟化。我认为这是我的程序失败的原因。不确定 AWS ec2 实例是否支持这一点。
可能还有其他安装 Minishift 的方法。
我正在发布在 GCP VM 实例上安装 MiniShift 的说明。请注意,这是我通过搜索找到的指南集合。所以他们可以在其他地方使用,但我正在回答,因为这真的对我有用,而且很容易。
我已经成功部署了一个示例。
gcloud compute disks create minishiftdisk \
--image-project ubuntu-os-cloud \
--image-family ubuntu-1804-lts --zone asia-south1-a
gcloud compute images create nested-vm-image \
--source-disk minishiftdisk --source-disk-zone asia-south1-a \
--licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
gcloud compute instances create minishift-vm \
--zone asia-south1-a \
--machine-type=n1-standard-2 \
--boot-disk-size=50GB \
--min-cpu-platform "Intel Skylake" \
--image nested-vm-image
sudo apt-get update
sudo apt install qemu-kvm libvirt-daemon libvirt-daemon-system
curl -L https://github.com/minishift/minishift/releases/download/v1.34.1/minish
ift-1.34.1-linux-amd64.tgz -O
tar xvzf minishift-1.34.1-linux-amd64.tgz
sudo cp minishift-1.34.1-linux-amd64/minishift /usr/local/bin/
sudo curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v
0.10.0/docker-machine-driver-kvm-ubuntu16.04 -o /usr/local/bin/docker-machine-driver-kvm
sudo chmod +x /usr/local/bin/docker-machine-driver-kvm
minishift start
radhakrishnan_mohan@minishift-vm:~$ minishift oc-env
export PATH="/home/radhakrishnan_mohan/.minishift/cache/oc/v3.11.0/linux:$PATH"
# Run this command to configure your shell:
# eval $(minishift oc-env)
radhakrishnan_mohan@minishift-vm:~$ eval $(minishift oc-env)
radhakrishnan_mohan@minishift-vm:~$ oc get pods
No resources found.
sudo apt install -y xfce4 xfce4-goodies firefox
sudo apt install -y xrdp
radhakrishnan_mohan@minishift-vm:~$ echo xfce4-session > ~/.xsession
radhakrishnan_mohan@minishift-vm:~$ sudo nano /etc/xrdp/startwm.sh
我的脚本看起来像这样。我添加了最后一行并保存了它。
#!/bin/sh
# xrdp X session start script (c) 2015, 2017 mirabilos
# published under The MirOS Licence
if test -r /etc/profile; then
. /etc/profile
fi
if test -r /etc/default/locale; then
. /etc/default/locale
test -z "${LANG+x}" || export LANG
test -z "${LANGUAGE+x}" || export LANGUAGE
test -z "${LC_ADDRESS+x}" || export LC_ADDRESS
test -z "${LC_ALL+x}" || export LC_ALL
test -z "${LC_COLLATE+x}" || export LC_COLLATE
test -z "${LC_CTYPE+x}" || export LC_CTYPE
test -z "${LC_IDENTIFICATION+x}" || export LC_IDENTIFICATION
test -z "${LC_MEASUREMENT+x}" || export LC_MEASUREMENT
test -z "${LC_MESSAGES+x}" || export LC_MESSAGES
test -z "${LC_MONETARY+x}" || export LC_MONETARY
test -z "${LC_NAME+x}" || export LC_NAME
test -z "${LC_NUMERIC+x}" || export LC_NUMERIC
test -z "${LC_PAPER+x}" || export LC_PAPER
test -z "${LC_TELEPHONE+x}" || export LC_TELEPHONE
test -z "${LC_TIME+x}" || export LC_TIME
test -z "${LOCPATH+x}" || export LOCPATH
fi
if test -r /etc/profile; then
. /etc/profile
fi
test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession
startxfce4
重启xrdp
radhakrishnan_mohan@minishift-vm:~$ sudo service xrdp restart
更改root密码
sudo su
passwd
Windows 远程桌面连接
一旦我连接到 GCP VM 实例的公共 IP,我就可以使用凭据 root/密码登录
从 linux 桌面启动 firefox 并登录到OpenShift