Skip to content

Commit 63e7023

Browse files
committed
WIP
Signed-off-by: Lennart Jern <[email protected]>
1 parent 3f96712 commit 63e7023

File tree

13 files changed

+220
-191
lines changed

13 files changed

+220
-191
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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# export IMAGE_CHECKSUM="ab54897a1bcae83581512cdeeda787f009846cfd7a63b298e472c1bd6c522d23"
2+
export IMAGE_CHECKSUM="0df8b1f15e4af64485e2b155f871b83d904b4b26bbd600cce81ae9ff418bbd5c"
3+
export IMAGE_CHECKSUM_TYPE="sha256"
4+
# export IMAGE_FORMAT="qcow2"
5+
export IMAGE_FORMAT="raw"
6+
# Baremetal lab IMAGE_URL
7+
# export IMAGE_URL="http://192.168.0.150/CENTOS_9_NODE_IMAGE_K8S_v1.33.0.qcow2"
8+
# Virtualized setup IMAGE_URL
9+
# export IMAGE_URL="http://192.168.222.1/CENTOS_9_NODE_IMAGE_K8S_v1.33.0.qcow2"
10+
export IMAGE_URL="http://192.168.222.1/CENTOS_9_NODE_IMAGE_K8S_v1.33.0.raw"
11+
export KUBERNETES_VERSION="v1.33.0"
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+
users:
17+
- name: user
18+
sshAuthorizedKeys:
19+
- ssh-ed25519 ABCD... [email protected]"
20+
export WORKERS_KUBEADM_EXTRA_CONFIG="
21+
users:
22+
- name: user
23+
sshAuthorizedKeys:
24+
- ssh-ed25519 ABCD... [email protected]"
25+
# NOTE! You must ensure that this is forwarded or assigned somehow to the
26+
# server(s) that is selected for the control-plane.
27+
export CLUSTER_APIENDPOINT_HOST="192.168.222.24"
28+
# export CLUSTER_APIENDPOINT_HOST="192.168.0.101"
29+
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
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

docs/user-guide/examples/image-server.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ pushd disk-images
66
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
77
wget https://cloud-images.ubuntu.com/jammy/current/SHA256SUMS
88
sha256sum --ignore-missing -c SHA256SUMS
9-
wget https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2
10-
wget https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2.SHA256SUM
11-
sha256sum -c CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2.SHA256SUM
129
wget https://artifactory.nordix.org/artifactory/metal3/images/k8s_v1.33.0/CENTOS_9_NODE_IMAGE_K8S_v1.33.0.qcow2
1310
sha256sum CENTOS_9_NODE_IMAGE_K8S_v1.33.0.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_9_NODE_IMAGE_K8S_v1.33.0.qcow2 CENTOS_9_NODE_IMAGE_K8S_v1.33.0.raw
15+
# Local cache of IPA
16+
wget https://tarballs.opendev.org/openstack/ironic-python-agent/dib/ipa-centos9-master.tar.gz
1417
popd
1518

1619
docker run --name image-server --rm -d -p 80:8080 \
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

docs/user-guide/examples/ironic.yaml renamed to docs/user-guide/examples/ironic/ironic.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ spec:
1212
interface: "eth0"
1313
ipAddress: "192.168.222.2"
1414
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
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: ironic-standalone-operator-system
4+
5+
resources:
6+
- https://github.com/metal3-io/ironic-standalone-operator/releases/latest/download/install.yaml
7+
8+
generatorOptions:
9+
disableNameSuffixHash: true
10+
11+
configMapGenerator:
12+
- name: ironic-operator-config
13+
literals:
14+
- IPA_BASEURI=http://192.168.222.1
15+
16+
patches:
17+
- target:
18+
kind: Deployment
19+
name: ironic-standalone-operator-controller-manager
20+
patch: |-
21+
apiVersion: apps/v1
22+
kind: Deployment
23+
metadata:
24+
name: ironic-standalone-operator
25+
spec:
26+
template:
27+
spec:
28+
containers:
29+
- name: manager
30+
envFrom:
31+
- configMapRef:
32+
name: ironic-operator-config

0 commit comments

Comments
 (0)