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

make glooctl check work for kube gateways #9621

Merged
merged 50 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
30fe440
glooctl check
jenshu Jun 14, 2024
0aba7cd
cl
jenshu Jun 14, 2024
7b41647
codegen
jenshu Jun 14, 2024
bc2fb3d
use const
jenshu Jun 14, 2024
88150ab
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 14, 2024
582c59b
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 14, 2024
c41fecc
standardize casing
jenshu Jun 14, 2024
d7d98a4
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 17, 2024
e5ecdd2
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 17, 2024
03a3994
Merge branch 'glooctl-check-kube' of github.com:solo-io/gloo into glo…
jenshu Jun 17, 2024
a5a97ce
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 17, 2024
c268b57
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 17, 2024
abbdc7e
standardize case
jenshu Jun 17, 2024
7303677
Merge branch 'glooctl-check-kube' of github.com:solo-io/gloo into glo…
jenshu Jun 17, 2024
17034f6
update kubegateway check
jenshu Jun 17, 2024
eac1691
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 18, 2024
11b42a8
fix import
jenshu Jun 18, 2024
ce0f5cd
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 18, 2024
1e3411d
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 18, 2024
ebf152b
scheme
jenshu Jun 19, 2024
413f24f
Merge branch 'glooctl-check-kube' of github.com:solo-io/gloo into glo…
jenshu Jun 19, 2024
2e2d9ba
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 19, 2024
fbc93cf
KUBE2E_TESTS not needed by setup-kind
jenshu Jun 19, 2024
0da26b1
fix test
jenshu Jun 19, 2024
5b4a0ae
Merge branch 'glooctl-check-kube' of github.com:solo-io/gloo into glo…
jenshu Jun 19, 2024
2bd89b4
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 20, 2024
42b2281
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 20, 2024
778a0ee
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 20, 2024
db09dc5
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 20, 2024
85cf0ef
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 20, 2024
57cabd4
Adding changelog file to new location
Jun 20, 2024
86c1db5
Deleting changelog file from old location
Jun 20, 2024
4b07dcd
fix typo
davidjumani Jun 20, 2024
d65f4cd
add additional check outputs
davidjumani Jun 20, 2024
daccb60
exclude kube checks
davidjumani Jun 20, 2024
47df5b5
add docs to exclude
davidjumani Jun 20, 2024
a730411
ensure kube resources are not checked if not enabled
davidjumani Jun 20, 2024
8c76846
add exclude options
davidjumani Jun 20, 2024
40c212a
add todo
davidjumani Jun 20, 2024
42eb4ba
update kubegatewayenabled check
davidjumani Jun 21, 2024
f3c991f
fix newline
davidjumani Jun 21, 2024
5c0e9f5
use constants
davidjumani Jun 21, 2024
037ab2f
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 21, 2024
603b43e
return early
davidjumani Jun 21, 2024
a0dcd52
update comment
davidjumani Jun 21, 2024
406710a
Update error
davidjumani Jun 21, 2024
216cec5
address comments
davidjumani Jun 21, 2024
245112f
rename kube gateway
davidjumani Jun 21, 2024
107ef24
Merge refs/heads/main into glooctl-check-kube
soloio-bulldozer[bot] Jun 21, 2024
3d97e2a
update message
davidjumani Jun 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ runs:
- name: Setup test env
shell: bash
env:
KUBE2E_TESTS: ${{ matrix.kube-e2e-test-type }}
davidjumani marked this conversation as resolved.
Show resolved Hide resolved
CLUSTER_NAME: 'kind'
CLUSTER_NODE_VERSION: ${{ matrix.kube-version.node }}
IMAGE_VARIANT: ${{ matrix.image-variant }}
Expand Down
6 changes: 6 additions & 0 deletions changelog/v1.18.0-beta2/glooctl-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changelog:
- type: FIX
issueLink: https://github.com/solo-io/solo-projects/issues/5741
resolvesIssue: false
description: >-
Update `glooctl check` to check for Kubernetes Gateway resources.
2 changes: 0 additions & 2 deletions ci/kind/setup-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ VERSION="${VERSION:-1.0.0-ci1}"
SKIP_DOCKER="${SKIP_DOCKER:-false}"
# Stop after creating the kind cluster
JUST_KIND="${JUST_KIND:-false}"
# Offer a default value for type of installation
KUBE2E_TESTS="${KUBE2E_TESTS:-gateway}" # If 'KUBE2E_TESTS' not set or null, use 'gateway'.
# Set the default image variant to standard
IMAGE_VARIANT="${IMAGE_VARIANT:-standard}"
# If true, run extra steps to set up k8s gateway api conformance test environment
Expand Down
67 changes: 36 additions & 31 deletions docs/content/guides/gloo_federation/federated_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,47 +183,52 @@ glooctl check
```

```shell
Checking deployments... OK
Checking pods... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking auth configs... OK
Checking rate limit configs... OK
Checking Deployments... OK
Checking Pods... OK
Checking Upstreams... OK
Checking UpstreamGroups... OK
Checking AuthConfigs... OK
Checking RateLimitConfigs... OK
Checking VirtualHostOptions... OK
Checking RouteOptions... OK
Checking secrets... OK
Checking virtual services... OK
Checking gateways... OK
Checking proxies... OK
Checking rate limit server... OK
Checking Secrets... OK
Checking VirtualServices... OK
Checking Gateways... OK
Checking Proxies... OK
No problems detected.

Detected Gloo Federation!

Checking Gloo Instance remote-1-gloo-system...
Checking deployments... OK
Checking pods... OK
Checking settings... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking auth configs... OK
Checking virtual services... OK
Checking route tables... OK
Checking gateways... OK
Checking proxies... OK
Checking Deployments... OK
Checking Pods... OK
Checking Settings... OK
Checking Upstreams... OK
Checking UpstreamGroups... OK
Checking AuthConfigs... OK
Checking RateLimitConfigs... OK
Checking VirtualServices... OK
Checking RouteRables... OK
Checking Gateways... OK
Checking MatchableHttpGateways... OK
Checking MatchableTcpGateways... OK
Checking Proxies... OK


Checking Gloo Instance remote-2-gloo-system...
Checking deployments... OK
Checking pods... OK
Checking settings... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking auth configs... OK
Checking virtual services... OK
Checking route tables... OK
Checking gateways... OK
Checking proxies... OK
Checking Deployments... OK
Checking Pods... OK
Checking Settings... OK
Checking Upstreams... OK
Checking UpstreamGroups... OK
Checking AuthConfigs... OK
Checking RateLimitConfigs... OK
Checking VirtualServices... OK
Checking RouteRables... OK
Checking Gateways... OK
Checking MatchableHttpGateways... OK
Checking MatchableTcpGateways... OK
Checking Proxies... OK
```

Note that it is best to have `gloo-edge` installed on this admin cluster. To do so, if needed, you can use the following values and command.
Expand Down
20 changes: 10 additions & 10 deletions docs/content/operations/debugging_gloo/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ glooctl check

Example output for a healthy setup:
```
Checking deployments... OK
Checking pods... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking auth configs... OK
Checking rate limit configs... OK
Checking Deployments... OK
Checking Pods... OK
Checking Upstreams... OK
Checking UpstreamGroups... OK
Checking AuthConfigs... OK
Checking RateLimitConfigs... OK
Checking VirtualHostOptions... OK
Checking RouteOptions... OK
Checking secrets... OK
Checking virtual services... OK
Checking gateways... OK
Checking proxies... OK
Checking Secrets... OK
Checking VirtualServices... OK
Checking Gateways... OK
Checking Proxies... OK
No problems detected.
```

Expand Down
16 changes: 8 additions & 8 deletions docs/content/operations/upgrading/upgrade_steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ Upgrade your Gloo Edge installation. The following example upgrade commands assu
```
Example output:
```bash
Checking deployments... OK
Checking pods... OK
Checking upstreams... OK
Checking upstream groups... OK
Checking secrets... OK
Checking virtual services... OK
Checking gateways... OK
Checking proxies... OK
Checking Deployments... OK
Checking Pods... OK
Checking Upstreams... OK
Checking UpstreamGroups... OK
Checking Secrets... OK
Checking VirtualServices... OK
Checking Gateways... OK
Checking Proxies... OK
No problems detected.
```

Expand Down
2 changes: 1 addition & 1 deletion docs/content/reference/cli/glooctl_check.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ glooctl check [flags]
### Options

```
-x, --exclude strings check to exclude: (deployments, pods, upstreams, upstreamgroup, auth-configs, rate-limit-configs, secrets, virtual-services, gateways, proxies, xds-metrics)
-x, --exclude strings check to exclude: (deployments, pods, upstreams, upstreamgroup, auth-configs, rate-limit-configs, virtual-host-options, route-options, secrets, virtual-services, gateways, proxies, xds-metrics, kube-gateway-classes, kube-gateways, kube-http-routes)
-h, --help help for check
-n, --namespace string namespace for reading or writing resources (default "gloo-system")
-o, --output OutputType output format: (json, table) (default table)
Expand Down
20 changes: 10 additions & 10 deletions docs/content/support/support-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ Get the Argo CD applications that define the installation of Gloo Edge by using
<br>Typically, the command output indicates any errors in the control plane components or associated resources, such as in the following example.

```
Checking deployments... 1 Errors!
Checking pods... 2 Errors!
Checking upstreams... OK
Checking upstream groups... OK
Checking auth configs... OK
Checking rate limit configs... OK
Checking Deployments... 1 Errors!
Checking Pods... 2 Errors!
Checking Upstreams... OK
Checking UpstreamGroups... OK
Checking AuthConfigs... OK
Checking RateLimitConfigs... OK
Checking VirtualHostOptions... OK
Checking RouteOptions... OK
Checking secrets... OK
Checking virtual services... OK
Checking gateways... OK
Checking proxies... Skipping due to an error in checking deployments
Checking Secrets... OK
Checking VirtualServices... OK
Checking Gateways... OK
Checking Proxies... Skipping due to an error in checking deployments
Skipping due to an error in checking deployments
Error: 5 errors occurred:
* Deployment gloo in namespace gloo-system is not available! Message: Deployment does not have minimum availability.
Expand Down
36 changes: 18 additions & 18 deletions projects/gloo/cli/pkg/cmd/check/gloo_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/golang/protobuf/jsonpb"
"github.com/solo-io/gloo/projects/gloo/cli/pkg/cmd/options"
"github.com/solo-io/gloo/projects/gloo/cli/pkg/constants"
"github.com/solo-io/gloo/projects/gloo/cli/pkg/helpers"
"github.com/solo-io/gloo/projects/gloo/cli/pkg/printers"
glooinstancev1 "github.com/solo-io/solo-apis/pkg/api/fed.solo.io/v1"
Expand All @@ -27,10 +28,10 @@ import (
func CheckMulticlusterResources(ctx context.Context, printer printers.P, opts *options.Options) {
// check if the gloo fed deployment exists
client := helpers.MustKubeClientWithKubecontext(opts.Top.KubeContext)
_, err := client.AppsV1().Deployments(opts.Metadata.GetNamespace()).Get(ctx, "gloo-fed", metav1.GetOptions{})
_, err := client.AppsV1().Deployments(opts.Metadata.GetNamespace()).Get(ctx, constants.GlooFedDeploymentName, metav1.GetOptions{})
if err != nil {
if apierrors.IsNotFound(err) {
printer.AppendMessage("Skipping Gloo Instance check -- Gloo Federation not detected")
printer.AppendMessage("\nSkipping Gloo Instance check -- Gloo Federation not detected.")
} else {
fmt.Printf("Warning: could not get Gloo Fed deployment: %v. Skipping Gloo Instance check.\n", err)
}
Expand All @@ -51,7 +52,7 @@ func CheckMulticlusterResources(ctx context.Context, printer printers.P, opts *o
glooInstanceList, err := instanceReader.listGlooInstances(ctx)
if err != nil {
if meta.IsNoMatchError(err) {
printer.AppendMessage("Skipping Gloo Instance check -- Gloo Federation not detected")
printer.AppendMessage("Skipping Gloo Instance check -- Gloo Federation not detected.")
return
}
fmt.Printf("Warning: could not list Gloo Instances: %v\n", err)
Expand All @@ -60,16 +61,19 @@ func CheckMulticlusterResources(ctx context.Context, printer printers.P, opts *o
printer.AppendMessage("\nDetected Gloo Federation!")
for _, glooInstance := range glooInstanceList.Items {
fmt.Printf("\nChecking Gloo Instance %s... ", glooInstance.GetName())
printGlooInstanceCheckSummary("deployments", glooInstance.Spec.GetCheck().GetDeployments())
printGlooInstanceCheckSummary("pods", glooInstance.Spec.GetCheck().GetPods())
printGlooInstanceCheckSummary("settings", glooInstance.Spec.GetCheck().GetSettings())
printGlooInstanceCheckSummary("upstreams", glooInstance.Spec.GetCheck().GetUpstreams())
printGlooInstanceCheckSummary("upstream groups", glooInstance.Spec.GetCheck().GetUpstreamGroups())
printGlooInstanceCheckSummary("auth configs", glooInstance.Spec.GetCheck().GetAuthConfigs())
printGlooInstanceCheckSummary("virtual services", glooInstance.Spec.GetCheck().GetVirtualServices())
printGlooInstanceCheckSummary("route tables", glooInstance.Spec.GetCheck().GetRouteTables())
printGlooInstanceCheckSummary("gateways", glooInstance.Spec.GetCheck().GetGateways())
printGlooInstanceCheckSummary("proxies", glooInstance.Spec.GetCheck().GetProxies())
printGlooInstanceCheckSummary("Deployments", glooInstance.Spec.GetCheck().GetDeployments())
printGlooInstanceCheckSummary("Pods", glooInstance.Spec.GetCheck().GetPods())
printGlooInstanceCheckSummary("Settings", glooInstance.Spec.GetCheck().GetSettings())
printGlooInstanceCheckSummary("Upstreams", glooInstance.Spec.GetCheck().GetUpstreams())
printGlooInstanceCheckSummary("UpstreamGroups", glooInstance.Spec.GetCheck().GetUpstreamGroups())
printGlooInstanceCheckSummary("AuthConfigs", glooInstance.Spec.GetCheck().GetAuthConfigs())
printGlooInstanceCheckSummary("RateLimitConfigs", glooInstance.Spec.GetCheck().GetRateLimitConfigs())
printGlooInstanceCheckSummary("VirtualServices", glooInstance.Spec.GetCheck().GetVirtualServices())
printGlooInstanceCheckSummary("RouteTables", glooInstance.Spec.GetCheck().GetRouteTables())
printGlooInstanceCheckSummary("Gateways", glooInstance.Spec.GetCheck().GetGateways())
printGlooInstanceCheckSummary("MatchableHttpGateways", glooInstance.Spec.GetCheck().GetMatchableHttpGateways())
davidjumani marked this conversation as resolved.
Show resolved Hide resolved
printGlooInstanceCheckSummary("MatchableTcpGateways", glooInstance.Spec.GetCheck().GetMatchableTcpGateways())
printGlooInstanceCheckSummary("Proxies", glooInstance.Spec.GetCheck().GetProxies())
fmt.Printf("\n\n")
}
}
Expand Down Expand Up @@ -101,12 +105,8 @@ type unstructuredGlooInstanceReader struct {
}

func getUnstructuredGlooInstanceReader(cfg *rest.Config) (*unstructuredGlooInstanceReader, error) {
scheme := scheme.Scheme
davidjumani marked this conversation as resolved.
Show resolved Hide resolved
if err := glooinstancev1.AddToScheme(scheme); err != nil {
return nil, err
}
client, err := client.New(cfg, client.Options{
Scheme: scheme,
Scheme: scheme.Scheme,
})
if err != nil {
return nil, err
Expand Down
Loading
Loading