### Include Getting Started Partial Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/themes/sonobuoy/layouts/_default/baseof.html Includes the 'getting-started' partial template, likely for introductory or setup instructions. ```go-html-template {{ partial "getting-started" . }} ``` -------------------------------- ### Build and Serve Site Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/README.md Start the Hugo development server with fast rendering disabled. ```bash hugo server --disableFastRender ``` -------------------------------- ### Install a Sonobuoy Plugin Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-10-13-plugin-management.md Use this command to install a custom plugin. Specify a local filename and the source (file path or URL). The local filename does not need to match the plugin name, allowing multiple configurations for the same plugin. ```bash $ sonobuoy plugin install myPerfectPlugin ./tmp/pluginCode.yaml Installed plugin customPlugin into file /Users/jschnake/.sonobuoy/myPerfectPlugin.yaml from source tmp/pluginCode.yaml ``` -------------------------------- ### List Installed Sonobuoy Plugins Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-10-13-plugin-management.md View a list of all locally installed plugins. The output includes the filename for invocation, the plugin name, the source URL (if available), and a description. ```bash $ sonobuoy plugins list filename: /Users/jschnake/.sonobuoy/myPerfectPlugin.yaml plugin name: myPlugin source URL: www.example.com/some-plugin-source.yaml description: Details about what the plugin does. ``` -------------------------------- ### Run an Installed Sonobuoy Plugin Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-10-13-plugin-management.md Execute an installed plugin by specifying its local filename. Multiple installed plugins or external sources can be run simultaneously. ```bash $ sonobuoy run -p myPerfectPlugin ``` ```bash $ sonobuoy run -p myPerfectPlugin -p e2e -p example.com/raw/yourPlugin.yaml ``` -------------------------------- ### Example ConfigMap for plug-in definition Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-09-16-customizing-plugin-podspecs.md A sample ConfigMap structure showing how a plug-in definition and PodSpec are loaded into the Sonobuoy aggregator. ```yaml --- apiVersion: v1 data: plugin-0.yaml: | podSpec: containers: [] dnsPolicy: ClusterFirstWithHostNet hostIPC: true hostNetwork: true hostPID: true serviceAccountName: sonobuoy-serviceaccount tolerations: - operator: Exists volumes: - hostPath: path: / name: root sonobuoy-config: driver: DaemonSet plugin-name: my-plugin result-type: my-plugin spec: command: - ./run.sh image: my-plugin:v1 name: plugin resources: {} volumeMounts: - mountPath: /tmp/results name: results kind: ConfigMap metadata: labels: component: sonobuoy name: sonobuoy-plugins-cm namespace: sonobuoy ``` -------------------------------- ### Sonobuoy E2E Plugin Running Status Example Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-12-06-Conformance-Testing-With-Progress-Updates.md Example JSON output from 'sonobuoy status --json' showing the 'e2e' plugin is running. It includes progress details like total tests, completed tests, and the last test message. ```json { "plugin": "e2e", "node": "global", "status": "running", "result-status": "", "result-counts": null, "progress": { "name": "e2e", "node": "global", "timestamp": "2019-11-25T17:21:32.5456932Z", "msg": "PASSED [sig-storage] HostPath should give a volume the correct mode [LinuxOnly] [NodeConformance] [Conformance]", "total": 278, "completed": 2 } } ``` -------------------------------- ### Install Sonobuoy CLI Source: https://context7.com/vmware-tanzu/sonobuoy/llms.txt Commands to install Sonobuoy via Homebrew or by downloading the binary release for Linux/macOS. ```bash # Install via Homebrew (macOS) brew install sonobuoy # Or download and extract the binary (Linux/macOS) wget https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.57.4/sonobuoy_0.57.4_linux_amd64.tar.gz tar -xvf sonobuoy_0.57.4_linux_amd64.tar.gz sudo mv sonobuoy /usr/local/bin/ # Verify installation sonobuoy version ``` -------------------------------- ### Start Sonobuoy Conformance Run Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-12-06-Conformance-Testing-With-Progress-Updates.md Initiates a long-running set of Kubernetes conformance tests using the 'e2e' plugin. Ensure Sonobuoy version 0.16.5+ and a compatible conformance image are used. ```bash $ sonobuoy run ``` -------------------------------- ### Install Sonobuoy with Homebrew Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/README.md This command installs Sonobuoy on macOS using the Homebrew package manager. Ensure Homebrew is installed and updated before running. ```bash brew install sonobuoy ``` -------------------------------- ### Accessing the Kubernetes API Client Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-11-09-E2E-Skeleton-Plugin.md Use the pre-configured client to interact with the Kubernetes API without manual client-go or kubeconfig setup. ```go cfg.Client() ``` ```go err := cfg.Client().Resources("kube-system").List(context.TODO(), &pods) ``` -------------------------------- ### Install Hugo on Windows Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/README.md Use Chocolatey to install the extended version of Hugo on Windows. ```bash choco install hugo-extended -confirm ``` -------------------------------- ### Run Sonobuoy Conformance Tests Source: https://context7.com/vmware-tanzu/sonobuoy/llms.txt Various configurations for starting Sonobuoy runs, including modes for certification, custom namespaces, and specific plugin execution. ```bash # Run full conformance tests (can take 60+ minutes) sonobuoy run --wait # Run a quick single test to validate cluster configuration sonobuoy run --mode quick --wait # Run non-disruptive conformance tests (safer for production) sonobuoy run --mode non-disruptive-conformance --wait # Run certified conformance tests for CNCF certification sonobuoy run --mode certified-conformance --wait # Run with a specific Kubernetes version image sonobuoy run --kubernetes-version v1.28.0 --wait # Run with custom namespace sonobuoy run --namespace custom-sonobuoy --wait # Run with custom timeout (in seconds) sonobuoy run --timeout 7200 --wait # Run only specific plugins sonobuoy run --plugin e2e --wait # Run with custom plugin from URL sonobuoy run --plugin https://raw.githubusercontent.com/vmware-tanzu/sonobuoy-plugins/main/cis-benchmarks/kube-bench-plugin.yaml --wait # Run with environment variable overrides for e2e plugin sonobuoy run --plugin-env e2e.E2E_FOCUS="Pods should be submitted and removed" --wait ``` -------------------------------- ### Install Hugo on macOS Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/README.md Use Homebrew to install the Hugo static site generator on macOS. ```bash brew install hugo ``` -------------------------------- ### Sonobuoy Results YAML Structure Example Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2020-05-15-who-can-plugin.md This is an example of the Sonobuoy results YAML format, illustrating the structure for plugin status and detailed check items. ```yaml name: who-can status: complete items: - name: system:masters can create bindings in default status: complete details: cluster-role-bindings: cluster-admin namespace: default resource: bindings subject-kind: Group subject-name: system:masters verb: create - name: sonobuoy-serviceaccount can create bindings in default status: complete details: cluster-role-bindings: sonobuoy-serviceaccount-sonobuoy namespace: default resource: bindings subject-kind: ServiceAccount subject-name: sonobuoy-serviceaccount subject-namespace: sonobuoy verb: create ... ``` -------------------------------- ### Generate Manifest for Quick Mode Source: https://context7.com/vmware-tanzu/sonobuoy/llms.txt Generate a Sonobuoy manifest specifically configured for the 'quick' test mode. This is useful for rapid testing or initial setup. ```bash sonobuoy gen --mode quick > quick-manifest.yaml ``` -------------------------------- ### Show Sonobuoy Plugin Definition Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-10-13-plugin-management.md Display the complete YAML definition of an installed plugin. This is useful for reviewing the plugin's configuration. ```bash $ sonobuoy plugin show myPerfectPlugin ``` -------------------------------- ### Example Test Names with Tags Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-07-06-understanding-kubernetes-tests.md Examples of test names containing bracketed tags used for filtering. ```text Job [Feature:SuspendJob] should not create pods when created in suspend state ``` ```text [sig-api-machinery] CustomResourceDefinition resources [Privileged:ClusterAdmin] should include custom resource definition resources in discovery documents [Conformance] ``` -------------------------------- ### Sonobuoy E2E Plugin Failure Example Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-12-06-Conformance-Testing-With-Progress-Updates.md Example JSON output indicating a test failure within the 'e2e' plugin. The 'failures' field lists the names of the tests that have failed. ```json { ... "progress": { ... "msg": "FAILED [sig-network] [Feature:IPv6DualStackAlphaFeature] [LinuxOnly] should create service with ipv4 cluster ip [Feature:IPv6DualStackAlphaFeature:Phase2]", ... "failures": [ "[sig-network] [Feature:IPv6DualStackAlphaFeature] [LinuxOnly] should create service with ipv4 cluster ip [Feature:IPv6DualStackAlphaFeature:Phase2]" ] } }, ``` -------------------------------- ### Customized PodSpec with Additional Container and hostPID Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-09-16-customizing-plugin-podspecs.md This example demonstrates customizing a PodSpec by adding a new container to run `ps -e` and enabling `hostPID` to access the host's PID namespace. This allows inspection of all host processes. ```yaml podSpec: containers: - name: show-host-processes image: ubuntu:18.04 command: ["ps", "-e"] restartPolicy: Never serviceAccountName: sonobuoy-serviceaccount hostPID: true tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master operator: Exists - key: CriticalAddonsOnly operator: Exists sonobuoy-config: driver: Job plugin-name: customized-pod-spec spec: args: - echo hello world command: - ./run.sh image: zubron/easy-sonobuoy-cmds:v0.1 name: plugin resources: {} volumeMounts: - mountPath: /tmp/results name: results ``` -------------------------------- ### Custom Plugin Configuration (Job Driver) Source: https://context7.com/vmware-tanzu/sonobuoy/llms.txt Define a custom Sonobuoy plugin using YAML. This example configures a plugin to run as a Kubernetes Job, execute a shell script, and output results in JUnit format. ```yaml sonobuoy-config: driver: Job plugin-name: my-custom-checks result-format: junit spec: name: my-custom-checks image: my-registry/my-plugin:v1.0.0 command: ["/bin/sh", "-c"] args: - | # Run custom checks and output junit XML /run-checks.sh > /tmp/sonobuoy/results/results.xml echo "done" > /tmp/sonobuoy/results/done volumeMounts: - name: results mountPath: /tmp/sonobuoy/results ``` -------------------------------- ### Configure Environment and Download Script Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-10-09-Custom-E2E-Image.md Set the registry and Kubernetes version, then download the standard conformance run script. ```bash export REGISTRY=schnake export k8sVersion=$(kubectl version -o json|jq .serverVersion.gitVersion -r) curl https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/images/conformance/run_e2e.sh -o run.sh && chmod +x run.sh ``` -------------------------------- ### Build, Push, and Run Custom Tests Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-10-09-Custom-E2E-Image.md Build the custom Docker image, push it to the registry, and execute the tests via Sonobuoy with specific environment variables. ```bash docker build . -t $REGISTRY/custom-conformance:v0 && docker push $REGISTRY/custom-conformance:v0 sonobuoy run --plugin custom-conformance.yaml \ --plugin-env=my-e2e.E2E_FOCUS=Conformance \ --plugin-env=my-e2e.E2E_PROVIDER=gce \ --plugin-env=my-e2e.E2E_GCE_ZONE=zone \ --plugin-env=my-e2e.E2E_GCE_REGION=region ``` -------------------------------- ### Build and Run Sonobuoy Plugin Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2022-04-30-Better-Airgap-Experience.md These commands demonstrate the basic workflow for building a containerized Sonobuoy plugin and then running it within a Kubernetes cluster. Ensure your build.sh script and plugin.yaml are correctly configured before execution. ```bash ./build.sh sonobuoy run -p ./plugin.yaml --wait ``` -------------------------------- ### Uninstall a Sonobuoy Plugin Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-10-13-plugin-management.md Remove a locally installed plugin by specifying its filename. This command cleans up installed plugins from the `~/.sonobuoy` directory. ```bash $ sonobuoy plugin uninstall myPerfectPlugin ``` -------------------------------- ### Create a test Pod for QoS validation Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-03-08-establishing-reliability-as-code-via-sonobuoy.md Deploy a test Pod with guaranteed QoS resources to verify the reliability scanner's reporting capabilities. ```bash $ cat < Dockerfile FROM gcr.io/google-containers/conformance:${k8sVersion} COPY run.sh /run.sh EOF ``` -------------------------------- ### Retrieve and inspect plugin results Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2020-05-15-who-can-plugin.md Download the results tarball and display a summary of the plugin execution. ```bash $ resultsFile=$(sonobuoy retrieve) $ sonobuoy results $resultsFile Plugin: who-can Status: complete Total: 5197 Passed: 0 Failed: 0 Skipped: 0 complete: 5197 ``` -------------------------------- ### View plug-in container logs Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-09-16-customizing-plugin-podspecs.md Displays the output logs from a specific Sonobuoy plug-in container. ```bash cat sonobuoy-output/podlogs/heptio-sonobuoy/sonobuoy-customized-pod-spec-job-ee31580678d54e92/logs/show-host-processes.txt ``` -------------------------------- ### List All Images for E2E Tests Source: https://context7.com/vmware-tanzu/sonobuoy/llms.txt List all container images required to run the end-to-end (e2e) tests. This is useful for planning image pulls in air-gapped environments. ```bash sonobuoy images list ``` -------------------------------- ### Build Sonobuoy Binary Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/README.md Execute the 'build' target in the Makefile to compile the Sonobuoy binary. This is a common step for local development and building. ```bash $ make build ``` -------------------------------- ### Run specific test suites with focus and skip flags Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-07-06-understanding-kubernetes-tests.md Configures test execution by explicitly setting focus and skip tags. ```bash $ sonobuoy run --e2e-focus=’[Conformance]’ --e2e-skip=’[Disruptive]’ ``` -------------------------------- ### Dump All Post-Processed Sonobuoy Results Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-08-07-simplified-results-reporting-with-sonobuoy.md Use `--mode=dump` to view the entire, post-processed results file, which aggregates data from all plugins. ```bash $ sonobuoy results $outfile --mode=dump name: e2e status: passed items: - name: junit_01.xml status: passed meta: file: results/global/junit_01.xml items: - name: '[sig-storage] In-tree Volumes [Driver: local][LocalVolumeType: blockfs] … ... ``` -------------------------------- ### Generate Manifest with Custom Plugin from File Source: https://context7.com/vmware-tanzu/sonobuoy/llms.txt Generate a Sonobuoy manifest that includes a custom plugin defined in a local YAML file. Provide the path to your plugin definition. ```bash sonobuoy gen --plugin ./my-custom-plugin.yaml > manifest.yaml ``` -------------------------------- ### List Available E2E Test Modes Source: https://context7.com/vmware-tanzu/sonobuoy/llms.txt List all available test modes for the Sonobuoy e2e plugin. This command shows the mode name, description, and relevant E2E_* variables. ```bash sonobuoy modes ``` -------------------------------- ### Run Sonobuoy with Multiple Custom Plugins Source: https://context7.com/vmware-tanzu/sonobuoy/llms.txt Run Sonobuoy with multiple custom plugins, including local files and remote URLs. This allows for complex, multi-component test suites. ```bash sonobuoy run \ --plugin ./plugin1.yaml \ --plugin ./plugin2.yaml \ --plugin https://example.com/remote-plugin.yaml \ --wait ``` -------------------------------- ### Configure E2E Plugin for Progress Updates Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-12-06-Conformance-Testing-With-Progress-Updates.md Set these environment variables in the e2e plugin configuration to enable progress reporting via the Golang-based runner. ```yaml - name: E2E_USE_GO_RUNNER value: "true" - name: E2E_EXTRA_ARGS value: --progress-report-url=http://localhost:8099/progress ``` -------------------------------- ### Run Windows E2E tests Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-06-21-windows-e2e.md Executes the Sonobuoy E2E plugin for Windows. Ensure the plugin URL is correctly specified based on your Kubernetes and Windows version requirements. ```bash sonobuoy run --plugin $url ``` -------------------------------- ### Initialize DocSearch Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/themes/sonobuoy/layouts/_default/baseof.html Initializes Algolia DocSearch with API key, index name, input selector, and version filtering. Debug mode can be enabled for inspection. ```javascript docsearch({ apiKey: '{{ .Site.Params.Docs_search_api_key }}', indexName: '{{ .Site.Params.Docs_search_index_name }}', inputSelector: '.docsearch-input', algoliaOptions: {'facetFilters': ["version:{{ .CurrentSection.Params.version }}"]}, debug: false // Set debug to true if you want to inspect the dropdown }); ``` -------------------------------- ### Include Header Partial Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/themes/sonobuoy/layouts/_default/baseof.html Includes the 'header' partial template. This is a common pattern for site structure. ```go-html-template {{ partial "header" . }} ``` -------------------------------- ### Running Tests with Focus and Skip Filters Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2021-07-06-understanding-kubernetes-tests.md Commands to select or exclude tests based on tags using Sonobuoy. ```bash $ sonobuoy run --e2e-focus RUN_THESE ``` ```bash $ sonobuoy run --e2e-skip DONT_RUN_THESE ``` ```bash $ sonobuoy run --e2e-focus RUN_THESE --e2e-skip DONT_RUN_THESE ``` -------------------------------- ### Retrieve and Display Plugin Results Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-11-18-cis-benchmark-plugin.md Retrieves the Sonobuoy run output and displays the summary results. ```bash $ outfile=$(sonobuoy retrieve) && sonobuoy results $outfile ``` -------------------------------- ### SCSS Compilation Options Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/themes/sonobuoy/layouts/_default/baseof.html Defines options for compiling SCSS files, including target path, output style, source map enablement, and include paths for imported modules. ```go-html-template {{ $options := (dict "targetPath" "css/style.css" "outputStyle" "compressed" "enableSourceMap" true "includePaths" (slice "node_modules/myscss")) }} {{ $style := resources.Get "scss/site.scss" | resources.ToCSS $options }} ``` -------------------------------- ### Generate Sonobuoy Plugin Definition Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-11-18-cis-benchmark-plugin.md Use the Sonobuoy CLI to generate a base plugin definition for the kube-bench image with custom arguments. ```bash $ sonobuoy gen plugin \ --name kube-bench-worker \ --image=aquasec/kube-bench:0.2.1 \ --type=DaemonSet \ --format=junit \ --cmd=/bin/sh \ --arg=-c \ --arg="kube-bench --version 1.13 --outputfile /tmp/results/output.xml --junit ; echo -n /tmp/results/output.xml > /tmp/results/done" \ --show-default-podspec > kube-bench-worker.yaml ``` -------------------------------- ### Run Sonobuoy with Custom Plugin Source: https://context7.com/vmware-tanzu/sonobuoy/llms.txt Execute Sonobuoy using a custom plugin defined in a local YAML file. The `--wait` flag ensures the command waits for the plugin to complete. ```bash sonobuoy run --plugin ./my-custom-plugin.yaml --wait ``` -------------------------------- ### jq: Show Subjects Interacting with a Resource in a Namespace Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2020-05-15-who-can-plugin.md This jq query on the Resources report identifies all subjects that can perform actions on a specified resource across all namespaces. ```bash $ cat results/plugins/who-can/results/global/resources-report.json | jq '.[] | select(.resource == "secrets" and .namespace == "*")' { "resource": "secrets", "verb": "create", "namespace": "*", "subjects": [ { "kind": "Group", "apiGroup": "rbac.authorization.k8s.io", "name": "system:masters", "cluster-role-bindings": [ "cluster-admin" ] }, { "kind": "User", "apiGroup": "rbac.authorization.k8s.io", "name": "system:kube-controller-manager", "cluster-role-bindings": [ "system:kube-controller-manager" ] } ] } ... ``` -------------------------------- ### Run Non-Disruptive Conformance Tests Source: https://github.com/vmware-tanzu/sonobuoy/blob/main/site/content/posts/2019-09-25-Summary-of-improvements.md Use this command to run only the non-disruptive conformance tests, ensuring production workloads are not impacted. This is the default behavior. ```bash sonobuoy run --mode=non-disruptive-conformance ```