# Can I run Replicated Preflight Checks before KOTS or KURL is installed?

**URL:** <https://community.replicated.com/t/can-i-run-replicated-preflight-checks-before-kots-or-kurl-is-installed/1248>\
**Category:** Supporting your customers\
**Tags:** kots, support-bundle, kurl, troubleshoot\
**Created:** [June 28, 2023, 12:56am UTC](https://community.replicated.com/t/can-i-run-replicated-preflight-checks-before-kots-or-kurl-is-installed/1248 "2023-06-28T00:56:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![diamon\_w](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.replicated.com/diamon_w/32/150_2.png) [@diamon\_w](https://community.replicated.com/u/diamon_w)\
**Post date:** [June 28, 2023, 12:56am UTC](https://community.replicated.com/t/can-i-run-replicated-preflight-checks-before-kots-or-kurl-is-installed/1248/1 "2023-06-28T00:56:43Z")

</div>

**Answer: Yes**

The preflight binary can be downloaded and installed ahead of an Embedded or Existing Cluster KOTS install in the event that you want an end-user to determine that the environment is ready prior to the initial installation.

For Embedded Clusters please see - [kURL: How to do a standalone run of Host Preflights](https://community.replicated.com/t/kurl-how-to-do-a-standalone-run-of-host-preflights/782)

For Existing Cluster installs, the instructions would be as follows:

1. Download and install the Preflight binary

```auto
curl -L https://github.com/replicatedhq/troubleshoot/releases/latest/download/preflight_linux_amd64.tar.gz | tar xzvf -

```

1. Run the Preflight binary using a spec that you provide by the user. The below command includes an example from our [troubleshoot Github repository](https://github.com/replicatedhq/troubleshoot)

```auto
./preflight https://raw.githubusercontent.com/replicatedhq/troubleshoot/main/examples/preflight/sample-preflight.yaml

```

A good example of where you’d might want to do this is to ensure that your customer has provisioned a resource like a `PersistentVolumeClaim` ahead of time, so we can make sure that it meets our minimum size requirement and has an access mode of `ReadWriteMany`

```yaml
apiVersion: troubleshoot.sh/v1beta2
kind: Preflight
metadata:
  name: preflight-sample-pvc
spec:
  collectors:
    - cluster-resources: {}
  analyzers:
    - clusterResource:
        checkName: pvc-size
        kind: pvc
        namespace: default
        name: some-pvc
        yamlPath: "spec.resources.requests.storage"
        outcomes:
          - pass:
              when: ">= 500Gi"
              message: you have enough storage
          - fail:
              message: there is not enough storage
    - clusterResource:
        checkName: check-access-mode
        kind: pvc
        namespace: default
        name: some-pvc
        yamlPath: "spec.accessModes"
        regex: ReadWriteMany
        outcomes:
          - fail:
              when: "false"
              message: is not ReadWriteMany
          - pass:
              when: "true"
              message: is ReadWriteMany

```

For more info on the `clusterResource` analyzer see - [Cluster Resource - Troubleshoot Docs - Troubleshoot Docs](https://troubleshoot.sh/docs/analyze/cluster-resource/)

**Note** : Because this is being run outside the context of KOTS you can’t use Replicated template functions in the Preflight spec you distribute for this purpose
