Skip to content

Commit

Permalink
update sample preflight and support bundles, update diretory name
Browse files Browse the repository at this point in the history
  • Loading branch information
GraysonNull committed Jul 13, 2020
1 parent 78e328b commit dc80733
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-test-deploy.yaml
Expand Up @@ -89,8 +89,8 @@ jobs:
path: bin/
- uses: engineerd/setup-kind@v0.2.0
- run: chmod +x bin/support-bundle
- run: ./bin/support-bundle ./examples/troubleshoot/sample-collectors.yaml
- run: ./bin/support-bundle ./examples/troubleshoot/sample-supportbundle.yaml
- run: ./bin/support-bundle ./examples/support-bundle/sample-collectors.yaml
- run: ./bin/support-bundle ./examples/support-bundle/sample-supportbundle.yaml
- run: ./bin/support-bundle https://kots.io

goreleaser:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -128,8 +128,8 @@ run-preflight: preflight

.PHONY: run-troubleshoot
run-troubleshoot: support-bundle
./bin/support-bundle ./examples/troubleshoot/sample-supportbundle.yaml
./bin/support-bundle ./examples/support-bundle/sample-supportbundle.yaml

.PHONY: run-analyze
run-analyze: analyze
./bin/analyze --analyzers ./examples/troubleshoot/sample-analyzers.yaml ./support-bundle.tar.gz
./bin/analyze --analyzers ./examples/support-bundle/sample-analyzers.yaml ./support-bundle.tar.gz
119 changes: 91 additions & 28 deletions examples/preflight/sample-preflight.yaml
@@ -1,20 +1,14 @@
apiVersion: troubleshoot.replicated.com/v1beta1
kind: Preflight
metadata:
name: example-preflight-checks
name: example-preflight-check
spec:
collectors:
- secret:
name: myapp-postgres
namespace: default
key: uri
includeValue: false
analyzers:
- clusterVersion:
outcomes:
- fail:
when: "< 1.13.0"
message: The application requires at Kubernetes 1.13.0 or later, and recommends 1.15.0.
message: This application requires at Kubernetes 1.13.0 or later, and recommends 1.15.0.
uri: https://www.kubernetes.io
- warn:
when: "< 1.15.0"
Expand All @@ -24,32 +18,101 @@ spec:
when: ">= 1.15.0"
message: Your cluster meets the recommended and required versions of Kubernetes.
- customResourceDefinition:
customResourceDefinitionName: constrainttemplates.templates.gatekeeper.sh
checkName: Gatekeeper policy runtime
customResourceDefinitionName: ingressroutes.contour.heptio.com
outcomes:
- fail:
message: Gatekeeper is required for the application, but not found in the cluster.
uri: https://enterprise.support.io/installing/gatekeeper
message: IngressRoutes CRD not found!
- pass:
message: Found a supported version of Gatekeeper installed and running in the cluster.
- imagePullSecret:
checkName: Registry credentials for Quay.io
registryName: quay.io
message: IngressRoutes CRD found!
- containerRuntime:
outcomes:
- pass:
when: "== docker"
message: Docker container runtime was found.
- fail:
message: Did not find Docker container runtime.
- storageClass:
checkName: Required storage classes
storageClassName: "default"
outcomes:
- fail:
message: Could not find a storage class called default.
- pass:
message: All good on storage classes
- 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:
message: |
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.
uri: https://enterprise.support.io/installing/registry-credentials
when: "== minikube"
message: The application does not support Minikube Clusters
- pass:
message: Found credentials to pull from quay.io
- secret:
checkName: Postgres connection string
secretName: myapp-postgres
namespace: default
key: uri
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
# Will be supported in the future
- 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
- nodeResources:
checkName: Must have at least 3 nodes in the cluster, with 5 recommended
outcomes:
- fail:
when: "count() < 3"
message: This application requires at least 3 nodes.
uri: https://kurl.sh/docs/install-with-kurl/adding-nodes
- warn:
when: "count() < 5"
message: This application recommends at last 5 nodes.
uri: https://kurl.sh/docs/install-with-kurl/adding-nodes
- pass:
message: This cluster has enough nodes.
- nodeResources:
checkName: Every node in the cluster must have at least 10 GB of memory, with 32 GB recommended
outcomes:
- fail:
when: "min(memoryCapacity) < 10Gi"
message: All nodes must have at least 10 GB of memory.
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
- warn:
when: "min(memoryCapacity) < 32Gi"
message: All nodes are recommended to have at least 32 GB of memory.
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
- pass:
message: All nodes have at least 32 GB of memory.
- nodeResources:
checkName: Total CPU Cores in the cluster is 4 or greater
outcomes:
- fail:
message: A secret named "myapp-postgres" must be deployed with a "uri" key
uri: https://enterprise.support.io/installing/postgres
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: Found a valid postgres connection string
message: There are at least 4 cores in the cluster
- 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.
File renamed without changes.
100 changes: 100 additions & 0 deletions examples/support-bundle/sample-supportbundle.yaml
@@ -0,0 +1,100 @@
apiVersion: troubleshoot.replicated.com/v1beta1
kind: SupportBundle
metadata:
name: example-support-bundle
spec:
analyzers:
- clusterVersion:
outcomes:
- fail:
when: "< 1.16.0"
message: The application requires at Kubernetes 1.16.0 or later
uri: https://kubernetes.io
- warn:
when: "< 1.17.0"
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.17.0 or later.
uri: https://kubernetes.io
- pass:
message: Your cluster meets the recommended and required versions of Kubernetes.
- customResourceDefinition:
customResourceDefinitionName: rook
outcomes:
- fail:
message: The Rook CRD was not found in the cluster.
- pass:
message: Rook is installed and available.
- containerRuntime:
outcomes:
- fail:
when: "== docker"
message: The application does not support docker
- pass:
message: A supported container runtime was found
- storageClass:
checkName: Required storage classes
storageClassName: "microk8s-hostpath"
outcomes:
- fail:
message: The microk8s storage class thing was not found
- pass:
message: All good on storage classes
- nodeResources:
checkName: Must have at least 3 nodes in the cluster
outcomes:
- fail:
when: "count() < 3"
message: This application requires at least 3 nodes
- warn:
when: "count() < 5"
message: This application recommends at last 5 nodes.
- pass:
message: This cluster has enough nodes.
- 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
- pass:
message: There are at least 4 cores in the cluster
- nodeResources:
checkName: Each node must have at least 40 GB of ephemeral storage
outcomes:
- fail:
when: "min(ephemeralStorageCapacity) < 40Gi"
message: Noees in this cluster do not have at least 40 GB of ephemeral storage.
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
- warn:
when: "min(ephemeralStorageCapacity) < 100Gi"
message: Nodes in this cluster are recommended to have at least 100 GB of ephemeral storage.
uri: https://kurl.sh/docs/install-with-kurl/system-requirements
- pass:
message: The nodes in this cluster have enough ephemeral storage.
- ingress:
namespace: default
ingressName: connect-to-me
outcomes:
- fail:
message: The ingress isn't ingressing
- pass:
message: All systems ok on ingress
- deploymentStatus:
name: api
namespace: default
outcomes:
- fail:
when: "< 1"
message: The API deployment does not have any ready replicas.
- warn:
when: "= 1"
message: The API deployment has only a single ready replica.
- pass:
message: There are multiple replicas of the API deployment ready.
- logs:
selector:
- app=example
- component=nginx
namespace: repl{{ Namespace }}
limits:
maxAge: 30d
maxLines: 10000
20 changes: 0 additions & 20 deletions examples/troubleshoot/sample-supportbundle.yaml

This file was deleted.

0 comments on commit dc80733

Please sign in to comment.