diff --git a/examples/edge-stack-iso/custom/files/basic-setup.sh b/examples/edge-stack-iso/custom/files/basic-setup.sh new file mode 100755 index 00000000..bf5ae375 --- /dev/null +++ b/examples/edge-stack-iso/custom/files/basic-setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Pre-requisites. Cluster already running +export KUBECTL="/var/lib/rancher/rke2/bin/kubectl" +export KUBECONFIG="/etc/rancher/rke2/rke2.yaml" + +################## +# METAL3 DETAILS # +################## +export METAL3_CHART_TARGETNAMESPACE="metal3-system" +export METAL3_CLUSTERCTLVERSION="1.6.2" +export METAL3_CAPICOREVERSION="1.6.0" +export METAL3_CAPIMETAL3VERSION="1.6.0" +export METAL3_CAPIRKE2VERSION="0.2.6" +export METAL3_CAPIPROVIDER="rke2" +export METAL3_CAPISYSTEMNAMESPACE="capi-system" +export METAL3_RKE2BOOTSTRAPNAMESPACE="rke2-bootstrap-system" +export METAL3_CAPM3NAMESPACE="capm3-system" +export METAL3_RKE2CONTROLPLANENAMESPACE="rke2-control-plane-system" + +########### +# METALLB # +########### +export METALLBNAMESPACE="metallb-system" + +########### +# RANCHER # +########### +export RANCHER_CHART_TARGETNAMESPACE="cattle-system" +export RANCHER_FINALPASSWORD="adminadminadmin" + +die(){ + echo ${1} 1>&2 + exit ${2} +} \ No newline at end of file diff --git a/examples/edge-stack-iso/custom/files/edge-stack-setup.service b/examples/edge-stack-iso/custom/files/edge-stack-setup.service new file mode 100755 index 00000000..2a64b18a --- /dev/null +++ b/examples/edge-stack-iso/custom/files/edge-stack-setup.service @@ -0,0 +1,30 @@ +[Unit] +Description=Setup Edge stack components +Wants=network-online.target +# It requires rke2 or k3s running, but it won't fail if those services are not present +After=network.target network-online.target rke2-server.service k3s.service +# At least, the basic-setup.sh one needs to be present +ConditionPathExists=/opt/edge/bin/basic-setup.sh + +[Service] +User=root +Type=forking +# Metal3 can take A LOT to download the IPA image +TimeoutStartSec=1800 + +ExecStartPre=/bin/sh -c "echo 'Setting up Edge components...'" +# Scripts are executed in StartPre because Start can only run a single on +ExecStartPre=/opt/edge/bin/rancher.sh +ExecStartPre=/opt/edge/bin/metal3.sh +ExecStart=/bin/sh -c "echo 'Finished setting up Edge components'" +RemainAfterExit=yes +KillMode=process +# Disable & delete everything +ExecStartPost=rm -f /opt/edge/bin/rancher.sh +ExecStartPost=rm -f /opt/edge/bin/metal3.sh +ExecStartPost=rm -f /opt/edge/bin/basic-setup.sh +ExecStartPost=/bin/sh -c "systemctl disable edge-stack-setup.service" +ExecStartPost=rm -f /etc/systemd/system/edge-stack-setup.service + +[Install] +WantedBy=multi-user.target diff --git a/examples/edge-stack-iso/custom/files/metal3.sh b/examples/edge-stack-iso/custom/files/metal3.sh new file mode 100755 index 00000000..83cccdbb --- /dev/null +++ b/examples/edge-stack-iso/custom/files/metal3.sh @@ -0,0 +1,126 @@ +#!/bin/bash +set -euo pipefail + +BASEDIR="$(dirname "$0")" +source ${BASEDIR}/basic-setup.sh + +METAL3LOCKNAMESPACE="default" +METAL3LOCKCMNAME="metal3-lock" + +# Get or create the lock to run all those steps just in a single node +# As the first node is created WAY before the others, this should be enough +# TODO: Investigate if leases is better +if [ $(${KUBECTL} get cm -n ${METAL3LOCKNAMESPACE} ${METAL3LOCKCMNAME} -o name | wc -l) -lt 1 ]; then + ${KUBECTL} create configmap ${METAL3LOCKCMNAME} -n ${METAL3LOCKNAMESPACE} --from-literal foo=bar +else + exit 0 +fi + +# Wait for metal3 +while ! ${KUBECTL} wait --for condition=ready -n ${METAL3_CHART_TARGETNAMESPACE} $(${KUBECTL} get pods -n ${METAL3_CHART_TARGETNAMESPACE} -l app.kubernetes.io/name=metal3-ironic -o name) --timeout=10s; do sleep 2 ; done + +# Get the ironic IP +IRONICIP=$(${KUBECTL} get cm -n ${METAL3_CHART_TARGETNAMESPACE} ironic-bmo -o jsonpath='{.data.IRONIC_IP}') + +# Wait for metallb +while ! ${KUBECTL} wait --for condition=ready -n ${METALLBNAMESPACE} $(${KUBECTL} get pods -n ${METALLBNAMESPACE} -l app.kubernetes.io/component=controller -o name) --timeout=10s; do sleep 2 ; done + +# Don't create the ippool if already created +${KUBECTL} get ipaddresspool -n ${METALLBNAMESPACE} ironic-ip-pool -o name || cat <<-EOF | ${KUBECTL} apply -f - +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + name: ironic-ip-pool + namespace: ${METALLBNAMESPACE} +spec: + addresses: + - ${IRONICIP}/32 + serviceAllocation: + priority: 100 + serviceSelectors: + - matchExpressions: + - {key: app.kubernetes.io/name, operator: In, values: [metal3-ironic]} +EOF + +# Same for L2 Advs +${KUBECTL} get L2Advertisement -n ${METALLBNAMESPACE} ironic-ip-pool-l2-adv -o name || cat <<-EOF | ${KUBECTL} apply -f - +apiVersion: metallb.io/v1beta1 +kind: L2Advertisement +metadata: + name: ironic-ip-pool-l2-adv + namespace: ${METALLBNAMESPACE} +spec: + ipAddressPools: + - ironic-ip-pool +EOF + +# If clusterctl is not installed, install it +if ! command -v clusterctl > /dev/null 2>&1; then + LINUXARCH=$(uname -m) + case $(uname -m) in + "x86_64") + export GOARCH="amd64" ;; + "aarch64") + export GOARCH="arm64" ;; + "*") + echo "Arch not found, assuming amd64" + export GOARCH="amd64" ;; + esac + + # Clusterctl bin + # Maybe just use the binary from hauler if available + curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v${METAL3_CLUSTERCTLVERSION}/clusterctl-linux-${GOARCH} -o /usr/local/bin/clusterctl + chmod +x /usr/local/bin/clusterctl +fi + +# If rancher is deployed +if [ $(${KUBECTL} get pods -n ${RANCHER_CHART_TARGETNAMESPACE} -l app=rancher -o name | wc -l) -ge 1 ]; then + cat <<-EOF | ${KUBECTL} apply -f - + apiVersion: management.cattle.io/v3 + kind: Feature + metadata: + name: embedded-cluster-api + spec: + value: false + EOF + + # Disable Rancher webhooks for CAPI + ${KUBECTL} delete mutatingwebhookconfiguration.admissionregistration.k8s.io mutating-webhook-configuration + ${KUBECTL} delete validatingwebhookconfigurations.admissionregistration.k8s.io validating-webhook-configuration + ${KUBECTL} wait --for=delete namespace/cattle-provisioning-capi-system --timeout=300s +fi + +# Deploy CAPI +if [ $(${KUBECTL} get pods -n ${METAL3_CAPISYSTEMNAMESPACE} -o name | wc -l) -lt 1 ]; then + + # https://github.com/rancher-sandbox/cluster-api-provider-rke2#setting-up-clusterctl + mkdir -p ~/.cluster-api + cat <<-EOF > ~/.cluster-api/clusterctl.yaml + images: + all: + repository: registry.opensuse.org/isv/suse/edge/clusterapi/containerfile/suse + EOF + + clusterctl init \ + --core "cluster-api:v${METAL3_CAPICOREVERSION}"\ + --infrastructure "metal3:v${METAL3_CAPIMETAL3VERSION}"\ + --bootstrap "${METAL3_CAPIPROVIDER}:v${METAL3_CAPIRKE2VERSION}"\ + --control-plane "${METAL3_CAPIPROVIDER}:v${METAL3_CAPIRKE2VERSION}" + + # Wait for capi-controller-manager + while ! ${KUBECTL} wait --for condition=ready -n ${METAL3_CAPISYSTEMNAMESPACE} $(${KUBECTL} get pods -n ${METAL3_CAPISYSTEMNAMESPACE} -l cluster.x-k8s.io/provider=cluster-api -o name) --timeout=10s; do sleep 2 ; done + + # Wait for capm3-controller-manager, there are two pods, the ipam and the capm3 one, just wait for the first one + while ! ${KUBECTL} wait --for condition=ready -n ${METAL3_CAPM3NAMESPACE} $(${KUBECTL} get pods -n ${METAL3_CAPM3NAMESPACE} -l cluster.x-k8s.io/provider=infrastructure-metal3 -o name | head -n1 ) --timeout=10s; do sleep 2 ; done + + # Wait for rke2-bootstrap-controller-manager + while ! ${KUBECTL} wait --for condition=ready -n ${METAL3_RKE2BOOTSTRAPNAMESPACE} $(${KUBECTL} get pods -n ${METAL3_RKE2BOOTSTRAPNAMESPACE} -l cluster.x-k8s.io/provider=bootstrap-rke2 -o name) --timeout=10s; do sleep 2 ; done + + # Wait for rke2-control-plane-controller-manager + while ! ${KUBECTL} wait --for condition=ready -n ${METAL3_RKE2CONTROLPLANENAMESPACE} $(${KUBECTL} get pods -n ${METAL3_RKE2CONTROLPLANENAMESPACE} -l cluster.x-k8s.io/provider=control-plane-rke2 -o name) --timeout=10s; do sleep 2 ; done + +fi + +# Clean up the lock cm + +${KUBECTL} delete configmap ${METAL3LOCKCMNAME} -n ${METAL3LOCKNAMESPACE} \ No newline at end of file diff --git a/examples/edge-stack-iso/custom/files/rancher.sh b/examples/edge-stack-iso/custom/files/rancher.sh new file mode 100755 index 00000000..a0ae06c7 --- /dev/null +++ b/examples/edge-stack-iso/custom/files/rancher.sh @@ -0,0 +1,53 @@ +#!/bin/bash +set -euo pipefail + +BASEDIR="$(dirname "$0")" +source ${BASEDIR}/basic-setup.sh + +RANCHERLOCKNAMESPACE="default" +RANCHERLOCKCMNAME="rancher-lock" + +if [ -z "${RANCHER_FINALPASSWORD}" ]; then + # If there is no final password, then finish the setup right away + exit 0 +fi + +# Get or create the lock to run all those steps just in a single node +# As the first node is created WAY before the others, this should be enough +# TODO: Investigate if leases is better +if [ $(${KUBECTL} get cm -n ${RANCHERLOCKNAMESPACE} ${RANCHERLOCKCMNAME} -o name | wc -l) -lt 1 ]; then + ${KUBECTL} create configmap ${RANCHERLOCKCMNAME} -n ${RANCHERLOCKNAMESPACE} --from-literal foo=bar +else + exit 0 +fi + +# Wait for rancher to be deployed +while ! ${KUBECTL} wait --for condition=ready -n ${RANCHER_CHART_TARGETNAMESPACE} $(${KUBECTL} get pods -n ${RANCHER_CHART_TARGETNAMESPACE} -l app=rancher -o name) --timeout=10s; do sleep 2 ; done +until ${KUBECTL} get ingress -n ${RANCHER_CHART_TARGETNAMESPACE} rancher > /dev/null 2>&1; do sleep 10; done + +RANCHERBOOTSTRAPPASSWORD=$(${KUBECTL} get secret -n ${RANCHER_CHART_TARGETNAMESPACE} bootstrap-secret -o jsonpath='{.data.bootstrapPassword}' | base64 -d) +RANCHERHOSTNAME=$(${KUBECTL} get ingress -n ${RANCHER_CHART_TARGETNAMESPACE} rancher -o jsonpath='{.spec.rules[0].host}') + +# Skip the whole process if things have been set already +if [ -z $(${KUBECTL} get settings.management.cattle.io first-login -ojsonpath='{.value}') ]; then + # Add the protocol + RANCHERHOSTNAME="https://${RANCHERHOSTNAME}" + TOKEN="" + while [ -z "${TOKEN}" ]; do + # Get token + sleep 2 + TOKEN=$(curl -sk -X POST ${RANCHERHOSTNAME}/v3-public/localProviders/local?action=login -H 'content-type: application/json' -d "{\"username\":\"admin\",\"password\":\"${RANCHERBOOTSTRAPPASSWORD}\"}" | jq -r .token) + done + + # Set password + curl -sk ${RANCHERHOSTNAME}/v3/users?action=changepassword -H 'content-type: application/json' -H "Authorization: Bearer $TOKEN" -d "{\"currentPassword\":\"${RANCHERBOOTSTRAPPASSWORD}\",\"newPassword\":\"${RANCHER_FINALPASSWORD}\"}" + + # Create a temporary API token (ttl=60 minutes) + APITOKEN=$(curl -sk ${RANCHERHOSTNAME}/v3/token -H 'content-type: application/json' -H "Authorization: Bearer ${TOKEN}" -d '{"type":"token","description":"automation","ttl":3600000}' | jq -r .token) + + curl -sk ${RANCHERHOSTNAME}/v3/settings/server-url -H 'content-type: application/json' -H "Authorization: Bearer ${APITOKEN}" -X PUT -d "{\"name\":\"server-url\",\"value\":\"${RANCHERHOSTNAME}\"}" + curl -sk ${RANCHERHOSTNAME}/v3/settings/telemetry-opt -X PUT -H 'content-type: application/json' -H 'accept: application/json' -H "Authorization: Bearer ${APITOKEN}" -d '{"value":"out"}' +fi + +# Clean up the lock cm +${KUBECTL} delete configmap ${RANCHERLOCKCMNAME} -n ${RANCHERLOCKNAMESPACE} diff --git a/examples/edge-stack-iso/custom/scripts/99-alias.sh b/examples/edge-stack-iso/custom/scripts/99-alias.sh new file mode 100755 index 00000000..a089f0d0 --- /dev/null +++ b/examples/edge-stack-iso/custom/scripts/99-alias.sh @@ -0,0 +1,4 @@ +#!/bin/bash +echo "alias k=kubectl" >> /etc/profile.local +echo "alias kubectl=/var/lib/rancher/rke2/bin/kubectl" >> /etc/profile.local +echo "export KUBECONFIG=/etc/rancher/rke2/rke2.yaml" >> /etc/profile.local diff --git a/examples/edge-stack-iso/custom/scripts/99-edge-setup.sh b/examples/edge-stack-iso/custom/scripts/99-edge-setup.sh new file mode 100755 index 00000000..88ccd335 --- /dev/null +++ b/examples/edge-stack-iso/custom/scripts/99-edge-setup.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Copy the scripts from combustion to the final location +mkdir -p /opt/edge/bin/ +for script in basic-setup.sh rancher.sh metal3.sh; do + cp ${script} /opt/edge/bin/ +done + +# Copy the systemd unit file and enable it at boot +cp edge-stack-setup.service /etc/systemd/system/edge-stack-setup.service +systemctl enable edge-stack-setup.service \ No newline at end of file diff --git a/examples/edge-stack-iso/custom/scripts/99-register.sh b/examples/edge-stack-iso/custom/scripts/99-register.sh new file mode 100755 index 00000000..18b3b523 --- /dev/null +++ b/examples/edge-stack-iso/custom/scripts/99-register.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -euo pipefail + +# Registration https://www.suse.com/support/kb/doc/?id=000018564 +if ! which SUSEConnect > /dev/null 2>&1; then + zypper --non-interactive install suseconnect-ng +fi +SUSEConnect --email "" --url "https://scc.suse.com" --regcode "" diff --git a/examples/edge-stack-iso/eib.yaml b/examples/edge-stack-iso/eib.yaml new file mode 100755 index 00000000..66878a2b --- /dev/null +++ b/examples/edge-stack-iso/eib.yaml @@ -0,0 +1,143 @@ +apiVersion: 1.0 +image: + arch: x86_64 + baseImage: SLE-Micro.x86_64-5.5.0-Default-SelfInstall.install.iso + imageType: iso + outputImageName: edge30-full-example.iso +kubernetes: + helm: + charts: + - createNamespace: true + installationNamespace: kube-system + name: cert-manager + repositoryName: jetstack + targetNamespace: cert-manager + valuesFile: certmanager.yaml + version: 1.14.2 + - createNamespace: true + installationNamespace: kube-system + name: ui-plugin-operator + repositoryName: rancher-charts + targetNamespace: cattle-ui-plugin-system + version: 103.0.2+up0.2.1 + - createNamespace: true + installationNamespace: kube-system + name: ui-plugin-operator-crd + repositoryName: rancher-charts + targetNamespace: cattle-ui-plugin-system + version: 103.0.2+up0.2.1 + - createNamespace: true + installationNamespace: kube-system + name: cdi + repositoryName: suse-edge-charts + targetNamespace: kubevirt-system + version: 0.2.2 + - createNamespace: true + installationNamespace: kube-system + name: kubevirt + repositoryName: suse-edge-charts + targetNamespace: kubevirt-system + version: 0.2.3 + - createNamespace: true + installationNamespace: kube-system + name: elemental-operator-crds-chart + repositoryName: elemental-operator-crd + targetNamespace: cattle-elemental-system + version: 1.4.2 + - createNamespace: true + installationNamespace: kube-system + name: elemental-operator-chart + repositoryName: elemental-operator + targetNamespace: cattle-elemental-system + version: 1.4.2 + - createNamespace: true + installationNamespace: kube-system + name: longhorn + repositoryName: longhorn + targetNamespace: longhorn-system + version: 1.6.0 + - createNamespace: true + installationNamespace: kube-system + name: metal3 + repositoryName: suse-edge-charts + targetNamespace: metal3-system + valuesFile: metal3.yaml + version: 0.6.3 + - createNamespace: true + installationNamespace: kube-system + name: core + repositoryName: neuvector + targetNamespace: neuvector + valuesFile: neuvector.yaml + version: 2.7.3 + - createNamespace: true + installationNamespace: kube-system + name: rancher + repositoryName: rancher-prime + targetNamespace: cattle-system + valuesFile: rancher.yaml + version: 2.8.2 + - createNamespace: true + installationNamespace: kube-system + name: kubevirt-dashboard-extension + repositoryName: suse-edge-charts + targetNamespace: cattle-ui-plugin-system + version: 1.0.0 + - createNamespace: true + installationNamespace: kube-system + name: elemental + repositoryName: elementalui + targetNamespace: cattle-ui-plugin-system + version: 1.3.0 + repositories: + - name: jetstack + url: https://charts.jetstack.io + - name: rancher-charts + url: https://charts.rancher.io/ + - name: suse-edge-charts + url: https://suse-edge.github.io/charts + - name: elemental-operator-crd + url: oci://registry.suse.com/rancher/elemental-operator-crds-chart + - name: elemental-operator + url: oci://registry.suse.com/rancher/elemental-operator-chart + - name: longhorn + url: https://charts.longhorn.io + - name: neuvector + url: https://neuvector.github.io/neuvector-helm + - name: rancher-prime + url: https://charts.rancher.com/server-charts/prime + - name: elementalui + url: https://github.com/rancher/ui-plugin-charts/raw/main/ + network: + apiHost: 192.168.122.10.sslip.io + apiVIP: 192.168.122.10 + nodes: + - hostname: host1rke2.example.com + initializer: true + type: server + - hostname: host2rke2.example.com + type: server + - hostname: host3rke2.example.com + type: server + version: v1.28.8+rke2r1 +operatingSystem: + isoConfiguration: + installDevice: /dev/sda + packages: + packageList: + - jq + - qemu-guest-agent + sccRegistrationCode: + systemd: + disable: + - haveged.service + - rebootmgr.service + - transactional-update.timer + - transactional-update-cleanup.timer + enable: + - qemu-guest-agent + users: + - encryptedPassword: + sshKeys: + - ssh-rsa + username: root diff --git a/examples/edge-stack-iso/kubernetes/config/agent.yaml b/examples/edge-stack-iso/kubernetes/config/agent.yaml new file mode 100755 index 00000000..46da8e04 --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/config/agent.yaml @@ -0,0 +1,6 @@ +cni: +- multus +- cilium +write-kubeconfig-mode: '0644' +selinux: true +token: foobar diff --git a/examples/edge-stack-iso/kubernetes/config/server.yaml b/examples/edge-stack-iso/kubernetes/config/server.yaml new file mode 100755 index 00000000..46da8e04 --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/config/server.yaml @@ -0,0 +1,6 @@ +cni: +- multus +- cilium +write-kubeconfig-mode: '0644' +selinux: true +token: foobar diff --git a/examples/edge-stack-iso/kubernetes/helm/values/certmanager.yaml b/examples/edge-stack-iso/kubernetes/helm/values/certmanager.yaml new file mode 100755 index 00000000..1ed23bb1 --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/helm/values/certmanager.yaml @@ -0,0 +1 @@ +installCRDs: "true" diff --git a/examples/edge-stack-iso/kubernetes/helm/values/metal3.yaml b/examples/edge-stack-iso/kubernetes/helm/values/metal3.yaml new file mode 100755 index 00000000..8445df51 --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/helm/values/metal3.yaml @@ -0,0 +1,9 @@ +global: + ironicIP: 10.124.137.251 + enable_vmedia_tls: false +metal3-ironic: + global: + predictableNicNames: "true" + persistence: + ironic: + size: "5Gi" \ No newline at end of file diff --git a/examples/edge-stack-iso/kubernetes/helm/values/neuvector.yaml b/examples/edge-stack-iso/kubernetes/helm/values/neuvector.yaml new file mode 100644 index 00000000..6aa6af25 --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/helm/values/neuvector.yaml @@ -0,0 +1,14 @@ +controller: + replicas: 1 + ranchersso: + enabled: true +manager: + enabled: false +cve: + scanner: + enabled: false + replicas: 1 +k3s: + enabled: true +crdwebhook: + enabled: false \ No newline at end of file diff --git a/examples/edge-stack-iso/kubernetes/helm/values/rancher.yaml b/examples/edge-stack-iso/kubernetes/helm/values/rancher.yaml new file mode 100755 index 00000000..b3ddaebc --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/helm/values/rancher.yaml @@ -0,0 +1,4 @@ +hostname: rancher-192.168.122.11.sslip.io +bootstrapPassword: "foobar" +replicas: 1 +global.cattle.psp.enabled: "false" diff --git a/examples/edge-stack-iso/kubernetes/manifests/hello-node.yaml b/examples/edge-stack-iso/kubernetes/manifests/hello-node.yaml new file mode 100755 index 00000000..16fe26c9 --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/manifests/hello-node.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: hello-node + name: hello-node + namespace: default +spec: + replicas: 1 + selector: + matchLabels: + app: hello-node + template: + metadata: + labels: + app: hello-node + spec: + containers: + - command: + - /agnhost + - netexec + - --http-port=8080 + image: registry.k8s.io/e2e-test-images/agnhost:2.39 + imagePullPolicy: IfNotPresent + name: agnhost diff --git a/examples/edge-stack-iso/kubernetes/manifests/ingress-ippool.yaml b/examples/edge-stack-iso/kubernetes/manifests/ingress-ippool.yaml new file mode 100755 index 00000000..6a80886d --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/manifests/ingress-ippool.yaml @@ -0,0 +1,13 @@ +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + name: ingress-ippool + namespace: metallb-system +spec: + addresses: + - 192.168.122.11/32 + serviceAllocation: + priority: 100 + serviceSelectors: + - matchExpressions: + - {key: app.kubernetes.io/name, operator: In, values: [rke2-ingress-nginx]} diff --git a/examples/edge-stack-iso/kubernetes/manifests/ingress-l2-adv.yaml b/examples/edge-stack-iso/kubernetes/manifests/ingress-l2-adv.yaml new file mode 100755 index 00000000..7c323163 --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/manifests/ingress-l2-adv.yaml @@ -0,0 +1,8 @@ +apiVersion: metallb.io/v1beta1 +kind: L2Advertisement +metadata: + name: ingress-l2-adv + namespace: metallb-system +spec: + ipAddressPools: + - ingress-ippool diff --git a/examples/edge-stack-iso/kubernetes/manifests/neuvector-namespace.yaml b/examples/edge-stack-iso/kubernetes/manifests/neuvector-namespace.yaml new file mode 100644 index 00000000..d1a8b288 --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/manifests/neuvector-namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + labels: + pod-security.kubernetes.io/enforce: privileged + name: neuvector \ No newline at end of file diff --git a/examples/edge-stack-iso/kubernetes/manifests/rke2-ingress-config.yaml b/examples/edge-stack-iso/kubernetes/manifests/rke2-ingress-config.yaml new file mode 100755 index 00000000..aaab6d9e --- /dev/null +++ b/examples/edge-stack-iso/kubernetes/manifests/rke2-ingress-config.yaml @@ -0,0 +1,17 @@ +apiVersion: helm.cattle.io/v1 +kind: HelmChartConfig +metadata: + name: rke2-ingress-nginx + namespace: kube-system +spec: + valuesContent: |- + controller: + config: + use-forwarded-headers: "true" + enable-real-ip: "true" + publishService: + enabled: true + service: + enabled: true + type: LoadBalancer + externalTrafficPolicy: Local diff --git a/examples/edge-stack-iso/network/host1rke2.example.com.yaml b/examples/edge-stack-iso/network/host1rke2.example.com.yaml new file mode 100755 index 00000000..9f77e21d --- /dev/null +++ b/examples/edge-stack-iso/network/host1rke2.example.com.yaml @@ -0,0 +1,22 @@ +interfaces: +- name: libvirt + type: ethernet + state: up + mac-address: FE:FF:FF:00:00:01 + ipv4: + dhcp: true + enabled: true + ipv6: + enabled: false +- name: external + type: ethernet + state: up + mac-address: FE:FF:FF:00:01:01 + ipv4: + dhcp: true + enabled: true + auto-dns: false + auto-gateway: false + auto-routes: false + ipv6: + enabled: false diff --git a/examples/edge-stack-iso/network/host2rke2.example.com.yaml b/examples/edge-stack-iso/network/host2rke2.example.com.yaml new file mode 100755 index 00000000..61f66b33 --- /dev/null +++ b/examples/edge-stack-iso/network/host2rke2.example.com.yaml @@ -0,0 +1,22 @@ +interfaces: +- name: libvirt + type: ethernet + state: up + mac-address: FE:FF:FF:00:00:02 + ipv4: + dhcp: true + enabled: true + ipv6: + enabled: false +- name: external + type: ethernet + state: up + mac-address: FE:FF:FF:00:01:02 + ipv4: + dhcp: true + enabled: true + auto-dns: false + auto-gateway: false + auto-routes: false + ipv6: + enabled: false diff --git a/examples/edge-stack-iso/network/host3rke2.example.com.yaml b/examples/edge-stack-iso/network/host3rke2.example.com.yaml new file mode 100755 index 00000000..1225245f --- /dev/null +++ b/examples/edge-stack-iso/network/host3rke2.example.com.yaml @@ -0,0 +1,22 @@ +interfaces: +- name: libvirt + type: ethernet + state: up + mac-address: FE:FF:FF:00:00:03 + ipv4: + dhcp: true + enabled: true + ipv6: + enabled: false +- name: external + type: ethernet + state: up + mac-address: FE:FF:FF:00:01:03 + ipv4: + dhcp: true + enabled: true + auto-dns: false + auto-gateway: false + auto-routes: false + ipv6: + enabled: false