Hi,
although it is no full documentation I like to lose a few words about how OKD4 can be installed on Proxmox (without storage).
Create install-config.yaml
apiVersion: v1
baseDomain: <your domain name e.g. example.com>
compute:
- name: worker
replicas: 0
controlPlane:
name: master
replicas: 3
metadata:
name: okd
networking:
clusterNetworks:
- cidr: 10.254.0.0/16
hostPrefix: 24
networkType: OpenShiftSDN
serviceNetwork:
- 172.30.0.0/16
platform:
none: {}
pullSecret: '<Your pull secret from https://cloud.redhat.com/openshift/install/vsphere/user-provisioned>'
sshKey: <Your public SSH key beginning with ssh-rsa ...>
openshift-installer create ignition-configs
Put your DNS entries in the DNS forwarder of PFSense. The etcd SVC entries should be entered in Services->DNS Resolver->General Settings->Custom Options like this:
server:
local-data: "_etcd-server-ssl._tcp.okd.<YOUR HOSTNAME e.g. example.com> 60 IN SRV 0 10 2380 etcd-0.okd.<YOUR HOSTNAME e.g. example.com>."
local-data: "_etcd-server-ssl._tcp.okd.<YOUR HOSTNAME e.g. example.com> 60 IN SRV 0 10 2380 etcd-1.okd.<YOUR HOSTNAME e.g. example.com>."
local-data: "_etcd-server-ssl._tcp.okd.<YOUR HOSTNAME e.g. example.com> 60 IN SRV 0 10 2380 etcd-2.okd.<YOUR HOSTNAME e.g. example.com>."
local-zone: "apps.okd.<YOUR HOSTNAME e.g. example.com>" redirect
local-data: "apps.okd.<YOUR HOSTNAME e.g. example.com> 60 IN A <IP ADDRESS OF YOUR INGRESS ROUTER/DOMAIN NAME>"
I had to add the last two entries for apps.okd because during the installation some OKD services are communicating with apps.okd.... adresses and I had network hairpinning problems I didn't get resolved.
Scripts for bootstrap and master machines. Run them on the Proxmox host:
create-cluster.sh
./create-bootstrap.sh 109 bootstrap <some unique MAC address #0 for static IP through DHCP e.g.: 12:34:56:78:90:12>
./create-masters.sh
create-bootstrap.sh
ID=$1
NAME=$2
MACADDR=$3
qm stop $ID
sleep 10
qm destroy $ID
sleep 10
qm create $ID --name $NAME --memory 2048 --net0
virtio,bridge=vmbr1,macaddr=$MACADDR,mtu=1400
qm importdisk $ID fedora-coreos.qcow2 local
qm set $ID --scsihw virtio-scsi-pci --scsi0 local:$ID/vm-$ID-disk-0.raw
qm set $ID --boot c --bootdisk scsi0
qm set $ID --serial0 socket --vga serial0
echo "args: -fw_cfg name=opt/com.coreos/config,file=/root/install-config/bootstrap.ign" >> /etc/pve/qemu-server/$ID.conf
qm start $ID
create-masters.sh
./create-master.sh 110 master0 <some unique MAC address #1 for static IP through DHCP e.g.: 12:34:56:78:90:12>
./create-master.sh 111 master1 <some unique MAC address #2 for static IP through DHCP e.g.: 12:34:56:78:90:12>
./create-master.sh 112 master2 <some unique MAC address #3 for static IP through DHCP e.g.: 12:34:56:78:90:12>
create-master.sh
ID=$1
NAME=$2
MACADDR=$3
qm stop $ID
sleep 10
qm destroy $ID
sleep 10
# !!! Important: Minimum 2 cores and 4GByte RAM. Without that SDN won't start !!!
qm create $ID --name $NAME --cores 3 --memory 12000 --net0 virtio,bridge=vmbr1,macaddr=$MACADDR,mtu=1400
qm importdisk $ID fedora-coreos.qcow2 local
qm set $ID --scsihw virtio-scsi-pci --scsi0 local:$ID/vm-$ID-disk-0.raw
qm set $ID --boot c --bootdisk scsi0
qm set $ID --serial0 socket --vga serial0
echo "args: -fw_cfg name=opt/com.coreos/config,file=/root/install-config/master.ign" >> /etc/pve/qemu-server/$ID.conf
qm start $ID
I hope that's enough for the start. The installation and configuration of PFSense is worth an article on its own :-)
Have fun.
Greetings,
Josef
Looks interesting! Could you convert this into a pull request, which adds examples/install_on_promox.md file with this info?
I'm not quite following the static IP part - since its being set in DHCP server its in fact "dynamic IP" as the host follows DHCP server rules. "Static IP" would be patching Ignition for each particular master to set IP when deploying infra. See vSphere UPI example.
Did I understood that correctly?
@vrutkovs
I鈥榤 not sure if the Installer sets Hostnames for the VMs (bootstrap, masters, workers). Does it set them? If yes, which names are used?
Installer doesn't set these, yeah, it has to be done separately - either via DHCP or via running hostnamectl / writing /etc/hostname
Please convert it into a PR
maybe create ansible playbook for this ?
Closing - this needs to be a PR for guides
maybe create ansible playbook for this ?
I have a working playbook for deploy vm + bootstrap.
@jwklijnsma do you mind sharing it?
@jwklijnsma do you mind sharing it?
Not yet i need to change to more vars and cloud-init is broken with coreos and proxmox ve.
@jwklijnsma do you mind sharing it?
Not yet i need to change to more vars and cloud-init is broken with coreos and proxmox ve.
If it helps you can embed the ignition config in the VM (AFAICT cloud-init is a no-go in coreos for good) using the "args" argument to qm create when you create the vm. E.g:
# mk-fcos.sh
VMID=$(pvesh get /cluster/nextid)
qm create ${VMID} \
--name fcos-${VMID} \
--pool coreos \
--bios ovmf \
--storage vm-disk-images \
--scsihw virtio-scsi-pci \
--scsi0 vm-disk-images:${VMID}/vm-${VMID}-disk-1.qcow2 \
--efidisk0 vm-disk-images:1,format=qcow2 \
--net0 virtio,bridge=vmbr0 \
--memory 8192 \
--serial0 socket \
--args '-fw_cfg name=opt/com.coreos/config,file=/mnt/pve/vm-disk-images/images/ignition/fcos.ign' && \
qm importdisk ${VMID} /mnt/pve/vm-disk-images/images/dist-images/fedora-coreos-31.20200420.3.0-qemu.qcow2 vm-disk-images --format=qcow2 && \
qm showcmd ${VMID}
qm start ${VMID}
@jwklijnsma do you mind sharing it?
Not yet i need to change to more vars and cloud-init is broken with coreos and proxmox ve.
If it helps you can embed the ignition config in the VM (AFAICT cloud-init is a no-go in coreos for good) using the "args" argument to
qm createwhen you create the vm. E.g:# mk-fcos.sh VMID=$(pvesh get /cluster/nextid) qm create ${VMID} \ --name fcos-${VMID} \ --pool coreos \ --bios ovmf \ --storage vm-disk-images \ --scsihw virtio-scsi-pci \ --scsi0 vm-disk-images:${VMID}/vm-${VMID}-disk-1.qcow2 \ --efidisk0 vm-disk-images:1,format=qcow2 \ --net0 virtio,bridge=vmbr0 \ --memory 8192 \ --serial0 socket \ --args '-fw_cfg name=opt/com.coreos/config,file=/mnt/pve/vm-disk-images/images/ignition/fcos.ign' && \ qm importdisk ${VMID} /mnt/pve/vm-disk-images/images/dist-images/fedora-coreos-31.20200420.3.0-qemu.qcow2 vm-disk-images --format=qcow2 && \ qm showcmd ${VMID} qm start ${VMID}
I use the .ign file for bootstrap of okd 4.4 so i need to have a look at it.
Hi i have working playbook put some parts needs do with the hand. Okd is still in beta.
Maybe working with soms people on the project ?
Hi i have working playbook put some parts needs do with the hand
Feel free to submit a PR with description of your steps to guides/ folder.
Another idea worth exploring - proxmox has a libvirt socket, so we could use libvirt IPI instructions to create machines automatically. OKD installer doesn't have it enabled out of the box, but a separate build is available at registry.svc.ci.openshift.org/origin/4.5:libvirt-installer. External LB and DNS are still required though
There is a Terraform provider for Proxmox:
https://github.com/Telmate/terraform-provider-proxmox
I'll try out if the "--args" parameter is already implemented. With that it would be possible to support ignition files for FCOS images :-)
Most helpful comment
maybe create ansible playbook for this ?