diff --git a/.gitignore b/.gitignore index f8ff2e4..1974b92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1 @@ .envrc.local -infra/local/.vagrant/ -infra/local/kubeconfig -infra/kind/kubeconfig.yaml -redfish-mockup-clients diff --git a/README.md b/README.md index 93ce9d4..e24fb37 100644 --- a/README.md +++ b/README.md @@ -13,17 +13,16 @@ The `tests` directory contains a suite of tests based on [chainsaw](https://kyve * A metal-operator installation and BMC to run tests against. This repository usually uses the locally virtualised [metal-lab](https://github.com/simontesar/metal-lab) to develop or verify functionality of the actual tests. You can use the lab setup as a reference. ### Usage -The server to run a test against is configured by passing a values file to chainsaw via `VALUES`. There is no default, tests fail unless `VALUES` is set. To just see the suite run, use `infra/kind/values-basic-go.yaml`, which points to a Redfish mock setup in the [`kind` environment](environments.md). +The server to run a test against is configured by passing a values file to chainsaw via `VALUES`. To try the tests without using your own BMC, clone the [`metal-lab`](https://github.com/simontesar/metal-lab) repository and refer to its `README` to bring it up. ```bash # Examples -make test VALUES=infra/kind/values-basic-go.yaml # Run all tests -make test/01-bmc-registration VALUES=infra/kind/values-basic-go.yaml # Run a specific test -make test/03-power-annotation VALUES=/path/to/metal-lab/values-containerlab-node1.yaml # Run against a specific BMC +export KUBECONFIG=/path/to/metal-lab/kubeconfig.yaml +make test VALUES=/path/to/metal-lab/values-containerlab-node1.yaml # Run all tests +make test/01-bmc-registration VALUES=/path/to/metal-lab/values-containerlab-node1.yaml # Run a specific test +make test/03-power-annotation VALUES=/path/to/your-bmc.yaml # Run against your own BMC ``` -The [`metal-lab`](https://github.com/simontesar/metal-lab) repository provides a standalone containerlab-based environment and ships its own `VALUES` `values-containerlab-node1.yaml` / `values-containerlab-node2.yaml`. Clone the metal-lab repository and refer to its `README` to try the suite of tests without your own BMC. - ### Bring your own BMC To run tests against your own BMC, copy these values into a new file: ```yaml diff --git a/config/metal-operator/ignition-template.yaml b/config/metal-operator/ignition-template.yaml deleted file mode 100644 index 0b2c482..0000000 --- a/config/metal-operator/ignition-template.yaml +++ /dev/null @@ -1,56 +0,0 @@ -variant: fcos -version: "1.3.0" -systemd: - units: - - name: var-lib-containerd.mount - enabled: true - contents: |- - [Unit] - Description=tmpfs for containerd image cache - DefaultDependencies=no - Before=containerd.service - - [Mount] - What=tmpfs - Where=/var/lib/containerd - Type=tmpfs - Options=mode=0700,size=4g - - [Install] - WantedBy=multi-user.target - - name: containerd.service - enabled: true - dropins: - - name: 10-wait-mount.conf - contents: |- - [Unit] - After=var-lib-containerd.mount - Requires=var-lib-containerd.mount - - name: metalprobe.service - enabled: true - contents: |- - [Unit] - Description=Run Metalprobe Container - After=containerd.service - Requires=containerd.service - [Service] - Restart=on-failure - RestartSec=20 - # --skip-metadata skips fetching platform manifests not needed locally; requires containerd >= 1.4 - ExecStartPre=/usr/bin/ctr images pull --skip-metadata {{.Image}} - ExecStartPre=-/usr/bin/ctr tasks delete --force metalprobe - ExecStartPre=-/usr/bin/ctr containers delete metalprobe - ExecStart=/usr/bin/ctr run --rm --net-host --privileged {{.Image}} metalprobe ./launch.sh {{.Flags}} - TimeoutSec=600 - [Install] - WantedBy=multi-user.target -storage: - files: [] -passwd: - users: - - name: root - password_hash: "$6$U13XNGV9MMTY3xbZ$CoTJBLmGNKn7We/0FpgtURNGudhpKXm/S9E5qXa5hV4RXmnviJJXlKHuZwGSLU5ZxkI0PYMWk.coIjoVL1ADN0" - - name: metal - password_hash: {{.PasswordHash}} - groups: [ "wheel" ] - ssh_authorized_keys: [ {{.SSHPublicKey}} ] diff --git a/config/metal-operator/kustomization.yaml b/config/metal-operator/kustomization.yaml deleted file mode 100644 index ce7dde7..0000000 --- a/config/metal-operator/kustomization.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- https://github.com/ironcore-dev/metal-operator//config/default?ref=35a86bac04c01208a3fb6593b498388590d05f5b -- registry_service.yaml -- macdb-secret.yaml - -configMapGenerator: -- name: ignition-template - namespace: metal-operator-system - files: - - ignition-template.yaml - -generatorOptions: - disableNameSuffixHash: true - -patches: -- path: manager_patch.yaml -- path: metaldata_patch.yaml - -images: -- name: controller - newName: controller - newTag: latest -- name: metaldata - newName: metaldata - newTag: latest diff --git a/config/metal-operator/macdb-secret.yaml b/config/metal-operator/macdb-secret.yaml deleted file mode 100644 index 93eb87e..0000000 --- a/config/metal-operator/macdb-secret.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: macdb - namespace: metal-operator-system -type: Opaque -stringData: - mac_prefixes.yaml: | - macPrefixes: [] diff --git a/config/metal-operator/manager_patch.yaml b/config/metal-operator/manager_patch.yaml deleted file mode 100644 index 778d22d..0000000 --- a/config/metal-operator/manager_patch.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: controller-manager - namespace: system -spec: - template: - spec: - containers: - - name: manager - imagePullPolicy: IfNotPresent - args: - - --leader-elect - - --metrics-bind-address=:8443 - - --health-probe-bind-address=:8081 - - --mac-prefixes-file=/etc/macdb/mac_prefixes.yaml - - --probe-image=ghcr.io/ironcore-dev/metalprobe:latest - #- --probe-os-image=ghcr.io/ironcore-dev/gardenlinux:2150.0.0-metal-manual-a0ea39fa - - --probe-os-image=ghcr.io/ironcore-dev/gardenlinux/capi:2150.0.0-metal - - --registry-url=http://metal-registry.metal-operator-system.svc:30000 - - --registry-port=30000 - - --skip-cert-validation - - --bmc-reset-waiting-interval=1s - ports: - - containerPort: 8081 - name: health - protocol: TCP - - containerPort: 30000 - volumeMounts: - - mountPath: /etc/macdb/ - name: macdb - - mountPath: /etc/metal-operator - name: ignition-template - readOnly: true - volumes: - - name: macdb - secret: - defaultMode: 420 - secretName: macdb - - name: ignition-template - configMap: - name: ignition-template diff --git a/config/metal-operator/metaldata_patch.yaml b/config/metal-operator/metaldata_patch.yaml deleted file mode 100644 index 49f12e9..0000000 --- a/config/metal-operator/metaldata_patch.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: metaldata - namespace: system -spec: - template: - spec: - containers: - - name: metaldata - imagePullPolicy: IfNotPresent diff --git a/config/metal-operator/registry_service.yaml b/config/metal-operator/registry_service.yaml deleted file mode 100644 index 2e0c4ec..0000000 --- a/config/metal-operator/registry_service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: metal-registry - namespace: metal-operator-system -spec: - type: NodePort - ports: - - name: registry-server - port: 30000 - targetPort: 30000 - nodePort: 30000 - selector: - control-plane: controller-manager diff --git a/config/metalprobe-mock-controller/clusterrole.yaml b/config/metalprobe-mock-controller/clusterrole.yaml deleted file mode 100644 index 27ea683..0000000 --- a/config/metalprobe-mock-controller/clusterrole.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: metalprobe-mock-controller - labels: - app.kubernetes.io/name: metalprobe-mock-controller - app.kubernetes.io/managed-by: kustomize -rules: -- apiGroups: - - metal.ironcore.dev - resources: - - serverbootconfigurations - verbs: - - get - - list - - watch -- apiGroups: - - metal.ironcore.dev - resources: - - serverbootconfigurations/status - verbs: - - get - - update - - patch -- apiGroups: - - metal.ironcore.dev - resources: - - servers - verbs: - - get - - list - - watch -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch diff --git a/config/metalprobe-mock-controller/clusterrolebinding.yaml b/config/metalprobe-mock-controller/clusterrolebinding.yaml deleted file mode 100644 index cce17c2..0000000 --- a/config/metalprobe-mock-controller/clusterrolebinding.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: metalprobe-mock-controller - labels: - app.kubernetes.io/name: metalprobe-mock-controller - app.kubernetes.io/managed-by: kustomize -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: metalprobe-mock-controller -subjects: -- kind: ServiceAccount - name: metalprobe-mock-controller - namespace: metal-operator-system diff --git a/config/metalprobe-mock-controller/deployment.yaml b/config/metalprobe-mock-controller/deployment.yaml deleted file mode 100644 index 75bd340..0000000 --- a/config/metalprobe-mock-controller/deployment.yaml +++ /dev/null @@ -1,62 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: metalprobe-mock-controller - labels: - app.kubernetes.io/name: metalprobe-mock-controller - app.kubernetes.io/managed-by: kustomize -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: metalprobe-mock-controller - template: - metadata: - annotations: - kubectl.kubernetes.io/default-container: manager - labels: - app.kubernetes.io/name: metalprobe-mock-controller - spec: - securityContext: - runAsNonRoot: true - seccompProfile: - type: RuntimeDefault - containers: - - name: manager - image: metalprobe-mock-controller:latest - imagePullPolicy: IfNotPresent - command: - - /metalprobe-mock-controller - args: - - --leader-elect - - --registry-url=http://metal-registry.metal-operator-system.svc:30000 - ports: - - containerPort: 8081 - name: health - protocol: TCP - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi - serviceAccountName: metalprobe-mock-controller - terminationGracePeriodSeconds: 10 diff --git a/config/metalprobe-mock-controller/kustomization.yaml b/config/metalprobe-mock-controller/kustomization.yaml deleted file mode 100644 index 714ac0f..0000000 --- a/config/metalprobe-mock-controller/kustomization.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -resources: -- serviceaccount.yaml -- clusterrole.yaml -- clusterrolebinding.yaml -- deployment.yaml - -images: -- name: metalprobe-mock-controller - newName: metalprobe-mock-controller - newTag: latest diff --git a/config/metalprobe-mock-controller/serviceaccount.yaml b/config/metalprobe-mock-controller/serviceaccount.yaml deleted file mode 100644 index b8ef67f..0000000 --- a/config/metalprobe-mock-controller/serviceaccount.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: metalprobe-mock-controller - labels: - app.kubernetes.io/name: metalprobe-mock-controller - app.kubernetes.io/managed-by: kustomize diff --git a/config/redfish-mockups/components/go-mockup/bmc.yaml b/config/redfish-mockups/components/go-mockup/bmc.yaml deleted file mode 100644 index 8349431..0000000 --- a/config/redfish-mockups/components/go-mockup/bmc.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: metal.ironcore.dev/v1alpha1 -kind: BMC -metadata: - name: mockup - labels: - app.kubernetes.io/name: redfish-go-mockup - app.kubernetes.io/component: redfish-go-mockup -spec: - bmcSecretRef: - name: PLACEHOLDER_BMC_SECRET_NAME - hostname: PLACEHOLDER_HOSTNAME - consoleProtocol: - name: SSH - port: 22 - access: - ip: PLACEHOLDER_BMC_IP - protocol: - name: Redfish - port: 8000 - scheme: http diff --git a/config/redfish-mockups/components/go-mockup/bmcsecret.yaml b/config/redfish-mockups/components/go-mockup/bmcsecret.yaml deleted file mode 100644 index fd1c65a..0000000 --- a/config/redfish-mockups/components/go-mockup/bmcsecret.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: metal.ironcore.dev/v1alpha1 -kind: BMCSecret -metadata: - name: mockup - labels: - app.kubernetes.io/name: redfish-go-mockup - app.kubernetes.io/component: redfish-go-mockup -stringData: - username: PLACEHOLDER_USERNAME - password: PLACEHOLDER_PASSWORD diff --git a/config/redfish-mockups/components/go-mockup/deployment.yaml b/config/redfish-mockups/components/go-mockup/deployment.yaml deleted file mode 100644 index a5703b7..0000000 --- a/config/redfish-mockups/components/go-mockup/deployment.yaml +++ /dev/null @@ -1,53 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mockup - labels: - app.kubernetes.io/name: redfish-go-mockup - app.kubernetes.io/component: redfish-go-mockup -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: redfish-go-mockup - app.kubernetes.io/component: redfish-go-mockup - template: - metadata: - labels: - app.kubernetes.io/name: redfish-go-mockup - app.kubernetes.io/component: redfish-go-mockup - spec: - containers: - - name: mock-server - image: mock-server:latest - imagePullPolicy: IfNotPresent - args: - - -addr - - :8000 - - -data - - /clients/PLACEHOLDER_CLIENT/redfish/v1 - ports: - - containerPort: 8000 - volumeMounts: - - name: clients - mountPath: /clients - readOnly: true - livenessProbe: - httpGet: - path: /redfish/v1 - port: 8000 - scheme: HTTP - initialDelaySeconds: 15 - periodSeconds: 10 - readinessProbe: - httpGet: - path: /redfish/v1 - port: 8000 - scheme: HTTP - initialDelaySeconds: 5 - periodSeconds: 5 - volumes: - - name: clients - hostPath: - path: PLACEHOLDER_CLIENTS_MOUNT - type: Directory diff --git a/config/redfish-mockups/components/go-mockup/kustomization.yaml b/config/redfish-mockups/components/go-mockup/kustomization.yaml deleted file mode 100644 index aaf34e7..0000000 --- a/config/redfish-mockups/components/go-mockup/kustomization.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1alpha1 -kind: Component - -resources: -- deployment.yaml -- service.yaml -- bmc.yaml -- bmcsecret.yaml - -images: -- name: mock-server - newName: mock-server - newTag: latest diff --git a/config/redfish-mockups/components/go-mockup/service.yaml b/config/redfish-mockups/components/go-mockup/service.yaml deleted file mode 100644 index 1faebe0..0000000 --- a/config/redfish-mockups/components/go-mockup/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: mockup -spec: - clusterIP: 10.96.200.20 - ports: - - port: 8000 - targetPort: 8000 - protocol: TCP - selector: - app.kubernetes.io/name: redfish-go-mockup - app.kubernetes.io/component: redfish-go-mockup diff --git a/config/redfish-mockups/components/mockup/bmc.yaml b/config/redfish-mockups/components/mockup/bmc.yaml deleted file mode 100644 index 8456d00..0000000 --- a/config/redfish-mockups/components/mockup/bmc.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: metal.ironcore.dev/v1alpha1 -kind: BMC -metadata: - name: mockup - labels: - app.kubernetes.io/name: redfish-mockup - app.kubernetes.io/component: redfish-mockup -spec: - bmcSecretRef: - name: PLACEHOLDER_BMC_SECRET_NAME - hostname: PLACEHOLDER_HOSTNAME - consoleProtocol: - name: SSH - port: 22 - access: - ip: PLACEHOLDER_BMC_IP - protocol: - name: Redfish - port: 8000 - scheme: https diff --git a/config/redfish-mockups/components/mockup/bmcsecret.yaml b/config/redfish-mockups/components/mockup/bmcsecret.yaml deleted file mode 100644 index 23ec99d..0000000 --- a/config/redfish-mockups/components/mockup/bmcsecret.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: metal.ironcore.dev/v1alpha1 -kind: BMCSecret -metadata: - name: mockup - labels: - app.kubernetes.io/name: redfish-mockup - app.kubernetes.io/component: redfish-mockup -stringData: - username: PLACEHOLDER_USERNAME - password: PLACEHOLDER_PASSWORD diff --git a/config/redfish-mockups/components/mockup/certificate.yaml b/config/redfish-mockups/components/mockup/certificate.yaml deleted file mode 100644 index f0667b5..0000000 --- a/config/redfish-mockups/components/mockup/certificate.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: tls - labels: - app.kubernetes.io/name: redfish-mockup - app.kubernetes.io/component: redfish-mockup -spec: - dnsNames: - - SERVICE_NAME.SERVICE_NAMESPACE.svc - - SERVICE_NAME.SERVICE_NAMESPACE.svc.cluster.local - issuerRef: - kind: Issuer - name: metal-operator-selfsigned-issuer - secretName: PLACEHOLDER_TLS_SECRET diff --git a/config/redfish-mockups/components/mockup/deployment.yaml b/config/redfish-mockups/components/mockup/deployment.yaml deleted file mode 100644 index b3105c3..0000000 --- a/config/redfish-mockups/components/mockup/deployment.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mockup - labels: - app.kubernetes.io/name: redfish-mockup - app.kubernetes.io/component: redfish-mockup -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: redfish-mockup - app.kubernetes.io/component: redfish-mockup - template: - metadata: - labels: - app.kubernetes.io/name: redfish-mockup - app.kubernetes.io/component: redfish-mockup - spec: - containers: - - name: mockup - image: docker.io/dmtf/redfish-mockup-server:latest - args: - - "-D" - - "/clients/PLACEHOLDER_CLIENT" - - "--ssl" - - "--cert" - - "/certs/tls.crt" - - "--key" - - "/certs/tls.key" - - "-p" - - "8000" - ports: - - containerPort: 8000 - volumeMounts: - - name: clients - mountPath: /clients - readOnly: true - - name: tls - mountPath: /certs - readOnly: true - livenessProbe: - httpGet: - path: /redfish/v1 - port: 8000 - scheme: HTTPS - initialDelaySeconds: 15 - periodSeconds: 10 - readinessProbe: - httpGet: - path: /redfish/v1 - port: 8000 - scheme: HTTPS - initialDelaySeconds: 5 - periodSeconds: 5 - volumes: - - name: clients - hostPath: - path: PLACEHOLDER_CLIENTS_MOUNT - type: Directory - - name: tls - secret: - secretName: PLACEHOLDER_TLS_SECRET diff --git a/config/redfish-mockups/components/mockup/kustomization.yaml b/config/redfish-mockups/components/mockup/kustomization.yaml deleted file mode 100644 index 49abbea..0000000 --- a/config/redfish-mockups/components/mockup/kustomization.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1alpha1 -kind: Component - -resources: -- deployment.yaml -- service.yaml -- certificate.yaml -- bmc.yaml -- bmcsecret.yaml diff --git a/config/redfish-mockups/components/mockup/service.yaml b/config/redfish-mockups/components/mockup/service.yaml deleted file mode 100644 index bd28501..0000000 --- a/config/redfish-mockups/components/mockup/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: mockup -spec: - clusterIP: 10.96.200.10 - ports: - - port: 8000 - targetPort: 8000 - protocol: TCP - selector: - app.kubernetes.io/name: redfish-mockup - app.kubernetes.io/component: redfish-mockup diff --git a/config/redfish-mockups/instances/basic-go/kustomization.yaml b/config/redfish-mockups/instances/basic-go/kustomization.yaml deleted file mode 100644 index dbe7fab..0000000 --- a/config/redfish-mockups/instances/basic-go/kustomization.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# Instance overlay for the iDRAC basic config Go mockup client. -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/go-mockup - -namePrefix: redfish-basic-go- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: basic-go - -patches: -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.25 -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/3 - value: /clients/iDRAC_mockup_client_basic_config/redfish/v1 - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-basic-go-mockup - - op: replace - path: /spec/hostname - value: dell-basic-go-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.25 -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar diff --git a/config/redfish-mockups/instances/basic/kustomization.yaml b/config/redfish-mockups/instances/basic/kustomization.yaml deleted file mode 100644 index d9e5eb6..0000000 --- a/config/redfish-mockups/instances/basic/kustomization.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Instance overlay for the iDRAC basic config mockup client. -# -# PLACEHOLDER_CLIENT -> /clients/iDRAC_mockup_client_basic_config -# PLACEHOLDER_CLIENTS_MOUNT -> /redfish-clients -# PLACEHOLDER_TLS_SECRET -> redfish-basic-tls -# PLACEHOLDER_BMC_SECRET_NAME -> redfish-basic-mockup -# PLACEHOLDER_HOSTNAME -> dell-basic-mockup -# PLACEHOLDER_BMC_IP -> 10.96.200.15 -# PLACEHOLDER_USERNAME / PLACEHOLDER_PASSWORD -> foo / bar -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/mockup - -namePrefix: redfish-basic- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: basic - -patches: -# Resolves PLACEHOLDER_BMC_IP (Service clusterIP) -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.15 -# Resolves PLACEHOLDER_CLIENT, PLACEHOLDER_CLIENTS_MOUNT, and -# PLACEHOLDER_TLS_SECRET -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/1 - value: /clients/iDRAC_mockup_client_basic_config - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients - - op: replace - path: /spec/template/spec/volumes/1/secret/secretName - value: redfish-basic-tls -# Resolves PLACEHOLDER_TLS_SECRET -- target: - kind: Certificate - name: tls - patch: |- - - op: replace - path: /spec/secretName - value: redfish-basic-tls -# Resolves BMC placeholders -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-basic-mockup - - op: replace - path: /spec/hostname - value: dell-basic-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.15 -# Resolves BMCSecret credential placeholders -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar - -replacements: -# Resolves SERVICE_NAME -- source: - kind: Service - name: mockup - fieldPath: metadata.name - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 0 - create: true -# Resolves SERVICE_NAMESPACE -- source: - kind: Service - name: mockup - fieldPath: metadata.namespace - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 1 - create: true diff --git a/config/redfish-mockups/instances/contoso-go/kustomization.yaml b/config/redfish-mockups/instances/contoso-go/kustomization.yaml deleted file mode 100644 index acff1bd..0000000 --- a/config/redfish-mockups/instances/contoso-go/kustomization.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# Instance overlay for the built-in Contoso Go mockup (embedded data). -# -# No -data flag and no hostPath mount -> the server uses its embedded -# Contoso Redfish data served at /redfish/v1 over HTTP. -# PLACEHOLDER_BMC_SECRET_NAME -> redfish-contoso-go-mockup -# PLACEHOLDER_HOSTNAME -> contoso-go-mockup -# PLACEHOLDER_BMC_IP -> 10.96.200.26 -# PLACEHOLDER_USERNAME / PLACEHOLDER_PASSWORD -> foo / bar -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/go-mockup - -namePrefix: redfish-contoso-go- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: contoso-go - -patches: -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.26 -- target: - kind: Deployment - name: mockup - patch: |- - - op: remove - path: /spec/template/spec/containers/0/args/3 - - op: remove - path: /spec/template/spec/containers/0/args/2 - - op: remove - path: /spec/template/spec/containers/0/volumeMounts - - op: remove - path: /spec/template/spec/volumes -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-contoso-go-mockup - - op: replace - path: /spec/hostname - value: contoso-go-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.26 -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar diff --git a/config/redfish-mockups/instances/gpu-dpu-go/kustomization.yaml b/config/redfish-mockups/instances/gpu-dpu-go/kustomization.yaml deleted file mode 100644 index 3a9d4b1..0000000 --- a/config/redfish-mockups/instances/gpu-dpu-go/kustomization.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# Instance overlay for the iDRAC GPU/DPU config Go mockup client. -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/go-mockup - -namePrefix: redfish-gpu-dpu-go- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: gpu-dpu-go - -patches: -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.24 -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/3 - value: /clients/iDRAC_mockup_client_GPU_DPU_config/redfish/v1 - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-gpu-dpu-go-mockup - - op: replace - path: /spec/hostname - value: dell-gpu-dpu-go-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.24 -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar diff --git a/config/redfish-mockups/instances/gpu-dpu/kustomization.yaml b/config/redfish-mockups/instances/gpu-dpu/kustomization.yaml deleted file mode 100644 index 1ef1af2..0000000 --- a/config/redfish-mockups/instances/gpu-dpu/kustomization.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Instance overlay for the iDRAC GPU/DPU config mockup client. -# -# PLACEHOLDER_CLIENT -> /clients/iDRAC_mockup_client_GPU_DPU_config -# PLACEHOLDER_CLIENTS_MOUNT -> /redfish-clients -# PLACEHOLDER_TLS_SECRET -> redfish-gpu-dpu-tls -# PLACEHOLDER_BMC_SECRET_NAME -> redfish-gpu-dpu-mockup -# PLACEHOLDER_HOSTNAME -> dell-gpu-dpu-mockup -# PLACEHOLDER_BMC_IP -> 10.96.200.14 -# PLACEHOLDER_USERNAME / PLACEHOLDER_PASSWORD -> foo / bar -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/mockup - -namePrefix: redfish-gpu-dpu- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: gpu-dpu - -patches: -# Resolves PLACEHOLDER_BMC_IP (Service clusterIP) -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.14 -# Resolves PLACEHOLDER_CLIENT, PLACEHOLDER_CLIENTS_MOUNT, and -# PLACEHOLDER_TLS_SECRET -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/1 - value: /clients/iDRAC_mockup_client_GPU_DPU_config - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients - - op: replace - path: /spec/template/spec/volumes/1/secret/secretName - value: redfish-gpu-dpu-tls -# Resolves PLACEHOLDER_TLS_SECRET -- target: - kind: Certificate - name: tls - patch: |- - - op: replace - path: /spec/secretName - value: redfish-gpu-dpu-tls -# Resolves BMC placeholders -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-gpu-dpu-mockup - - op: replace - path: /spec/hostname - value: dell-gpu-dpu-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.14 -# Resolves BMCSecret credential placeholders -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar - -replacements: -# Resolves SERVICE_NAME -- source: - kind: Service - name: mockup - fieldPath: metadata.name - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 0 - create: true -# Resolves SERVICE_NAMESPACE -- source: - kind: Service - name: mockup - fieldPath: metadata.namespace - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 1 - create: true diff --git a/config/redfish-mockups/instances/r660-go/kustomization.yaml b/config/redfish-mockups/instances/r660-go/kustomization.yaml deleted file mode 100644 index ac5d77d..0000000 --- a/config/redfish-mockups/instances/r660-go/kustomization.yaml +++ /dev/null @@ -1,64 +0,0 @@ -# Instance overlay for the R660xs iDRAC Go mockup client. -# -# -data path -> /clients/R660xs_iDRAC9_7_20_10_05_mockup_client/redfish/v1 -# PLACEHOLDER_CLIENTS_MOUNT -> /redfish-clients -# PLACEHOLDER_BMC_SECRET_NAME -> redfish-r660-go-mockup -# PLACEHOLDER_HOSTNAME -> dell-r660xs-go-mockup -# PLACEHOLDER_BMC_IP -> 10.96.200.20 -# PLACEHOLDER_USERNAME / PLACEHOLDER_PASSWORD -> foo / bar -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/go-mockup - -namePrefix: redfish-r660-go- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: r660-go - -patches: -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.20 -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/3 - value: /clients/R660xs_iDRAC9_7_20_10_05_mockup_client/redfish/v1 - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-r660-go-mockup - - op: replace - path: /spec/hostname - value: dell-r660xs-go-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.20 -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar diff --git a/config/redfish-mockups/instances/r660/kustomization.yaml b/config/redfish-mockups/instances/r660/kustomization.yaml deleted file mode 100644 index 86f3124..0000000 --- a/config/redfish-mockups/instances/r660/kustomization.yaml +++ /dev/null @@ -1,107 +0,0 @@ -# Instance overlay for the R660xs iDRAC mockup client. -# -# PLACEHOLDER_CLIENT -> /clients/R660xs_iDRAC9_7_20_10_05_mockup_client -# PLACEHOLDER_CLIENTS_MOUNT -> /redfish-clients -# PLACEHOLDER_TLS_SECRET -> redfish-r660-tls -# PLACEHOLDER_BMC_SECRET_NAME -> redfish-r660-mockup -# PLACEHOLDER_HOSTNAME -> dell-r660xs-mockup -# PLACEHOLDER_BMC_IP -> 10.96.200.10 -# PLACEHOLDER_USERNAME / PLACEHOLDER_PASSWORD -> foo / bar -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/mockup - -namePrefix: redfish-r660- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: r660 - -patches: -# Resolves PLACEHOLDER_CLIENT, PLACEHOLDER_CLIENTS_MOUNT, and -# PLACEHOLDER_TLS_SECRET -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/1 - value: /clients/R660xs_iDRAC9_7_20_10_05_mockup_client - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients - - op: replace - path: /spec/template/spec/volumes/1/secret/secretName - value: redfish-r660-tls -# Resolves PLACEHOLDER_TLS_SECRET -- target: - kind: Certificate - name: tls - patch: |- - - op: replace - path: /spec/secretName - value: redfish-r660-tls -# Resolves BMC placeholders -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-r660-mockup - - op: replace - path: /spec/hostname - value: dell-r660xs-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.10 -# Resolves BMCSecret credential placeholders -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar - -replacements: -# Resolves SERVICE_NAME -- source: - kind: Service - name: mockup - fieldPath: metadata.name - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 0 - create: true -# Resolves SERVICE_NAMESPACE -- source: - kind: Service - name: mockup - fieldPath: metadata.namespace - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 1 - create: true diff --git a/config/redfish-mockups/instances/r770-go/kustomization.yaml b/config/redfish-mockups/instances/r770-go/kustomization.yaml deleted file mode 100644 index 580e427..0000000 --- a/config/redfish-mockups/instances/r770-go/kustomization.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# Instance overlay for the R770 iDRAC Go mockup client. -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/go-mockup - -namePrefix: redfish-r770-go- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: r770-go - -patches: -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.21 -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/3 - value: /clients/R770_iDRAC10_1_10_17_00_mockup_client/redfish/v1 - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-r770-go-mockup - - op: replace - path: /spec/hostname - value: dell-r770-go-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.21 -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar diff --git a/config/redfish-mockups/instances/r770/kustomization.yaml b/config/redfish-mockups/instances/r770/kustomization.yaml deleted file mode 100644 index b177167..0000000 --- a/config/redfish-mockups/instances/r770/kustomization.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Instance overlay for the R770 iDRAC mockup client. -# -# PLACEHOLDER_CLIENT -> /clients/R770_iDRAC10_1_10_17_00_mockup_client -# PLACEHOLDER_CLIENTS_MOUNT -> /redfish-clients -# PLACEHOLDER_TLS_SECRET -> redfish-r770-tls -# PLACEHOLDER_BMC_SECRET_NAME -> redfish-r770-mockup -# PLACEHOLDER_HOSTNAME -> dell-r770-mockup -# PLACEHOLDER_BMC_IP -> 10.96.200.11 -# PLACEHOLDER_USERNAME / PLACEHOLDER_PASSWORD -> foo / bar -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/mockup - -namePrefix: redfish-r770- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: r770 - -patches: -# Resolves PLACEHOLDER_BMC_IP (Service clusterIP) -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.11 -# Resolves PLACEHOLDER_CLIENT, PLACEHOLDER_CLIENTS_MOUNT, and -# PLACEHOLDER_TLS_SECRET -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/1 - value: /clients/R770_iDRAC10_1_10_17_00_mockup_client - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients - - op: replace - path: /spec/template/spec/volumes/1/secret/secretName - value: redfish-r770-tls -# Resolves PLACEHOLDER_TLS_SECRET -- target: - kind: Certificate - name: tls - patch: |- - - op: replace - path: /spec/secretName - value: redfish-r770-tls -# Resolves BMC placeholders -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-r770-mockup - - op: replace - path: /spec/hostname - value: dell-r770-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.11 -# Resolves BMCSecret credential placeholders -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar - -replacements: -# Resolves SERVICE_NAME -- source: - kind: Service - name: mockup - fieldPath: metadata.name - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 0 - create: true -# Resolves SERVICE_NAMESPACE -- source: - kind: Service - name: mockup - fieldPath: metadata.namespace - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 1 - create: true diff --git a/config/redfish-mockups/instances/r7725-go/kustomization.yaml b/config/redfish-mockups/instances/r7725-go/kustomization.yaml deleted file mode 100644 index 2d979e7..0000000 --- a/config/redfish-mockups/instances/r7725-go/kustomization.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# Instance overlay for the R7725 iDRAC Go mockup client. -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/go-mockup - -namePrefix: redfish-r7725-go- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: r7725-go - -patches: -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.22 -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/3 - value: /clients/R7725_iDRAC10_1_20_70_50_mockup_client/redfish/v1 - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-r7725-go-mockup - - op: replace - path: /spec/hostname - value: dell-r7725-go-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.22 -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar diff --git a/config/redfish-mockups/instances/r7725/kustomization.yaml b/config/redfish-mockups/instances/r7725/kustomization.yaml deleted file mode 100644 index 7b4dc79..0000000 --- a/config/redfish-mockups/instances/r7725/kustomization.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Instance overlay for the R7725 iDRAC mockup client. -# -# PLACEHOLDER_CLIENT -> /clients/R7725_iDRAC10_1_20_70_50_mockup_client -# PLACEHOLDER_CLIENTS_MOUNT -> /redfish-clients -# PLACEHOLDER_TLS_SECRET -> redfish-r7725-tls -# PLACEHOLDER_BMC_SECRET_NAME -> redfish-r7725-mockup -# PLACEHOLDER_HOSTNAME -> dell-r7725-mockup -# PLACEHOLDER_BMC_IP -> 10.96.200.12 -# PLACEHOLDER_USERNAME / PLACEHOLDER_PASSWORD -> foo / bar -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/mockup - -namePrefix: redfish-r7725- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: r7725 - -patches: -# Resolves PLACEHOLDER_BMC_IP (Service clusterIP) -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.12 -# Resolves PLACEHOLDER_CLIENT, PLACEHOLDER_CLIENTS_MOUNT, and -# PLACEHOLDER_TLS_SECRET -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/1 - value: /clients/R7725_iDRAC10_1_20_70_50_mockup_client - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients - - op: replace - path: /spec/template/spec/volumes/1/secret/secretName - value: redfish-r7725-tls -# Resolves PLACEHOLDER_TLS_SECRET -- target: - kind: Certificate - name: tls - patch: |- - - op: replace - path: /spec/secretName - value: redfish-r7725-tls -# Resolves BMC placeholders -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-r7725-mockup - - op: replace - path: /spec/hostname - value: dell-r7725-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.12 -# Resolves BMCSecret credential placeholders -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar - -replacements: -# Resolves SERVICE_NAME -- source: - kind: Service - name: mockup - fieldPath: metadata.name - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 0 - create: true -# Resolves SERVICE_NAMESPACE -- source: - kind: Service - name: mockup - fieldPath: metadata.namespace - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 1 - create: true diff --git a/config/redfish-mockups/instances/xe9712-go/kustomization.yaml b/config/redfish-mockups/instances/xe9712-go/kustomization.yaml deleted file mode 100644 index 84e8b72..0000000 --- a/config/redfish-mockups/instances/xe9712-go/kustomization.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# Instance overlay for the XE9712 iDRAC Go mockup client. -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/go-mockup - -namePrefix: redfish-xe9712-go- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: xe9712-go - -patches: -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.23 -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/3 - value: /clients/XE9712_iDRAC10_1_30_07_10_mockup_client/redfish/v1 - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-xe9712-go-mockup - - op: replace - path: /spec/hostname - value: dell-xe9712-go-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.23 -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar diff --git a/config/redfish-mockups/instances/xe9712/kustomization.yaml b/config/redfish-mockups/instances/xe9712/kustomization.yaml deleted file mode 100644 index 9b7bb33..0000000 --- a/config/redfish-mockups/instances/xe9712/kustomization.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Instance overlay for the XE9712 iDRAC mockup client. -# -# PLACEHOLDER_CLIENT -> /clients/XE9712_iDRAC10_1_30_07_10_mockup_client -# PLACEHOLDER_CLIENTS_MOUNT -> /redfish-clients -# PLACEHOLDER_TLS_SECRET -> redfish-xe9712-tls -# PLACEHOLDER_BMC_SECRET_NAME -> redfish-xe9712-mockup -# PLACEHOLDER_HOSTNAME -> dell-xe9712-mockup -# PLACEHOLDER_BMC_IP -> 10.96.200.13 -# PLACEHOLDER_USERNAME / PLACEHOLDER_PASSWORD -> foo / bar -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: metal-operator-system - -components: -- ../../components/mockup - -namePrefix: redfish-xe9712- - -labels: -- includeSelectors: true - pairs: - app.kubernetes.io/instance: xe9712 - -patches: -# Resolves PLACEHOLDER_BMC_IP (Service clusterIP) -- target: - kind: Service - name: mockup - patch: |- - - op: replace - path: /spec/clusterIP - value: 10.96.200.13 -# Resolves PLACEHOLDER_CLIENT, PLACEHOLDER_CLIENTS_MOUNT, and -# PLACEHOLDER_TLS_SECRET -- target: - kind: Deployment - name: mockup - patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/1 - value: /clients/XE9712_iDRAC10_1_30_07_10_mockup_client - - op: replace - path: /spec/template/spec/volumes/0/hostPath/path - value: /redfish-clients - - op: replace - path: /spec/template/spec/volumes/1/secret/secretName - value: redfish-xe9712-tls -# Resolves PLACEHOLDER_TLS_SECRET -- target: - kind: Certificate - name: tls - patch: |- - - op: replace - path: /spec/secretName - value: redfish-xe9712-tls -# Resolves BMC placeholders -- target: - kind: BMC - name: mockup - patch: |- - - op: replace - path: /spec/bmcSecretRef/name - value: redfish-xe9712-mockup - - op: replace - path: /spec/hostname - value: dell-xe9712-mockup - - op: replace - path: /spec/access/ip - value: 10.96.200.13 -# Resolves BMCSecret credential placeholders -- target: - kind: BMCSecret - name: mockup - patch: |- - - op: replace - path: /stringData/username - value: foo - - op: replace - path: /stringData/password - value: bar - -replacements: -# Resolves SERVICE_NAME -- source: - kind: Service - name: mockup - fieldPath: metadata.name - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 0 - create: true -# Resolves SERVICE_NAMESPACE -- source: - kind: Service - name: mockup - fieldPath: metadata.namespace - targets: - - select: - kind: Certificate - name: tls - fieldPaths: - - spec.dnsNames.0 - - spec.dnsNames.1 - options: - delimiter: "." - index: 1 - create: true diff --git a/config/redfish-mockups/kustomization.yaml b/config/redfish-mockups/kustomization.yaml deleted file mode 100644 index b215ba1..0000000 --- a/config/redfish-mockups/kustomization.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -resources: -- instances/r660 -- instances/r770 -- instances/r7725 -- instances/xe9712 -- instances/gpu-dpu -- instances/basic -- instances/r660-go -- instances/r770-go -- instances/r7725-go -- instances/xe9712-go -- instances/gpu-dpu-go -- instances/basic-go -- instances/contoso-go diff --git a/environments.md b/environments.md deleted file mode 100644 index 30ca40d..0000000 --- a/environments.md +++ /dev/null @@ -1,26 +0,0 @@ -# Environments - -This repository contains virtualised or containerised infrastructure environments that mock or emulate physical BMC/server nodes. They don't relate to running tests against a custom BMC. - -Refer to the `make help` target in every environment's subdirectory for usage. - -## Supporting Environments - -### KIND environment -Manages a [kind](https://kind.sigs.k8s.io/) cluster to run the metal-operator and its dependencies. To simulate BMCs and Servers, it runs a Go-based Redfish mock server (a modified version of the metal-operator's `bmc/mock/main.go`) that supports using system-specific Redfish client mock data like the [DMTF mockup server](https://github.com/DMTF/Redfish-Mockup-Server) but additionally implements dynamic functions like simulating reboots. The server runs once per client data set, i.e. BMC. -To simulate booting Servers to run the `metalprobe` tool, a custom `boot-operator`-like implementation runs the `metalprobe` agent once per discovered `ServerBootConfiguration` and reports back bogus data. This works fine for simple tests. - -### Vagrant environment -Manages a [vagrant](https://developer.hashicorp.com/vagrant)-based environment that provides a network setup as close to a physical environment as possible. Its primary focus is to provide a reference setup for a physical lab. It supports development for scripts, Ansible playbooks etc. that can be used to set up actual infrastructure. It does not support running tests against its nodes. **Its current state is a work in progress. It can probably be replaced by a containerlab-based setup.** - -## Predefined values -Two predefined value files that point to the DMTF- or Go-based mock exist for the `kind`-environment: -- `infra/kind/values-basic-go.yaml` -- `infra/kind/values-contoso-go.yaml` - -## Caveats -### Dependencies on forks -#### Metal-operator -The `kind`-environment depends on two services that currently live in a [fork of the metal-operator](https://github.com/simontesar/metal-operator): -* A Go implementation of a [redfish mock server](https://github.com/simontesar/metal-operator/blob/dell/bmc/mock/main.go) that is included in the upstream metal-operator for testing but modified in the fork to support some dynamic features like `lastResetTime` and replaceable client mock data to be able to test against mocks of specific BMC models. -* The `metalprobe-mock-controller` that watches `ServerBootConfigurations` for BMC mocks and runs a `metalprobe` agent for every instance. It simulates a server controlled by the BMC mock booting up and running `metalprobe` to report to the metal-operator's registry. The reason it lives in the fork is that the `probe`-package of the metal-operator is internal. diff --git a/infra/kind/Makefile b/infra/kind/Makefile deleted file mode 100644 index 574fca2..0000000 --- a/infra/kind/Makefile +++ /dev/null @@ -1,159 +0,0 @@ -SHELL=/usr/bin/env bash - -# Always use the kubeconfig next to this Makefile so kind and kubectl -# targets share a cluster-local config and do not touch ~/.kube/config. -export KUBECONFIG := $(CURDIR)/kubeconfig.yaml - -KUSTOMIZE ?= kustomize -KUBECTL ?= kubectl - -KIND_CLUSTER_NAME ?= metal -REDFISH_CLIENTS_DIR ?= ../../redfish-mockup-clients - -METAL_OPERATOR_DIR ?= ../../../metal-operator -METAL_OPERATOR_STACK ?= ../../config/metal-operator -CERT_MANAGER_VERSION ?= v1.17.1 -CERT_MANAGER_MANIFEST ?= https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MANAGER_VERSION)/cert-manager.yaml -CONTROLLER_IMG ?= controller:latest -METALDATA_IMG ?= metaldata:latest -BMC_MOCK_SERVER_IMG ?= mock-server:latest -IMG ?= metalprobe-mock-controller:latest -METALPROBE_MOCK_CONTROLLER_BIN ?= $(METAL_OPERATOR_DIR)/bin/metalprobe-mock-controller -METALPROBE_MOCK_CONTROLLER_STACK ?= ../../config/metalprobe-mock-controller - -MOCKUP_INSTANCES := r660 r770 r7725 xe9712 gpu-dpu basic -GO_MOCKUP_INSTANCES := r660 r770 r7725 xe9712 gpu-dpu basic contoso -REDFISH_MOCKUPS_STACK ?= ../../config/redfish-mockups/instances - -.PHONY: help deploy destroy \ - kind-create kind-delete \ - download-redfish-mockup-clients \ - cert-manager-install cert-manager-wait \ - metal-operator-images metal-operator-deploy metal-operator-delete \ - metal-operator-deploy-wait \ - bmc-mock-server-docker-build bmc-mock-server-kind-load \ - metalprobe-mock-controller-build metalprobe-mock-controller-run \ - metalprobe-mock-controller-docker-build metalprobe-mock-controller-kind-load \ - metalprobe-mock-controller-apply metalprobe-mock-controller-delete \ - dmtf-mock-apply-all dmtf-mock-delete-all \ - go-mock-apply-all go-mock-delete-all - -define mockup_instance_targets -.PHONY: dmtf-mock-apply-$(1) -dmtf-mock-apply-$(1): ## Apply the $(1) DMTF Redfish mockup overlay - $(KUSTOMIZE) build $(REDFISH_MOCKUPS_STACK)/$(1) | $(KUBECTL) apply -f - - -.PHONY: dmtf-mock-delete-$(1) -dmtf-mock-delete-$(1): ## Delete the $(1) DMTF Redfish mockup overlay - $(KUSTOMIZE) build $(REDFISH_MOCKUPS_STACK)/$(1) | $(KUBECTL) delete -f - -endef - -define go_mockup_instance_targets -.PHONY: go-mock-apply-$(1) -go-mock-apply-$(1): ## Apply the $(1) Go Redfish mockup overlay - $(KUSTOMIZE) build $(REDFISH_MOCKUPS_STACK)/$(1)-go | $(KUBECTL) apply -f - - -.PHONY: go-mock-delete-$(1) -go-mock-delete-$(1): ## Delete the $(1) Go Redfish mockup overlay - $(KUSTOMIZE) build $(REDFISH_MOCKUPS_STACK)/$(1)-go | $(KUBECTL) delete -f - -endef - -$(foreach inst,$(MOCKUP_INSTANCES),$(eval $(call mockup_instance_targets,$(inst)))) -$(foreach inst,$(GO_MOCKUP_INSTANCES),$(eval $(call go_mockup_instance_targets,$(inst)))) - -help: ## Show available targets - @grep -E '^[a-zA-Z0-9_.-]+:.*##' $(MAKEFILE_LIST) | \ - awk 'BEGIN {FS = ":.*## "}; {printf " %-24s %s\n", $$1, $$2}' - -download-redfish-mockup-clients: ## Download and extract Dell iDRAC Redfish mockup client data - ./scripts/download-redfish-mockup-clients.sh $(REDFISH_CLIENTS_DIR) - -kind-create: download-redfish-mockup-clients ## Create the local kind cluster - @kind get clusters 2>/dev/null | grep -qx "$(KIND_CLUSTER_NAME)" || \ - printf 'kind: Cluster\napiVersion: kind.x-k8s.io/v1alpha4\nnodes:\n- role: control-plane\n extraMounts:\n - hostPath: %s\n containerPath: /redfish-clients\n readOnly: true\n' "$(REDFISH_CLIENTS_DIR)" | \ - kind create cluster --name $(KIND_CLUSTER_NAME) --config=- - -kind-delete: ## Destroy the local kind cluster - kind delete cluster --name $(KIND_CLUSTER_NAME) - rm -f $(KUBECONFIG) - -cert-manager-install: ## Install cert-manager from upstream release manifest - $(KUBECTL) apply -f $(CERT_MANAGER_MANIFEST) - -cert-manager-wait: ## Wait for cert-manager deployments to become available - @until $(KUBECTL) get ns cert-manager >/dev/null 2>&1; do \ - echo "Waiting for cert-manager namespace..."; sleep 5; \ - done - $(KUBECTL) wait --for=condition=Available \ - deployment/cert-manager -n cert-manager --timeout=300s - $(KUBECTL) wait --for=condition=Available \ - deployment/cert-manager-webhook -n cert-manager --timeout=300s - $(KUBECTL) wait --for=condition=Available \ - deployment/cert-manager-cainjector -n cert-manager --timeout=300s - -metal-operator-images: ## Build and load controller/metaldata images into Kind - $(MAKE) -C $(METAL_OPERATOR_DIR) docker-build \ - CONTROLLER_IMG=$(CONTROLLER_IMG) METALDATA_IMG=$(METALDATA_IMG) - kind load docker-image $(CONTROLLER_IMG) $(METALDATA_IMG) \ - --name $(KIND_CLUSTER_NAME) - -metal-operator-deploy: ## Deploy metal-operator via kustomize overlay - $(MAKE) -C $(METAL_OPERATOR_DIR) manifests - $(KUSTOMIZE) build $(METAL_OPERATOR_STACK) | $(KUBECTL) apply -f - - -metal-operator-delete: ## Delete metal-operator kustomize overlay - $(KUSTOMIZE) build $(METAL_OPERATOR_STACK) | \ - $(KUBECTL) delete -f - --ignore-not-found - -metal-operator-deploy-wait: ## Install cert-manager and metal-operator, then wait -metal-operator-deploy-wait: cert-manager-install cert-manager-wait \ - metal-operator-images metal-operator-deploy - @until $(KUBECTL) get ns metal-operator-system >/dev/null 2>&1; do \ - echo "Waiting for metal-operator-system namespace..."; sleep 5; \ - done - @until $(KUBECTL) -n metal-operator-system \ - get deploy metal-operator-controller-manager >/dev/null 2>&1; do \ - echo "Waiting for metal-operator deployment..."; sleep 5; \ - done - $(KUBECTL) wait --for=condition=Available \ - deployment/metal-operator-controller-manager \ - -n metal-operator-system --timeout=600s - -deploy: kind-create metal-operator-deploy-wait \ - bmc-mock-server-kind-load \ - metalprobe-mock-controller-kind-load metalprobe-mock-controller-apply \ - dmtf-mock-apply-all go-mock-apply-all ## Create the kind cluster, deploy metal-operator, and stand up all mocks - -destroy: kind-delete ## Tear down the kind cluster - -bmc-mock-server-docker-build: ## Build bmc-mock-server container image - cd $(METAL_OPERATOR_DIR) && docker build --target mock-server -t $(BMC_MOCK_SERVER_IMG) . - -bmc-mock-server-kind-load: bmc-mock-server-docker-build ## Load bmc-mock-server image into Kind - kind load docker-image $(BMC_MOCK_SERVER_IMG) --name $(KIND_CLUSTER_NAME) - -metalprobe-mock-controller-build: ## Build metalprobe-mock-controller binary in metal-operator - cd $(METAL_OPERATOR_DIR) && go build -o bin/metalprobe-mock-controller ./cmd/metalprobe-mock-controller - -metalprobe-mock-controller-run: metalprobe-mock-controller-build ## Run metalprobe-mock-controller locally - $(METALPROBE_MOCK_CONTROLLER_BIN) --registry-url=http://localhost:30000 - -metalprobe-mock-controller-docker-build: ## Build metalprobe-mock-controller container image - cd $(METAL_OPERATOR_DIR) && docker build -f Dockerfile.metalprobe-mock-controller -t $(IMG) . - -metalprobe-mock-controller-kind-load: metalprobe-mock-controller-docker-build ## Load image into Kind cluster - kind load docker-image $(IMG) --name $(KIND_CLUSTER_NAME) - -metalprobe-mock-controller-apply: ## Apply metalprobe-mock-controller to the cluster - $(KUSTOMIZE) build $(METALPROBE_MOCK_CONTROLLER_STACK) | $(KUBECTL) apply -f - - -metalprobe-mock-controller-delete: ## Delete metalprobe-mock-controller from the cluster - $(KUSTOMIZE) build $(METALPROBE_MOCK_CONTROLLER_STACK) | $(KUBECTL) delete -f - - -dmtf-mock-apply-all: $(addprefix dmtf-mock-apply-,$(MOCKUP_INSTANCES)) ## Apply all registered DMTF mockup overlays - -dmtf-mock-delete-all: $(addprefix dmtf-mock-delete-,$(MOCKUP_INSTANCES)) ## Delete all registered DMTF mockup overlays - -go-mock-apply-all: $(addprefix go-mock-apply-,$(GO_MOCKUP_INSTANCES)) ## Apply all registered Go mockup overlays - -go-mock-delete-all: $(addprefix go-mock-delete-,$(GO_MOCKUP_INSTANCES)) ## Delete all registered Go mockup overlays diff --git a/infra/kind/README.md b/infra/kind/README.md deleted file mode 100644 index 7d78ac7..0000000 --- a/infra/kind/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# Kind environment -The kind-based setup runs the following services in the cluster itself: -* The metal-operator, including its BMC mock server with the embedded "contoso" data -* One instance of the python-based [DMTF Redfish Mockup server](https://github.com/DMTF/Redfish-Mockup-Server) for every set of Dell client data -* One instance of the modified metal-operator BMC mock server for every set of Dell client data -* The `metalprobe-mock-controller` that simulates booting for a theoretical server attached to every BMC mock server by watching for `ServerBootConfigurations` and starting a `metalprobe` agent for every instance to mimic a real server reporting back data to the metal-operator's registry - -By default one BMC resource for every Dell mock server instance is created in the cluster. - -## Usage -Deploy and inspect the complete setup: -``` -$ make deploy -… -$ export KUBECONFIG=$PWD/kubeconfig.yaml -$ kubectl get pods -A -NAMESPACE NAME READY STATUS RESTARTS AGE -cert-manager cert-manager-84b68949d9-8mwjj 1/1 Running 0 6m20s -cert-manager cert-manager-cainjector-77cb85f745-d48lt 1/1 Running 0 6m20s -cert-manager cert-manager-webhook-967c999c4-pvncs 1/1 Running 0 6m20s -kube-system coredns-589f44dc88-2nx6r 1/1 Running 0 6m20s -kube-system coredns-589f44dc88-grss8 1/1 Running 0 6m20s -kube-system etcd-metal-control-plane 1/1 Running 0 6m26s -kube-system kindnet-rcmnq 1/1 Running 0 6m20s -kube-system kube-apiserver-metal-control-plane 1/1 Running 0 6m27s -kube-system kube-controller-manager-metal-control-plane 1/1 Running 0 6m26s -kube-system kube-proxy-d6jzp 1/1 Running 0 6m20s -kube-system kube-scheduler-metal-control-plane 1/1 Running 0 6m27s -local-path-storage local-path-provisioner-855c7b7774-wfff7 1/1 Running 0 6m20s -metal-operator-system metal-operator-controller-manager-789b89587c-5j5bl 1/1 Running 0 4m7s -metal-operator-system metal-operator-metaldata-p48cb 1/1 Running 0 4m7s -metal-operator-system metalprobe-mock-controller-6f74c7bf58-dr2g4 1/1 Running 0 2m41s -metal-operator-system redfish-basic-go-mockup-784b67c45c-gbc6s 1/1 Running 0 2m39s -metal-operator-system redfish-basic-mockup-5c894b4cf8-9h675 1/1 Running 0 2m40s -metal-operator-system redfish-contoso-go-mockup-b94dd58-h9lm6 1/1 Running 0 2m38s -metal-operator-system redfish-gpu-dpu-go-mockup-dd99754c9-c78hh 1/1 Running 0 2m39s -metal-operator-system redfish-gpu-dpu-mockup-7b6fb4898b-p9mf2 1/1 Running 0 2m40s -metal-operator-system redfish-r660-go-mockup-64857469b7-9dsxj 1/1 Running 0 2m40s -metal-operator-system redfish-r660-mockup-555d84fb5d-xl49v 1/1 Running 0 2m41s -metal-operator-system redfish-r770-go-mockup-7bff6db8cc-l7vdv 1/1 Running 0 2m39s -metal-operator-system redfish-r770-mockup-74b987985b-7bps6 1/1 Running 0 2m41s -metal-operator-system redfish-r7725-go-mockup-687bf85694-d7bf6 1/1 Running 0 2m39s -metal-operator-system redfish-r7725-mockup-6c7f949c98-bhr4m 1/1 Running 0 2m40s -metal-operator-system redfish-xe9712-go-mockup-6d5849ddbf-8jg7k 1/1 Running 0 2m39s -metal-operator-system redfish-xe9712-mockup-966fb558d-zvp5k 1/1 Running 0 2m40s -$ kubectl get bmc -NAME MACADDRESS IP MODEL STATE POWERSTATE AGE -redfish-basic-go-mockup 10.96.200.25 15G Monolithic Enabled On 3m -redfish-basic-mockup 10.96.200.15 15G Monolithic Enabled On 3m1s -redfish-contoso-go-mockup 10.96.200.26 Joo Janta 200 Enabled On 2m59s -redfish-gpu-dpu-go-mockup 10.96.200.24 16G Monolithic Enabled On 3m -redfish-gpu-dpu-mockup 10.96.200.14 16G Monolithic Enabled On 3m1s -redfish-r660-go-mockup 10.96.200.20 16G Monolithic Enabled On 3m1s -redfish-r660-mockup 10.96.200.10 16G Monolithic Enabled On 3m2s -redfish-r770-go-mockup 10.96.200.21 17G Monolithic Enabled On 3m -redfish-r770-mockup 10.96.200.11 17G Monolithic Enabled On 3m2s -redfish-r7725-go-mockup 10.96.200.22 17G Monolithic Enabled On 3m -redfish-r7725-mockup 10.96.200.12 17G Monolithic Enabled On 3m1s -redfish-xe9712-go-mockup 10.96.200.23 17G Monolithic Enabled On 3m -redfish-xe9712-mockup 10.96.200.13 17G Monolithic Enabled On 3m1s -``` - -Run a test against the basic go instance: -```shell -$ cd ../.. -$ export KUBECONFIG=$PWD/kubeconfig.yaml -$ make test/03-power-annotation VALUES=infra/kind/values-basic-go.yaml CHAINSAW_EXTRA_FLAGS="--pause-on-failure" -``` - -Tear down: -```shell -$ cd - -$ make kind-delete -``` \ No newline at end of file diff --git a/infra/kind/scripts/download-redfish-mockup-clients.sh b/infra/kind/scripts/download-redfish-mockup-clients.sh deleted file mode 100755 index 9a27255..0000000 --- a/infra/kind/scripts/download-redfish-mockup-clients.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -# Downloads and extracts Dell's iDRAC Redfish mockup client data -set -euo pipefail - -TARGET_DIR="${1:-../../redfish-mockup-clients}" - -REPO_RAW_BASE="https://raw.githubusercontent.com/dell/iDRAC-Redfish-Scripting/master/iDRAC%20Redfish%20Mockup%20Clients" - -CLIENTS=( - R660xs_iDRAC9_7_20_10_05_mockup_client - R770_iDRAC10_1_10_17_00_mockup_client - R7725_iDRAC10_1_20_70_50_mockup_client - XE9712_iDRAC10_1_30_07_10_mockup_client - iDRAC_mockup_client_GPU_DPU_config - iDRAC_mockup_client_basic_config -) - -command -v curl >/dev/null || { echo "curl is required" >&2; exit 1; } -command -v unzip >/dev/null || { echo "unzip is required" >&2; exit 1; } - -mkdir -p "${TARGET_DIR}" - -TMP_DIR="$(mktemp -d)" -trap 'rm -rf "${TMP_DIR}"' EXIT - -for client in "${CLIENTS[@]}"; do - if [[ -d "${TARGET_DIR}/${client}" ]]; then - echo "Skipping ${client} (already present in ${TARGET_DIR})" - continue - fi - - echo "Downloading ${client}.zip" - curl -fsSL -o "${TMP_DIR}/${client}.zip" "${REPO_RAW_BASE}/${client}.zip" - - echo "Extracting ${client}.zip into ${TARGET_DIR}" - unzip -q "${TMP_DIR}/${client}.zip" -d "${TARGET_DIR}" - rm -f "${TMP_DIR}/${client}.zip" -done - -echo "Redfish mockup clients ready in ${TARGET_DIR}" diff --git a/infra/kind/values-basic-go.yaml b/infra/kind/values-basic-go.yaml deleted file mode 100644 index 0e57169..0000000 --- a/infra/kind/values-basic-go.yaml +++ /dev/null @@ -1,9 +0,0 @@ -bmcIP: "10.96.200.25" -bmcPort: 8000 -bmcScheme: http -username: foo -password: bar -firmwareVersion: "7.10.30.00" -01-bmc-registration: - model: "15G Monolithic" - powerState: "On" diff --git a/infra/kind/values-contoso-go.yaml b/infra/kind/values-contoso-go.yaml deleted file mode 100644 index 329782a..0000000 --- a/infra/kind/values-contoso-go.yaml +++ /dev/null @@ -1,9 +0,0 @@ -bmcIP: "10.96.200.26" -bmcPort: 8000 -bmcScheme: http -username: foo -password: bar -firmwareVersion: "1.45.455b66-rev4" -01-bmc-registration: - model: "Joo Janta 200" - powerState: "On" diff --git a/infra/local/.env b/infra/local/.env deleted file mode 100644 index e969612..0000000 --- a/infra/local/.env +++ /dev/null @@ -1,12 +0,0 @@ -# Parent device for VLAN subinterfaces and master's trunk bridge. -PARENT_IF=dummy0 - -# Host VLAN interfaces created by setup-host-vlans.sh -VLAN100_BRIDGE=vlan0 -VLAN200_BRIDGE=vlan1 - -# Upstream networks for master's IB/OOB uplinks -UPSTREAM_IB_BRIDGE=dummy0 -UPSTREAM_OOB_BRIDGE=dummy0 - -TRUNK_BRIDGE=dummy0 diff --git a/infra/local/.envrc b/infra/local/.envrc deleted file mode 100644 index 72d0910..0000000 --- a/infra/local/.envrc +++ /dev/null @@ -1,3 +0,0 @@ -dotenv - -export KUBECONFIG=$PWD/kubeconfig diff --git a/infra/local/.gitignore b/infra/local/.gitignore deleted file mode 100644 index ee08860..0000000 --- a/infra/local/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -inventory - diff --git a/infra/local/Makefile b/infra/local/Makefile deleted file mode 100644 index 952a476..0000000 --- a/infra/local/Makefile +++ /dev/null @@ -1,75 +0,0 @@ -KUBECONFIG ?= $(CURDIR)/kubeconfig -KUSTOMIZE ?= kustomize -KUBECTL ?= kubectl - -METAL_OPERATOR_DIR ?= ../../../metal-operator -METAL_OPERATOR_STACK ?= ../../config/metal-operator -CERT_MANAGER_VERSION ?= v1.17.1 -CERT_MANAGER_MANIFEST ?= https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MANAGER_VERSION)/cert-manager.yaml -CONTROLLER_IMG ?= controller:latest -METALDATA_IMG ?= metaldata:latest - -.PHONY: help host-vlans host-vlans-clean up-master up-workers up destroy clean \ - cert-manager-install cert-manager-wait \ - metal-operator-images metal-operator-deploy metal-operator-delete \ - metal-operator-deploy-wait - -help: ## Show available targets - @grep -E '^[a-zA-Z0-9_.-]+:.*##' $(MAKEFILE_LIST) | \ - awk 'BEGIN {FS = ":.*## "}; {printf " %-24s %s\n", $$1, $$2}' - -host-vlans: ## Create host VLAN interfaces - ./scripts/setup-host-vlans.sh create - -host-vlans-clean: ## Remove host VLAN interfaces - ./scripts/setup-host-vlans.sh cleanup - -up-master: ## Start master VM (network + k3s via host trigger) - vagrant up master - -up-workers: ## Start node1 and node2 VMs - vagrant up node1 node2 - -up: host-vlans up-master up-workers ## Bring up full lab environment - -destroy: ## Destroy all VMs - vagrant destroy -f - -clean: destroy host-vlans-clean ## Destroy VMs and remove host VLANs - -cert-manager-install: ## Install cert-manager from upstream release manifest - KUBECONFIG=$(KUBECONFIG) $(KUBECTL) apply -f $(CERT_MANAGER_MANIFEST) - -cert-manager-wait: ## Wait for cert-manager deployments to become available - @until KUBECONFIG=$(KUBECONFIG) $(KUBECTL) get ns cert-manager >/dev/null 2>&1; do \ - echo "Waiting for cert-manager namespace..."; sleep 5; \ - done - KUBECONFIG=$(KUBECONFIG) $(KUBECTL) wait --for=condition=Available \ - deployment/cert-manager -n cert-manager --timeout=300s - KUBECONFIG=$(KUBECONFIG) $(KUBECTL) wait --for=condition=Available \ - deployment/cert-manager-webhook -n cert-manager --timeout=300s - KUBECONFIG=$(KUBECONFIG) $(KUBECTL) wait --for=condition=Available \ - deployment/cert-manager-cainjector -n cert-manager --timeout=300s - -metal-operator-images: ## Build controller/metaldata images (import into k3s separately) - $(MAKE) -C $(METAL_OPERATOR_DIR) docker-build \ - CONTROLLER_IMG=$(CONTROLLER_IMG) METALDATA_IMG=$(METALDATA_IMG) - -metal-operator-deploy: ## Deploy metal-operator via kustomize overlay - $(MAKE) -C $(METAL_OPERATOR_DIR) manifests - KUBECONFIG=$(KUBECONFIG) $(KUSTOMIZE) build $(METAL_OPERATOR_STACK) | \ - KUBECONFIG=$(KUBECONFIG) $(KUBECTL) apply -f - - -metal-operator-delete: ## Delete metal-operator kustomize overlay - KUBECONFIG=$(KUBECONFIG) $(KUSTOMIZE) build $(METAL_OPERATOR_STACK) | \ - KUBECONFIG=$(KUBECONFIG) $(KUBECTL) delete -f - --ignore-not-found - -metal-operator-deploy-wait: ## Install cert-manager and metal-operator, then wait -metal-operator-deploy-wait: cert-manager-install cert-manager-wait \ - metal-operator-images metal-operator-deploy - @until KUBECONFIG=$(KUBECONFIG) $(KUBECTL) get ns metal-operator-system >/dev/null 2>&1; do \ - echo "Waiting for metal-operator-system namespace..."; sleep 5; \ - done - KUBECONFIG=$(KUBECONFIG) $(KUBECTL) wait --for=condition=Available \ - deployment/metal-operator-controller-manager \ - -n metal-operator-system --timeout=600s diff --git a/infra/local/README.md b/infra/local/README.md deleted file mode 100644 index 7eb8322..0000000 --- a/infra/local/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Local environment -The local `vagrant`-based environment's goal is to serve as a reference for a physical testing lab. It supports development for scripts, ansible playbooks etc. that can be used to setup actual infrastructure. It does not support running tests against its nodes. **Its current state is a work in progress. It can probably be replaced by a separate containerlab setup or by modifying the existing containerlab setup to use manual k8s installation.** - -It requires `libvirt`/`kvm`. - -## Usage -```shell -$ make up -… -``` - -## Network architecture - -![Network architecture](network-architecture.drawio.png) diff --git a/infra/local/Vagrantfile b/infra/local/Vagrantfile deleted file mode 100644 index fe17026..0000000 --- a/infra/local/Vagrantfile +++ /dev/null @@ -1,83 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : -# -# Boot order: provision master before workers so dnsmasq is ready for DHCP. -# vagrant up master && vagrant up node1 node2 - -parent_if = ENV.fetch("PARENT_IF", "dummy0") - -bridges = { - vlan100: ENV.fetch("VLAN100_BRIDGE", "vlan0"), - vlan200: ENV.fetch("VLAN200_BRIDGE", "vlan1"), - upstream_ib: ENV.fetch("UPSTREAM_IB_BRIDGE", parent_if), - upstream_oob: ENV.fetch("UPSTREAM_OOB_BRIDGE", parent_if), - trunk: ENV.fetch("TRUNK_BRIDGE", parent_if), -} - -Vagrant.configure("2") do |config| - config.vm.box = "bento/ubuntu-24.04" - - config.vm.define "master" do |master| - master.vm.hostname = "master" - master.vm.provider "libvirt" do |lv| - lv.memory = 4096 - lv.cpus = 2 - end - master.vm.network "public_network", - dev: bridges[:upstream_ib], - mode: "bridge", - auto_config: false - master.vm.network "public_network", - dev: bridges[:upstream_oob], - mode: "bridge", - auto_config: false - master.vm.network "public_network", - dev: bridges[:trunk], - mode: "bridge", - auto_config: false - master.vm.provision "shell", path: "scripts/provision-master.sh" - - master.trigger.after :up do |trigger| - trigger.name = "k3s" - trigger.run = { path: "scripts/provision-k3s.sh" } - end - end - - config.vm.define "node1" do |node1| - node1.vm.hostname = "node1" - node1.vm.provider "libvirt" do |lv| - lv.memory = 1024 - lv.cpus = 1 - end - node1.vm.network "public_network", - dev: bridges[:vlan100], - mode: "bridge", - mac: "02:00:64:00:01:01", - auto_config: false - node1.vm.network "public_network", - dev: bridges[:vlan200], - mode: "bridge", - mac: "02:00:c8:00:01:01", - auto_config: false - node1.vm.provision "shell", path: "scripts/provision-node.sh" - end - - config.vm.define "node2" do |node2| - node2.vm.hostname = "node2" - node2.vm.provider "libvirt" do |lv| - lv.memory = 1024 - lv.cpus = 1 - end - node2.vm.network "public_network", - dev: bridges[:vlan100], - mode: "bridge", - mac: "02:00:64:00:02:01", - auto_config: false - node2.vm.network "public_network", - dev: bridges[:vlan200], - mode: "bridge", - mac: "02:00:c8:00:02:01", - auto_config: false - node2.vm.provision "shell", path: "scripts/provision-node.sh" - end -end diff --git a/infra/local/group_vars/master.yaml b/infra/local/group_vars/master.yaml deleted file mode 100644 index 9e3f00c..0000000 --- a/infra/local/group_vars/master.yaml +++ /dev/null @@ -1,15 +0,0 @@ -dnsmasq_trunk_interface: eth3 - -dnsmasq_static_leases: - - mac: "02:00:64:00:01:01" - ip: 172.16.100.11 - hostname: node1-idrac - - mac: "02:00:c8:00:01:01" - ip: 10.250.200.11 - hostname: node1-nic1 - - mac: "02:00:64:00:02:01" - ip: 172.16.100.12 - hostname: node2-idrac - - mac: "02:00:c8:00:02:01" - ip: 10.250.200.12 - hostname: node2-nic1 diff --git a/infra/local/network-architecture.drawio.png b/infra/local/network-architecture.drawio.png deleted file mode 100644 index 473bc0f..0000000 Binary files a/infra/local/network-architecture.drawio.png and /dev/null differ diff --git a/infra/local/scripts/provision-k3s.sh b/infra/local/scripts/provision-k3s.sh deleted file mode 100755 index 2c33724..0000000 --- a/infra/local/scripts/provision-k3s.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -cd "$(dirname "$0")/.." -ENV_DIR="$(pwd)" - -SSH_CONFIG=$(vagrant ssh-config master) -MASTER_IP=$(awk '/HostName/ { print $2 }' <<<"${SSH_CONFIG}") -MASTER_KEY=$(awk '/IdentityFile/ { print $2 }' <<<"${SSH_CONFIG}") - -if [[ -z "${MASTER_IP}" || -z "${MASTER_KEY}" ]]; then - echo "Could not determine master IP/private key from vagrant ssh-config" >&2 - exit 1 -fi - -cat > inventory <&2 - exit 1 -fi - -UPSTREAM_IB="${IFACES[1]}" -UPSTREAM_OOB="${IFACES[2]}" -TRUNK_IF="${IFACES[3]}" - -cat > /etc/netplan/60-master-network.yaml <&2 - exit 1 -fi - -IDRAC_IF="${IFACES[1]}" -NIC1_IF="${IFACES[2]}" - -cat > /etc/netplan/60-node-network.yaml </dev/null 2>&1; then - echo "Parent interface ${PARENT_IF} already exists, skipping create" - return 0 - fi - - if [[ "${PARENT_IF}" != dummy* ]]; then - echo "Parent interface ${PARENT_IF} not found and is not a dummy device (refusing to auto-create a real NIC)" >&2 - exit 1 - fi - - sudo ip link add "${PARENT_IF}" type dummy - sudo ip link set "${PARENT_IF}" up - echo "Created dummy parent ${PARENT_IF}" -} - -create_vlan() { - local iface="$1" - local vlan_id="$2" - local parent="$3" - - if ip link show "${iface}" >/dev/null 2>&1; then - echo "Interface ${iface} already exists, skipping create" - return 0 - fi - - sudo ip link add link "${parent}" name "${iface}" type vlan id "${vlan_id}" - sudo ip link set "${iface}" up - echo "Created ${iface} (VLAN ${vlan_id} on ${parent})" -} - -create_vlans() { - ensure_parent - create_vlan "${VLAN100_BRIDGE}" "${VLAN100_ID}" "${PARENT_IF}" - create_vlan "${VLAN200_BRIDGE}" "${VLAN200_ID}" "${PARENT_IF}" -} - -cleanup_host_interfaces() { - local destroyed=0 - local skipped=0 - - for iface in "${VLAN100_BRIDGE}" "${VLAN200_BRIDGE}"; do - if ip link show "${iface}" >/dev/null 2>&1; then - sudo ip link delete "${iface}" - echo "Destroyed ${iface}" - destroyed=$((destroyed + 1)) - else - echo "Skipped ${iface} (not present)" - skipped=$((skipped + 1)) - fi - done - - if [[ "${PARENT_IF}" == dummy* ]] && ip link show "${PARENT_IF}" >/dev/null 2>&1; then - sudo ip link delete "${PARENT_IF}" - echo "Destroyed dummy parent ${PARENT_IF}" - destroyed=$((destroyed + 1)) - fi - - echo "Cleanup complete: ${destroyed} destroyed, ${skipped} skipped" -} - -case "${1:-create}" in - create) - create_vlans - ;; - cleanup) - cleanup_host_interfaces - ;; - *) - echo "Usage: $0 [create|cleanup]" >&2 - exit 1 - ;; -esac diff --git a/infra/playbooks/group_vars/all.yml b/infra/playbooks/group_vars/all.yml deleted file mode 100644 index dd007aa..0000000 --- a/infra/playbooks/group_vars/all.yml +++ /dev/null @@ -1,2 +0,0 @@ -# Trunk NIC for VLAN subinterfaces; override per environment. -dnsmasq_trunk_interface: "" diff --git a/infra/playbooks/master.yaml b/infra/playbooks/master.yaml deleted file mode 100644 index ef637ca..0000000 --- a/infra/playbooks/master.yaml +++ /dev/null @@ -1,103 +0,0 @@ ---- -- name: Configure master node - hosts: master - become: true - vars: - k3s_bind_address: "0.0.0.0" - k3s_install_exec: >- - server --bind-address {{ k3s_bind_address }} - --tls-san {{ ansible_host }} - --write-kubeconfig-mode 644 - - tasks: - - name: Require dnsmasq trunk interface - ansible.builtin.assert: - that: - - dnsmasq_trunk_interface | length > 0 - fail_msg: >- - Set dnsmasq_trunk_interface in environment group_vars. - tags: dnsmasq - - - name: Install dnsmasq - ansible.builtin.apt: - name: dnsmasq - state: present - update_cache: true - tags: dnsmasq - - - name: Deploy dhcp.conf - ansible.builtin.template: - src: templates/dhcp.conf.j2 - dest: /etc/dnsmasq.d/dhcp.conf - mode: "0644" - notify: Restart dnsmasq - tags: dnsmasq - - - name: Enable and start dnsmasq - ansible.builtin.systemd: - name: dnsmasq - enabled: true - state: started - tags: dnsmasq - - - name: Install k3s dependencies - ansible.builtin.apt: - name: - - curl - - ca-certificates - state: present - update_cache: true - tags: k3s - - - name: Install k3s server - ansible.builtin.shell: curl -sfL https://get.k3s.io | sh - - environment: - INSTALL_K3S_EXEC: "{{ k3s_install_exec }}" - args: - creates: /usr/local/bin/k3s - executable: /bin/bash - tags: k3s - - - name: Enable and start k3s - ansible.builtin.systemd: - name: k3s - enabled: true - state: started - tags: k3s - - - name: Wait for k3s node to be Ready - ansible.builtin.command: k3s kubectl get nodes - register: k3s_nodes - until: k3s_nodes.stdout is search(' Ready ') - retries: 12 - delay: 10 - changed_when: false - tags: k3s - - - name: Allow non-root read of k3s kubeconfig - ansible.builtin.file: - path: /etc/rancher/k3s/k3s.yaml - mode: "0644" - tags: k3s - - - name: Fetch kubeconfig to host - ansible.builtin.fetch: - src: /etc/rancher/k3s/k3s.yaml - dest: "{{ kubeconfig_dest }}" - flat: true - tags: k3s - - - name: Rewrite server address for host access - ansible.builtin.replace: - path: "{{ kubeconfig_dest }}" - regexp: 'server: https://[^:]+:6443' - replace: "server: https://{{ ansible_host }}:6443" - delegate_to: localhost - become: false - tags: k3s - - handlers: - - name: Restart dnsmasq - ansible.builtin.systemd: - name: dnsmasq - state: restarted diff --git a/infra/playbooks/templates/dhcp.conf.j2 b/infra/playbooks/templates/dhcp.conf.j2 deleted file mode 100644 index a4f83ec..0000000 --- a/infra/playbooks/templates/dhcp.conf.j2 +++ /dev/null @@ -1,16 +0,0 @@ -# DHCP only; systemd-resolved owns port 53 on Ubuntu. -port=0 -interface={{ dnsmasq_trunk_interface }}.100 -interface={{ dnsmasq_trunk_interface }}.200 -bind-interfaces -except-interface=lo - -dhcp-range=set:oob,172.16.100.0,static -dhcp-range=set:ib,10.250.200.0,static - -{% for lease in dnsmasq_static_leases %} -dhcp-host={{ lease.mac }},{{ lease.ip }},{{ lease.hostname }},infinite -{% endfor %} - -dhcp-option=tag:oob,option:router,172.16.100.1 -dhcp-option=tag:ib,option:router,10.250.200.1 diff --git a/redfish-mockup-clients/.gitkeep b/redfish-mockup-clients/.gitkeep deleted file mode 100644 index e69de29..0000000