-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1610 from replicatedhq/92865
Clarify options for defining preflights
- Loading branch information
Showing
40 changed files
with
943 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
```yaml | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: preflight-checks | ||
spec: | ||
collectors: | ||
- http: | ||
collectorName: slack | ||
get: | ||
url: https://api.slack.com/methods/api.test | ||
analyzers: | ||
- textAnalyze: | ||
checkName: Slack Accessible | ||
fileName: slack.json | ||
regex: '"status": 200,' | ||
outcomes: | ||
- pass: | ||
when: "true" | ||
message: "Can access the Slack API" | ||
- fail: | ||
when: "false" | ||
message: "Cannot access the Slack API. Check that the server can reach the internet and check [status.slack.com](https://status.slack.com)." | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
troubleshoot.sh/kind: preflight | ||
name: "{{ .Release.Name }}-preflight-config" | ||
stringData: | ||
preflight.yaml: | | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: preflight-sample | ||
spec: | ||
collectors: | ||
- http: | ||
collectorName: slack | ||
get: | ||
url: https://api.slack.com/methods/api.test | ||
analyzers: | ||
- textAnalyze: | ||
checkName: Slack Accessible | ||
fileName: slack.json | ||
regex: '"status": 200,' | ||
outcomes: | ||
- pass: | ||
when: "true" | ||
message: "Can access the Slack API" | ||
- fail: | ||
when: "false" | ||
message: "Cannot access the Slack API. Check that the server can reach the internet and check [status.slack.com](https://status.slack.com)." | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
```yaml | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: my-app | ||
spec: | ||
analyzers: | ||
- distribution: | ||
checkName: Kubernetes distribution | ||
outcomes: | ||
- fail: | ||
when: "== docker-desktop" | ||
message: The application does not support Docker Desktop Clusters | ||
- fail: | ||
when: "== microk8s" | ||
message: The application does not support Microk8s Clusters | ||
- fail: | ||
when: "== minikube" | ||
message: The application does not support Minikube Clusters | ||
- pass: | ||
when: "== eks" | ||
message: EKS is a supported distribution | ||
- pass: | ||
when: "== gke" | ||
message: GKE is a supported distribution | ||
- pass: | ||
when: "== aks" | ||
message: AKS is a supported distribution | ||
- pass: | ||
when: "== kurl" | ||
message: KURL is a supported distribution | ||
- pass: | ||
when: "== digitalocean" | ||
message: DigitalOcean is a supported distribution | ||
- warn: | ||
message: Unable to determine the distribution of Kubernetes | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
troubleshoot.sh/kind: preflight | ||
name: "{{ .Release.Name }}-preflight-config" | ||
stringData: | ||
preflight.yaml: | | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: preflight-sample | ||
spec: | ||
analyzers: | ||
- distribution: | ||
checkName: Kubernetes distribution | ||
outcomes: | ||
- fail: | ||
when: "== docker-desktop" | ||
message: The application does not support Docker Desktop Clusters | ||
- fail: | ||
when: "== microk8s" | ||
message: The application does not support Microk8s Clusters | ||
- fail: | ||
when: "== minikube" | ||
message: The application does not support Minikube Clusters | ||
- pass: | ||
when: "== eks" | ||
message: EKS is a supported distribution | ||
- pass: | ||
when: "== gke" | ||
message: GKE is a supported distribution | ||
- pass: | ||
when: "== aks" | ||
message: AKS is a supported distribution | ||
- pass: | ||
when: "== kurl" | ||
message: KURL is a supported distribution | ||
- pass: | ||
when: "== digitalocean" | ||
message: DigitalOcean is a supported distribution | ||
- warn: | ||
message: Unable to determine the distribution of Kubernetes | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
```yaml | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: my-app | ||
spec: | ||
analyzers: | ||
- clusterVersion: | ||
outcomes: | ||
- fail: | ||
when: "< 1.25.0" | ||
message: The application requires Kubernetes 1.25.0 or later, and recommends 1.28.0. | ||
uri: https://www.kubernetes.io | ||
- warn: | ||
when: "< 1.28.0" | ||
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.28.0 or later. | ||
uri: https://kubernetes.io | ||
- pass: | ||
message: Your cluster meets the recommended and required versions of Kubernetes. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
troubleshoot.sh/kind: preflight | ||
name: "{{ .Release.Name }}-preflight-config" | ||
stringData: | ||
preflight.yaml: | | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: preflight-sample | ||
spec: | ||
analyzers: | ||
- clusterVersion: | ||
outcomes: | ||
- fail: | ||
when: "< 1.25.0" | ||
message: The application requires Kubernetes 1.25.0 or later, and recommends 1.28.0. | ||
uri: https://www.kubernetes.io | ||
- warn: | ||
when: "< 1.28.0" | ||
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.28.0 or later. | ||
uri: https://kubernetes.io | ||
- pass: | ||
message: Your cluster meets the recommended and required versions of Kubernetes. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
```yaml | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: my-app | ||
spec: | ||
collectors: | ||
- mysql: | ||
collectorName: mysql | ||
uri: 'repl{{ ConfigOption "db_user" }}:repl{{ConfigOption "db_password" }}@tcp(repl{{ ConfigOption "db_host" }}:repl{{ConfigOption "db_port" }})/repl{{ ConfigOption "db_name" }}' | ||
analyzers: | ||
- mysql: | ||
# `strict: true` prevents installation from continuing if the preflight check fails | ||
strict: true | ||
checkName: Must be MySQL 8.x or later | ||
collectorName: mysql | ||
outcomes: | ||
- fail: | ||
when: connected == false | ||
message: Cannot connect to MySQL server | ||
- fail: | ||
when: version < 8.x | ||
message: The MySQL server must be at least version 8 | ||
- pass: | ||
message: The MySQL server is ready | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
troubleshoot.sh/kind: preflight | ||
name: "{{ .Release.Name }}-preflight-config" | ||
stringData: | ||
preflight.yaml: | | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: preflight-sample | ||
spec: | ||
{{ if eq .Values.global.mysql.enabled true }} | ||
collectors: | ||
- mysql: | ||
collectorName: mysql | ||
uri: '{{ .Values.global.externalDatabase.user }}:{{ .Values.global.externalDatabase.password }}@tcp({{ .Values.global.externalDatabase.host }}:{{ .Values.global.externalDatabase.port }})/{{ .Values.global.externalDatabase.database }}?tls=false' | ||
{{ end }} | ||
analyzers: | ||
{{ if eq .Values.global.mysql.enabled true }} | ||
- mysql: | ||
checkName: Must be MySQL 8.x or later | ||
collectorName: mysql | ||
outcomes: | ||
- fail: | ||
when: connected == false | ||
message: Cannot connect to MySQL server | ||
- fail: | ||
when: version < 8.x | ||
message: The MySQL server must be at least version 8 | ||
- pass: | ||
message: The MySQL server is ready | ||
{{ end }} | ||
``` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
troubleshoot.sh/kind: preflight | ||
name: "{{ .Release.Name }}-preflight-config" | ||
stringData: | ||
preflight.yaml: | | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: preflight-sample | ||
spec: | ||
analyzers: | ||
- nodeResources: | ||
checkName: Node Count Check | ||
outcomes: | ||
- fail: | ||
when: 'count() > {{ .Values.global.maxNodeCount }}' | ||
message: "The cluster has more than {{ .Values.global.maxNodeCount }} nodes." | ||
- pass: | ||
message: You have the correct number of nodes. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```yaml | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: my-app | ||
spec: | ||
analyzers: | ||
- nodeResources: | ||
checkName: Total CPU Cores in the cluster is 4 or greater | ||
outcomes: | ||
- fail: | ||
when: "sum(cpuCapacity) < 4" | ||
message: The cluster must contain at least 4 cores | ||
uri: https://kurl.sh/docs/install-with-kurl/system-requirements | ||
- pass: | ||
message: There are at least 4 cores in the cluster | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
troubleshoot.sh/kind: preflight | ||
name: "{{ .Release.Name }}-preflight-config" | ||
stringData: | ||
preflight.yaml: | | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: preflight-sample | ||
spec: | ||
analyzers: | ||
- nodeResources: | ||
checkName: Total CPU Cores in the cluster is 4 or greater | ||
outcomes: | ||
- fail: | ||
when: "sum(cpuCapacity) < 4" | ||
message: The cluster must contain at least 4 cores | ||
uri: https://kurl.sh/docs/install-with-kurl/system-requirements | ||
- pass: | ||
message: There are at least 4 cores in the cluster | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
```yaml | ||
apiVersion: troubleshoot.sh/v1beta2 | ||
kind: Preflight | ||
metadata: | ||
name: my-app | ||
spec: | ||
analyzers: | ||
- nodeResources: | ||
checkName: Every node in the cluster must have at least 40 GB of ephemeral storage, with 100 GB recommended | ||
outcomes: | ||
- fail: | ||
when: "min(ephemeralStorageCapacity) < 40Gi" | ||
message: All nodes must have at least 40 GB of ephemeral storage. | ||
uri: https://kurl.sh/docs/install-with-kurl/system-requirements | ||
- warn: | ||
when: "min(ephemeralStorageCapacity) < 100Gi" | ||
message: All nodes are recommended to have at least 100 GB of ephemeral storage. | ||
uri: https://kurl.sh/docs/install-with-kurl/system-requirements | ||
- pass: | ||
message: All nodes have at least 100 GB of ephemeral storage. | ||
``` |
Oops, something went wrong.