### Navigate to autosharding example directory Source: https://github.com/elastic/elastic-agent/blob/main/docs/manifests/kustomize-autosharding/README.md Navigates to the autosharding example directory. ```bash cd kube-state-metrics/examples/autosharding ``` -------------------------------- ### service.operations example Source: https://github.com/elastic/elastic-agent/blob/main/docs/component-specs.md Example of configuring the `operations` field for a service, defining `check`, `install`, and `uninstall` operations with their arguments, environment variables, and timeouts. ```yaml operations: check: args: - "verify" - "--verbose" timeout: 30 install: args: - "install" env: - name: DEBUG value: "true" timeout: 600 uninstall: args: - "uninstall" timeout: 600 ``` -------------------------------- ### Test with example values file Source: https://github.com/elastic/elastic-agent/blob/main/deploy/helm/elastic-agent/CONTRIBUTING.md Tests changes against example configurations in the examples/ directory. ```bash helm template elastic-agent . -f examples/kubernetes-default/agent-kubernetes-values.yaml ``` -------------------------------- ### Install kube-state-metrics chart Source: https://github.com/elastic/elastic-agent/blob/main/deploy/helm/elastic-agent/charts/kube-state-metrics/README.md Installs the kube-state-metrics chart with a release name and optional flags. ```console helm install [RELEASE_NAME] prometheus-community/kube-state-metrics [flags] ``` -------------------------------- ### Get GOHOSTOS and GOHOSTARCH values Source: https://github.com/elastic/elastic-agent/blob/main/README.md Shows how to get the host OS and architecture to set the PLATFORMS variable. ```bash ❯ go env GOHOSTOS darwin ❯ go env GOHOSTARCH amd64 ``` -------------------------------- ### Get a path for agent acks using NewPathAgentAcks Source: https://github.com/elastic/elastic-agent/blob/main/testing/fleetservertest/README.md Use fleetservertest.NewPathAgentAcks to get a path ready for use. The example shows the resulting path for a given agent ID. ```go p := NewPathAgentAcks("my-agent-id") // p = "/api/fleet/agents/my-agent-id/acks" ``` -------------------------------- ### component-docs.yml configuration example Source: https://github.com/elastic/elastic-agent/blob/main/docs/scripts/update-docs/README.md Example structure of the component-docs.yml configuration file, located at docs/reference/edot-collector/component-docs.yml. Maps components to documentation pages. ```yaml components: filelogreceiver: doc_path: /reference/edot-collector/components/filelogreceiver.md ``` -------------------------------- ### Install Mage build tool Source: https://github.com/elastic/elastic-agent/blob/main/AGENTS.md Install the Mage build tool using go install. This is required before running any mage targets. ```bash go install github.com/magefile/mage@latest ``` -------------------------------- ### Run system tests with elastic-package stack up and test system Source: https://github.com/elastic/elastic-agent/blob/main/internal/edot/receivers/verifierreceiver/testdata/TESTING.md Start the stack and run system tests for the verifier_otel package. Requires a running stack. ```bash elastic-package stack up -d elastic-package test system --packages verifier_otel ``` -------------------------------- ### Install and run Elastic Agent with --develop flag Source: https://github.com/elastic/elastic-agent/blob/main/README.md Use the --develop flag to install or run Elastic Agent in development mode, allowing a second installation on a machine that already has a managed agent. The install command supports all other arguments, and the run command can be used without installing when another agent is present. ```sh # All other arguments to the install command are still supported when --develop is specified. sudo ./elastic-agent install --develop # The run command also supports the --develop option to allow running without installing when there is another agent on the machine. ./elastic-agent run -e --develop ``` -------------------------------- ### Generate documentation with update-components-docs.py Source: https://github.com/elastic/elastic-agent/blob/main/docs/scripts/update-docs/README.md Run the script to generate documentation. Must be executed from the docs/scripts/update-docs directory. ```bash cd docs/scripts/update-docs python update-components-docs.py ``` -------------------------------- ### Install agent from extracted package Source: https://github.com/elastic/elastic-agent/blob/main/README.md Extracts the built package and installs the agent. Replace with the current version from version/version.go. The install command requires sudo. ```sh cd build/distributions tar xvfz elastic-agent--SNAPSHOT-linux-x86_64.tar.gz cd elastic-agent--SNAPSHOT-linux-x86_64 sudo ./elastic-agent install ``` -------------------------------- ### Install opentelemetry-kube-stack chart Source: https://github.com/elastic/elastic-agent/blob/main/testing/integration/k8s/testdata/opentelemetry-kube-stack/README.md Installs the opentelemetry-kube-stack chart with the default release name. ```console $ helm install \ opentelemetry-kube-stack open-telemetry/opentelemetry-kube-stack ``` -------------------------------- ### Install nginx deployment Source: https://github.com/elastic/elastic-agent/blob/main/deploy/helm/elastic-agent/examples/multiple-integrations/README.md Applies the nginx deployment configuration. ```console kubectl apply -f ./nginx.yaml ``` -------------------------------- ### Disable kube-state-metrics installation Source: https://github.com/elastic/elastic-agent/blob/main/deploy/helm/elastic-agent/examples/kubernetes-custom-output/README.md Specifies a Helm chart value to disable the installation of kube-state-metrics. ```console kube-state-metrics.enabled=false ```