Skip to content

Commit 402826f

Browse files
committed
Revise quick-start guide
The guide has been broken by upstream changes, and is a bit outdated anyway. This is a quite substantial refresh of it that also introduces IrSO. - Bump k8s to v1.34.1 - Deploy Ironic using IrSO - Switch to UEFI boot mode Signed-off-by: Lennart Jern <[email protected]>
1 parent 714e01f commit 402826f

17 files changed

+457
-565
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: bml-01
5+
type: Opaque
6+
stringData:
7+
username: replaceme
8+
password: replaceme
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: metal3.io/v1alpha1
2+
kind: BareMetalHost
3+
metadata:
4+
name: bml-vm-01
5+
spec:
6+
online: true
7+
bootMACAddress: 00:60:2f:31:81:01
8+
bootMode: UEFI
9+
hardwareProfile: libvirt
10+
bmc:
11+
address: redfish-virtualmedia+http://192.168.222.1:8000/redfish/v1/Systems/bmh-vm-01
12+
credentialsName: bml-01
13+
image:
14+
checksumType: sha256
15+
checksum: http://192.168.222.1/SHA256SUMS
16+
format: qcow2
17+
url: http://192.168.222.1/jammy-server-cloudimg-amd64.img
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: metal3.io/v1alpha1
2+
kind: BareMetalHost
3+
metadata:
4+
name: bml-vm-01
5+
spec:
6+
online: true
7+
bootMACAddress: 00:60:2f:31:81:01
8+
bootMode: UEFI
9+
hardwareProfile: libvirt
10+
bmc:
11+
address: redfish-virtualmedia+http://192.168.222.1:8000/redfish/v1/Systems/bmh-vm-01
12+
credentialsName: bml-01
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: baremetal-operator-system
4+
# This is the kustomization that we build on. You can download it and change
5+
# the URL to a relative path if you do not want to access it over the network.
6+
# Note that the ref=main specifies the version to use.
7+
# We use main here simply because the integration with IrSO is not included in a release yet.
8+
resources:
9+
- https://github.com/metal3-io/baremetal-operator/config/use-irso?ref=main
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Baremetal lab image variables
2+
# export IMAGE_URL="http://192.168.0.150/CENTOS_10_NODE_IMAGE_K8S_v1.34.1.qcow2"
3+
# export IMAGE_CHECKSUM="afa7e95ee6fb92b952ab85bae4d01033651e690cf04a626c668041d7b94ddd4a"
4+
# export IMAGE_FORMAT="qcow2"
5+
# Virtualized setup variables
6+
export IMAGE_URL="http://192.168.222.1/CENTOS_10_NODE_IMAGE_K8S_v1.34.1.raw"
7+
export IMAGE_CHECKSUM="20537529c0588e1c3d1929981207ef6fac73df7b2500b84f462d09badcc670ea"
8+
export IMAGE_FORMAT="raw"
9+
# Common variables
10+
export IMAGE_CHECKSUM_TYPE="sha256"
11+
export KUBERNETES_VERSION="v1.34.1"
12+
# Make sure this does not conflict with other networks
13+
export POD_CIDR='["192.168.10.0/24"]'
14+
# These can be used to add user-data
15+
export CTLPLANE_KUBEADM_EXTRA_CONFIG="
16+
preKubeadmCommands:
17+
- systemctl enable --now crio
18+
users:
19+
- name: user
20+
sshAuthorizedKeys:
21+
- ssh-ed25519 ABCD... [email protected]"
22+
export WORKERS_KUBEADM_EXTRA_CONFIG="
23+
preKubeadmCommands:
24+
- systemctl enable --now crio
25+
users:
26+
- name: user
27+
sshAuthorizedKeys:
28+
- ssh-ed25519 ABCD... [email protected]"
29+
# NOTE! You must ensure that this is forwarded or assigned somehow to the
30+
# server(s) that is selected for the control-plane.
31+
# We reserved this address in the net.xml as a basic way to get a fixed IP.
32+
export CLUSTER_APIENDPOINT_HOST="192.168.222.101"
33+
export CLUSTER_APIENDPOINT_PORT="6443"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
docker rm -f sushy-tools
4+
5+
virsh -c qemu:///system destroy --domain "bmh-vm-01"
6+
virsh -c qemu:///system undefine --domain "bmh-vm-01" --remove-all-storage --nvram
7+
8+
# Clear network
9+
virsh -c qemu:///system net-destroy baremetal-e2e
10+
virsh -c qemu:///system net-undefine baremetal-e2e
11+
12+
sudo iptables -D FORWARD -i kind -o metal3 -j ACCEPT
13+
sudo iptables -D FORWARD -i metal3 -o kind -j ACCEPT
14+
15+
sudo ip link delete metalend type veth
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
mkdir disk-images
4+
5+
pushd disk-images || exit
6+
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
7+
wget https://cloud-images.ubuntu.com/jammy/current/SHA256SUMS
8+
sha256sum --ignore-missing -c SHA256SUMS
9+
wget https://artifactory.nordix.org/artifactory/metal3/images/k8s_v1.34.1/CENTOS_10_NODE_IMAGE_K8S_v1.34.1.qcow2
10+
sha256sum CENTOS_10_NODE_IMAGE_K8S_v1.34.1.qcow2
11+
# Convert to raw.
12+
# This helps lower memory requirements, since the raw image can be streamed to disk
13+
# instead of first loaded to memory by IPA for conversion.
14+
qemu-img convert -f qcow2 -O raw CENTOS_10_NODE_IMAGE_K8S_v1.34.1.qcow2 CENTOS_10_NODE_IMAGE_K8S_v1.34.1.raw
15+
# Local cache of IPA
16+
wget https://tarballs.opendev.org/openstack/ironic-python-agent/dib/ipa-centos9-master.tar.gz
17+
popd || exit
18+
19+
docker run --name image-server --rm -d -p 80:8080 \
20+
-v "$(pwd)/disk-images:/usr/share/nginx/html" nginxinc/nginx-unprivileged
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: cert-manager.io/v1
2+
kind: Issuer
3+
metadata:
4+
name: selfsigned-issuer
5+
namespace: baremetal-operator-system
6+
spec:
7+
selfSigned: {}
8+
---
9+
apiVersion: cert-manager.io/v1
10+
kind: Certificate
11+
metadata:
12+
name: ironic-cacert
13+
namespace: baremetal-operator-system
14+
spec:
15+
commonName: ironic-ca
16+
isCA: true
17+
issuerRef:
18+
kind: Issuer
19+
name: selfsigned-issuer
20+
secretName: ironic-cacert
21+
---
22+
apiVersion: cert-manager.io/v1
23+
kind: Issuer
24+
metadata:
25+
name: ca-issuer
26+
namespace: baremetal-operator-system
27+
spec:
28+
ca:
29+
secretName: ironic-cacert
30+
---
31+
apiVersion: cert-manager.io/v1
32+
kind: Certificate
33+
metadata:
34+
name: ironic-cert
35+
namespace: baremetal-operator-system
36+
spec:
37+
ipAddresses:
38+
- 192.168.222.2
39+
dnsNames:
40+
- ironic.baremetal-operator-system.svc
41+
issuerRef:
42+
kind: Issuer
43+
name: ca-issuer
44+
secretName: ironic-cert
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: ironic.metal3.io/v1alpha1
2+
kind: Ironic
3+
metadata:
4+
name: ironic
5+
namespace: baremetal-operator-system
6+
spec:
7+
networking:
8+
dhcp:
9+
rangeBegin: "192.168.222.100"
10+
rangeEnd: "192.168.222.200"
11+
networkCIDR: "192.168.222.0/24"
12+
interface: "eth0"
13+
ipAddress: "192.168.222.2"
14+
ipAddressManager: "keepalived"
15+
tls:
16+
certificateName: ironic-cert
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: baremetal-operator-system
4+
resources:
5+
- ironic.yaml
6+
- certificate.yaml

0 commit comments

Comments
 (0)