Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glooctl check #1052

Closed
rickducott opened this issue Aug 19, 2019 · 1 comment · Fixed by #1054
Closed

glooctl check #1052

rickducott opened this issue Aug 19, 2019 · 1 comment · Fixed by #1054
Assignees
Labels
Size: S 1 - 3 days

Comments

@rickducott
Copy link

rickducott commented Aug 19, 2019

glooctl check is a command that will check all gloo resources, reporting the first error it encounters with a non-zero exit code, or exiting successfully.

When things are ok:

[17:08:50] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking secrets... OK
Checking virtual services... OK
Checking gateways... OK
Checking proxies... OK
No problems detected.

When kube connection is down:

[17:08:58] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Error!
Could not communicate with kubernetes cluster: Get https://192.168.99.100:8443/api/v1/namespaces: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

When kube is up but gloo namespace doesn't exist:

[17:20:37] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... Gloo namespace does not exist
Error!
namespaces "gloo-system" not found

When namespace exists but gloo isn't installed:

[17:21:17] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... Gloo is not installed
Problems detected!

When gloo is installed but pods aren't ready:

[17:21:20] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... Pod gloo-7c57cf4455-82k7p in namespace gloo-system is not ready!
Problems detected!

When upstream has invalid yaml:

[17:24:39] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... OK
Checking upstreams... Error!
converting output crd: reading crd spec into v1Upstream: unknown field "invalid" in static.UpstreamSpec

When upstream is rejected:

[20:56:17] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... OK
Checking upstreams... Found rejected upstream: gloo-system aws
Reason: 1 error occurred:
	* retrieving aws secret: list did not find secret gloo-system.typo-aws-creds

Problems detected!

When secret has invalid yaml:

[21:11:31] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking secrets... Error!
reading secret data into *v1.Secret: unknown field "aws-typo" in v1.Secret

When gateway has invalid yaml:

[21:08:34] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking secrets... OK
Checking virtual services... OK
Checking gateways... Error!
converting output crd: reading crd spec into v2Gateway: unknown field "invalid" in v2.Gateway

When gateway is rejected:

[21:08:51] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking secrets... OK
Checking virtual services... OK
Checking gateways... Found rejected gateway: gloo-system gateway
Reason: 1 error occurred:
	* list did not find virtualService gloo-system.typo

Problems detected!

When two virtual services have overlapping but non-equal domain sets:

[21:13:28] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking secrets... OK
Checking virtual services... OK
Checking gateways... Found rejected gateway: gloo-system gateway
Reason: 1 error occurred:
	* domain * is present in more than one vservice set in this gateway

Problems detected!

When two virtual services both define config for a virtual host plugin (even if it's the same):

[21:32:11] rick@Ricks-MacBook-Pro-2:~/code/src/github.com/solo-io/gloo$ _output/glooctl check
Checking pods... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking secrets... OK
Checking virtual services... OK
Checking gateways... Found rejected gateway: gloo-system gateway
Reason: 1 error occurred:
	* more than one vhost plugin is present in virtual service of these domains: *

Problems detected!
@rickducott rickducott self-assigned this Aug 20, 2019
@solo-git-bot solo-git-bot bot mentioned this issue Aug 20, 2019
@rickducott
Copy link
Author

Note: for all the cases with invalid yaml, a more specific error message has been included to reference the specific resource that is failing to be parsed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: S 1 - 3 days
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant