Skip to content

Commit 37ae457

Browse files
authored
Merge pull request #223 from GraysonNull/grayson/update-samples
update sample preflight and support bundles, update directory name
2 parents 78e328b + 4b1852c commit 37ae457

File tree

7 files changed

+196
-52
lines changed

7 files changed

+196
-52
lines changed

.github/workflows/build-test-deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ jobs:
8989
path: bin/
9090
- uses: engineerd/[email protected]
9191
- run: chmod +x bin/support-bundle
92-
- run: ./bin/support-bundle ./examples/troubleshoot/sample-collectors.yaml
93-
- run: ./bin/support-bundle ./examples/troubleshoot/sample-supportbundle.yaml
92+
- run: ./bin/support-bundle ./examples/support-bundle/sample-collectors.yaml
93+
- run: ./bin/support-bundle ./examples/support-bundle/sample-supportbundle.yaml
9494
- run: ./bin/support-bundle https://kots.io
9595

9696
goreleaser:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ run-preflight: preflight
128128

129129
.PHONY: run-troubleshoot
130130
run-troubleshoot: support-bundle
131-
./bin/support-bundle ./examples/troubleshoot/sample-supportbundle.yaml
131+
./bin/support-bundle ./examples/support-bundle/sample-supportbundle.yaml
132132

133133
.PHONY: run-analyze
134134
run-analyze: analyze
135-
./bin/analyze --analyzers ./examples/troubleshoot/sample-analyzers.yaml ./support-bundle.tar.gz
135+
./bin/analyze --analyzers ./examples/support-bundle/sample-analyzers.yaml ./support-bundle.tar.gz
Lines changed: 92 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
apiVersion: troubleshoot.replicated.com/v1beta1
22
kind: Preflight
33
metadata:
4-
name: example-preflight-checks
4+
name: example
55
spec:
6-
collectors:
7-
- secret:
8-
name: myapp-postgres
9-
namespace: default
10-
key: uri
11-
includeValue: false
126
analyzers:
137
- clusterVersion:
148
outcomes:
159
- fail:
1610
when: "< 1.13.0"
17-
message: The application requires at Kubernetes 1.13.0 or later, and recommends 1.15.0.
11+
message: This application requires at least Kubernetes 1.13.0 or later, and recommends 1.15.0.
1812
uri: https://www.kubernetes.io
1913
- warn:
2014
when: "< 1.15.0"
@@ -24,32 +18,102 @@ spec:
2418
when: ">= 1.15.0"
2519
message: Your cluster meets the recommended and required versions of Kubernetes.
2620
- customResourceDefinition:
27-
customResourceDefinitionName: constrainttemplates.templates.gatekeeper.sh
28-
checkName: Gatekeeper policy runtime
21+
checkName: Ingress
22+
customResourceDefinitionName: ingressroutes.contour.heptio.com
2923
outcomes:
3024
- fail:
31-
message: Gatekeeper is required for the application, but not found in the cluster.
32-
uri: https://enterprise.support.io/installing/gatekeeper
25+
message: Contour ingress not found!
3326
- pass:
34-
message: Found a supported version of Gatekeeper installed and running in the cluster.
35-
- imagePullSecret:
36-
checkName: Registry credentials for Quay.io
37-
registryName: quay.io
27+
message: Contour ingress found!
28+
- containerRuntime:
3829
outcomes:
30+
- pass:
31+
when: "== docker"
32+
message: Docker container runtime was found.
33+
- fail:
34+
message: Did not find Docker container runtime.
35+
- storageClass:
36+
checkName: Required storage classes
37+
storageClassName: "default"
38+
outcomes:
39+
- fail:
40+
message: Could not find a storage class called default.
41+
- pass:
42+
message: All good on storage classes
43+
- distribution:
44+
outcomes:
45+
- fail:
46+
when: "== docker-desktop"
47+
message: The application does not support Docker Desktop Clusters
48+
- fail:
49+
when: "== microk8s"
50+
message: The application does not support Microk8s Clusters
3951
- fail:
40-
message: |
41-
Cannot pull from quay.io. An image pull secret should be deployed to the cluster that has credentials to pull the images. To obtain this secret, please contact your support rep.
42-
uri: https://enterprise.support.io/installing/registry-credentials
52+
when: "== minikube"
53+
message: The application does not support Minikube Clusters
4354
- pass:
44-
message: Found credentials to pull from quay.io
45-
- secret:
46-
checkName: Postgres connection string
47-
secretName: myapp-postgres
48-
namespace: default
49-
key: uri
55+
when: "== eks"
56+
message: EKS is a supported distribution
57+
- pass:
58+
when: "== gke"
59+
message: GKE is a supported distribution
60+
- pass:
61+
when: "== aks"
62+
message: AKS is a supported distribution
63+
# Will be supported in the future
64+
- pass:
65+
when: "== kurl"
66+
message: KURL is a supported distribution
67+
- pass:
68+
when: "== digitalocean"
69+
message: DigitalOcean is a supported distribution
70+
- warn:
71+
message: Unable to determine the distribution of Kubernetes
72+
- nodeResources:
73+
checkName: Must have at least 3 nodes in the cluster, with 5 recommended
74+
outcomes:
75+
- fail:
76+
when: "count() < 3"
77+
message: This application requires at least 3 nodes.
78+
uri: https://kurl.sh/docs/install-with-kurl/adding-nodes
79+
- warn:
80+
when: "count() < 5"
81+
message: This application recommends at last 5 nodes.
82+
uri: https://kurl.sh/docs/install-with-kurl/adding-nodes
83+
- pass:
84+
message: This cluster has enough nodes.
85+
- nodeResources:
86+
checkName: Every node in the cluster must have at least 10 GB of memory, with 32 GB recommended
87+
outcomes:
88+
- fail:
89+
when: "min(memoryCapacity) < 10Gi"
90+
message: All nodes must have at least 10 GB of memory.
91+
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
92+
- warn:
93+
when: "min(memoryCapacity) < 32Gi"
94+
message: All nodes are recommended to have at least 32 GB of memory.
95+
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
96+
- pass:
97+
message: All nodes have at least 32 GB of memory.
98+
- nodeResources:
99+
checkName: Total CPU Cores in the cluster is 4 or greater
50100
outcomes:
51101
- fail:
52-
message: A secret named "myapp-postgres" must be deployed with a "uri" key
53-
uri: https://enterprise.support.io/installing/postgres
102+
when: "sum(cpuCapacity) < 4"
103+
message: The cluster must contain at least 4 cores
104+
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
54105
- pass:
55-
message: Found a valid postgres connection string
106+
message: There are at least 4 cores in the cluster
107+
- nodeResources:
108+
checkName: Every node in the cluster must have at least 40 GB of ephemeral storage, with 100 GB recommended
109+
outcomes:
110+
- fail:
111+
when: "min(ephemeralStorageCapacity) < 40Gi"
112+
message: All nodes must have at least 40 GB of ephemeral storage.
113+
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
114+
- warn:
115+
when: "min(ephemeralStorageCapacity) < 100Gi"
116+
message: All nodes are recommended to have at least 100 GB of ephemeral storage.
117+
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
118+
- pass:
119+
message: All nodes have at least 100 GB of ephemeral storage.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
apiVersion: troubleshoot.replicated.com/v1beta1
2+
kind: SupportBundle
3+
metadata:
4+
name: example
5+
spec:
6+
analyzers:
7+
- clusterVersion:
8+
outcomes:
9+
- fail:
10+
when: "< 1.16.0"
11+
message: The application requires at least Kubernetes 1.16.0 or later
12+
uri: https://kubernetes.io
13+
- warn:
14+
when: "< 1.17.0"
15+
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.17.0 or later.
16+
uri: https://kubernetes.io
17+
- pass:
18+
message: Your cluster meets the recommended and required versions of Kubernetes.
19+
- customResourceDefinition:
20+
customResourceDefinitionName: rook
21+
outcomes:
22+
- fail:
23+
message: The Rook CRD was not found in the cluster.
24+
- pass:
25+
message: Rook is installed and available.
26+
- containerRuntime:
27+
outcomes:
28+
- fail:
29+
when: "== docker"
30+
message: The application does not support docker
31+
- pass:
32+
message: A supported container runtime was found
33+
- storageClass:
34+
checkName: Required storage classes
35+
storageClassName: "microk8s-hostpath"
36+
outcomes:
37+
- fail:
38+
message: The microk8s storage class thing was not found
39+
- pass:
40+
message: All good on storage classes
41+
- nodeResources:
42+
checkName: Must have at least 3 nodes in the cluster
43+
outcomes:
44+
- fail:
45+
when: "count() < 3"
46+
message: This application requires at least 3 nodes
47+
- warn:
48+
when: "count() < 5"
49+
message: This application recommends at last 5 nodes.
50+
- pass:
51+
message: This cluster has enough nodes.
52+
- nodeResources:
53+
checkName: Total CPU Cores in the cluster is 4 or greater
54+
outcomes:
55+
- fail:
56+
when: "sum(cpuCapacity) < 4"
57+
message: The cluster must contain at least 4 cores
58+
- pass:
59+
message: There are at least 4 cores in the cluster
60+
- nodeResources:
61+
checkName: Each node must have at least 40 GB of ephemeral storage
62+
outcomes:
63+
- fail:
64+
when: "min(ephemeralStorageCapacity) < 40Gi"
65+
message: Noees in this cluster do not have at least 40 GB of ephemeral storage.
66+
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
67+
- warn:
68+
when: "min(ephemeralStorageCapacity) < 100Gi"
69+
message: Nodes in this cluster are recommended to have at least 100 GB of ephemeral storage.
70+
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
71+
- pass:
72+
message: The nodes in this cluster have enough ephemeral storage.
73+
- ingress:
74+
namespace: default
75+
ingressName: connect-to-me
76+
outcomes:
77+
- fail:
78+
message: The ingress isn't ingressing
79+
- pass:
80+
message: All systems ok on ingress
81+
- deploymentStatus:
82+
name: api
83+
namespace: default
84+
outcomes:
85+
- fail:
86+
when: "< 1"
87+
message: The API deployment does not have any ready replicas.
88+
- warn:
89+
when: "= 1"
90+
message: The API deployment has only a single ready replica.
91+
- pass:
92+
message: There are multiple replicas of the API deployment ready.
93+
- logs:
94+
selector:
95+
- app=example
96+
- component=nginx
97+
namespace: repl{{ Namespace }}
98+
limits:
99+
maxAge: 30d
100+
maxLines: 10000

examples/troubleshoot/sample-supportbundle.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)