Skip to content

Commit

Permalink
Preflight and Analyzers
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ committed Dec 12, 2019
1 parent 8719aae commit 8531871
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
built/
deps/
*.swp
125 changes: 125 additions & 0 deletions manifests/analyzers.yaml
@@ -0,0 +1,125 @@
apiVersion: troubleshoot.replicated.com/v1beta1
kind: Analyzer
metadata:
name: sentry-enterprise
spec:
collectors:
- secret:
name: sentry-postgresql
key: postgres-password
includeValue: false
analyzers:
# Fails on preflight page even though registry has been added vendor.replicated.com.
- imagePullSecret:
checkName: Has Access to index.docker.io
registryName: index.docker.io
outcomes:
- fail:
message: Cannot pull from index.docker.io
- pass:
message: Found credentials to pull from index.docker.io
# Fails on preflight page even though Ingress exists.
- ingress:
ingressName: sentry-ingress
outcomes:
- fail:
message: Sentry ingress is not working.
- pass:
message: Sentry ingress is working.
- deploymentStatus:
name: sentry-worker
outcomes:
- fail:
when: "< 1"
message: The Sentry Worker deployment does not have any ready replicas.
- warn:
when: "= 1"
message: The Sentry Worker deployment has only a single ready replica.
- pass:
message: There are multiple replicas of the Sentry Worker deployment ready.
# Is it statefulset or statefulsetStatus?
# Does not even show up in preflights page.
- statefulsetStatus:
name: sentry-redis-master
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.
- clusterVersion:
outcomes:
- fail:
when: "< 1.13.0"
message: Sentry requires at Kubernetes 1.13.0 or later, and recommends 1.15.0.
uri: https://www.kubernetes.io
- warn:
when: "< 1.15.0"
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.15.0 or later.
uri: https://kubernetes.io
- pass:
when: ">= 1.15.0"
message: Your cluster meets the recommended and required versions of Kubernetes.
- customResourceDefinition:
customResourceDefinitionName: ingressroutes.contour.heptio.com
outcomes:
- fail:
message: IngressRoutes CRD not found!
- pass:
message: IngressRoutes CRD found!
# Does not even show up in preflights page.
- secret:
checkName: Sentry Postgresql
secretName: sentry-postgresql
key: postgres-password
outcomes:
- fail:
message: The `sentry-postgresql` secret was not found or the `postgres-password` key was not detected.
- pass:
message: The Postgres Password was found in a secret in the cluster.
- 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:
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
41 changes: 1 addition & 40 deletions manifests/preflight.yaml
Expand Up @@ -4,23 +4,6 @@ metadata:
name: sentry-enterprise
spec:
analyzers:
# Fails on preflight page even though registry has been added vendor.replicated.com.
- imagePullSecret:
checkName: Has Access to index.docker.io
registryName: index.docker.io
outcomes:
- fail:
message: Cannot pull from index.docker.io
- pass:
message: Found credentials to pull from index.docker.io
# Fails on preflight page even though Ingress exists.
- ingress:
ingressName: sentry-ingress
outcomes:
- fail:
message: Sentry ingress is not working.
- pass:
message: Sentry ingress is working.
- deploymentStatus:
name: sentry-worker
outcomes:
Expand All @@ -32,19 +15,6 @@ spec:
message: The Sentry Worker deployment has only a single ready replica.
- pass:
message: There are multiple replicas of the Sentry Worker deployment ready.
# Is it statefulset or statefulsetStatus?
# Does not even show up in preflights page.
- statefulsetStatus:
name: sentry-redis-master
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.
- clusterVersion:
outcomes:
- fail:
Expand All @@ -65,16 +35,6 @@ spec:
message: IngressRoutes CRD not found!
- pass:
message: IngressRoutes CRD found!
# Does not even show up in preflights page.
- secret:
checkName: Sentry Postgresql
secretName: sentry-postgresql
key: postgres-password
outcomes:
- fail:
message: The `sentry-postgresql` secret was not found or the `postgres-password` key was not detected.
- pass:
message: The Postgres Password was found in a secret in the cluster.
- containerRuntime:
outcomes:
- pass:
Expand Down Expand Up @@ -110,6 +70,7 @@ spec:
- pass:
when: "== aks"
message: AKS is a supported distribution
# Will be supported in the future
- pass:
when: "== kurl"
message: KURL is a supported distribution
Expand Down

0 comments on commit 8531871

Please sign in to comment.