Go clients for Solo Enterprise for kgateway.
Note: The clients for the open source kgateway project are not included in this repository.
This is an automatically published staged repository for Solo Enterprise for kgateway. The repository is read-only for importing and is not used for direct contributions.
- The
clientsetpackage contains typed clients for Solo Enterprise for kgateway APIs.
Versioning aligns with Solo Enterprise for kgateway releases, for example v2.x.y.
The HEAD of main in kgateway-client tracks the synced HEAD of main from
Solo Enterprise for kgateway.
Tags in this repository are created by automation and use a leading v
prefix, for example v2.2.0-beta.4.
- The source sync workflow in
solo-io/gloo-gatewayincludesSource-Tagmetadata when a source release tag is being propagated. - Source tag syncs are pushed to per-tag branches such as
sync/tag-2.2.0-beta.10. - This repo's
sync-source-tag-to-release-tag.yamlworkflow reads that metadata from the pushedsync/tag-*commit and creates the matching tag inkgateway-client. - After creating or retargeting the tag, that workflow explicitly dispatches the validation workflows using the created tag as the ref.
- The tag is created from the pushed tag-branch commit in this repository, not from a commit in the source repository.
- If the source metadata does not include a leading
v, the workflow adds it so published tags follow normal Go module tagging conventions. - If a corrected sync for the same source tag is merged later, the workflow can retarget the existing tag to the newer tag-branch commit.
- The
sync/gloo-gateway-clientsetbranch is a long-lived automation branch used to open or update sync PRs againstmain; it is intentionally reused across sync runs and is not auto-deleted after merges. sync/tag-*branches are per-tag automation branches used for validation and tag publication; they are not merged intomain.
This means main can move ahead of the most recent published tag, while tags
identify specific synced release points that are safe to consume from Go.
Use the ref matrix test suite to validate compilation/test health for main and
all repository tags:
make validate-refsThe suite runs go test ./... in isolated git worktrees for each ref and
returns non-zero if any ref fails.
Use the example matrix test suite to compile/test each directory under
examples/ for main and all repository tags:
make validate-examplesUse the example e2e suite to run live-cluster example validation (kind + CRDs)
for main and all repository tags:
make validate-examples-e2eYou can also pass explicit refs:
make validate-refs REFS="main v2.2.0-beta.2 v2.2.0-beta.4"
make validate-examples REFS="main v2.2.0-beta.2 v2.2.0-beta.4"
make validate-examples-e2e REFS="main v2.2.0-beta.4"To get the latest version, use Go 1.16+:
go get github.com/solo-io/kgateway-client/v2@latestTo get a specific version:
go get github.com/solo-io/kgateway-client/v2@v2.2.0-beta.4See INSTALL.md for installation details and troubleshooting.
If your application runs in a Pod in the cluster, use the in-cluster example.
If your application runs outside the cluster, use the out-of-cluster example.
Additional examples are listed in examples/README.md.
Using kgateway-client automatically locks your project to compatible versions
of the kgateway and Gateway API client libraries. Go's Minimum Version Selection
(MVS) ensures you get the correct versions without manual pinning.
You only need to require kgateway-client - transitive dependencies are
resolved automatically:
module your-project
go 1.23
require github.com/solo-io/kgateway-client/v2 v2.2.0-beta.4After go mod tidy, your go.mod will include the resolved dependencies:
require (
github.com/solo-io/kgateway-client/v2 v2.2.0-beta.4
github.com/kgateway-dev/kgateway/v2 v2.3.0-beta.1 // version from kgateway-client
k8s.io/apimachinery v0.34.3
k8s.io/client-go v0.34.1
sigs.k8s.io/gateway-api v1.4.1 // version from kgateway-client
)The kgateway and gateway-api versions are determined by kgateway-client.
When you upgrade kgateway-client, these dependencies update automatically:
go get github.com/solo-io/kgateway-client/v2@v2.2.0-beta.5
go mod tidyUse the Solo Enterprise for kgateway client alongside the upstream kgateway client and Gateway API client:
import (
// Solo Enterprise for kgateway client
entkgatewayclient "github.com/solo-io/kgateway-client/v2/clientset/versioned"
// Upstream kgateway client (version managed by kgateway-client)
kgatewayclient "github.com/kgateway-dev/kgateway/v2/pkg/client/clientset/versioned"
// Gateway API client (version managed by kgateway-client)
gatewayclient "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned"
// Standard k8s
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/clientcmd"
)config, _ := clientcmd.BuildConfigFromFlags("", "~/.kube/config")
// Solo Enterprise for kgateway client
entClient, _ := entkgatewayclient.NewForConfig(config)
entPolicies, _ := entClient.EnterprisekgatewayEnterprisekgateway().
EnterpriseKgatewayTrafficPolicies("default").
List(ctx, metav1.ListOptions{})
// Upstream kgateway client
kgClient, _ := kgatewayclient.NewForConfig(config)
policies, _ := kgClient.GatewayKgateway().
TrafficPolicies("default").
List(ctx, metav1.ListOptions{})
// Gateway API client
gwClient, _ := gatewayclient.NewForConfig(config)
gateways, _ := gwClient.GatewayV1().Gateways("default").List(ctx, metav1.ListOptions{})
routes, _ := gwClient.GatewayV1().HTTPRoutes("default").List(ctx, metav1.ListOptions{})For a runnable end-to-end example that uses all 3 clients together, see examples/multi-client-crud.
For additional installation details and troubleshooting, see INSTALL.md.