Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ GATEAY_API_VERSION ?= v1.3.0
SUPPORTED_EXTENDED_FEATURES = "HTTPRouteDestinationPortMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteRequestMirror,HTTPRouteSchemeRedirect,GatewayAddressEmpty,HTTPRouteResponseHeaderModification,GatewayPort8080"
CONFORMANCE_TEST_REPORT_OUTPUT ?= $(DIR)/apisix-ingress-controller-conformance-report.yaml
## https://github.com/kubernetes-sigs/gateway-api/blob/v1.3.0/conformance/utils/suite/profiles.go
CONFORMANCE_PROFILES ?= GATEWAY-HTTP
CONFORMANCE_PROFILES ?= GATEWAY-HTTP,GATEWAY-GRPC

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down
26 changes: 14 additions & 12 deletions api/adc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,6 @@ const (

type Scheme string

const (
SchemeHTTP = "http"
)

type UpstreamType string

const (
Expand Down Expand Up @@ -518,11 +514,13 @@ func ComposeServiceNameWithRule(namespace, name string, rule string) string {
return buf.String()
}

func ComposeServiceNameWithStream(namespace, name string, rule string) string {
// FIXME Use sync.Pool to reuse this buffer if the upstream
// name composing code path is hot.
func ComposeGRPCServiceNameWithRule(namespace, name string, rule string) string {
return ComposeServicesNameWithScheme(namespace, name, rule, "grpc")
}

func ComposeServicesNameWithScheme(namespace, name string, rule string, scheme string) string {
var p []byte
plen := len(namespace) + len(name) + 6
plen := len(namespace) + len(name) + len(rule) + len(scheme) + 3

p = make([]byte, 0, plen)
buf := bytes.NewBuffer(p)
Expand All @@ -531,11 +529,16 @@ func ComposeServiceNameWithStream(namespace, name string, rule string) string {
buf.WriteString(name)
buf.WriteByte('_')
buf.WriteString(rule)
buf.WriteString("_stream")
buf.WriteByte('_')
buf.WriteString(scheme)

return buf.String()
}

func ComposeServiceNameWithStream(namespace, name string, rule string) string {
return ComposeServicesNameWithScheme(namespace, name, rule, "stream")
}

func ComposeConsumerName(namespace, name string) string {
// FIXME Use sync.Pool to reuse this buffer if the upstream
// name composing code path is hot.
Expand Down Expand Up @@ -568,9 +571,8 @@ func NewDefaultUpstream() *Upstream {
"managed-by": "apisix-ingress-controller",
},
},
Nodes: make(UpstreamNodes, 0),
Scheme: SchemeHTTP,
Type: Roundrobin,
Nodes: make(UpstreamNodes, 0),
Type: Roundrobin,
}
}

Expand Down
21 changes: 4 additions & 17 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ rules:
- gateway.networking.k8s.io
resources:
- gatewayclasses
- gateways
verbs:
- get
- list
Expand All @@ -91,6 +90,7 @@ rules:
resources:
- gatewayclasses/status
- gateways/status
- grpcroutes/status
- httproutes/status
- referencegrants/status
verbs:
Expand All @@ -99,35 +99,22 @@ rules:
- apiGroups:
- gateway.networking.k8s.io
resources:
- gateways
- grpcroutes
- httproutes
verbs:
- get
- list
- watch
- apiGroups:
- gateway.networking.k8s.io
resources:
- referencegrants
verbs:
- list
- update
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingressclasses
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingressclasses
- ingresses
verbs:
- get
- list
- update
- watch
- apiGroups:
- networking.k8s.io
Expand Down
2 changes: 1 addition & 1 deletion docs/en/latest/concepts/gateway-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ By supporting Gateway API, the APISIX Ingress controller can realize richer func
| GatewayClass | Supported | N/A | Not supported | v1 |
| Gateway | Partially supported | Partially supported | Not supported | v1 |
| HTTPRoute | Supported | Partially supported | Not supported | v1 |
| GRPCRoute | Not supported | Not supported | Not supported | v1 |
| GRPCRoute | Supported | Supported | Not supported | v1 |
| ReferenceGrant | Supported | Not supported | Not supported | v1beta1 |
| TLSRoute | Not supported | Not supported | Not supported | v1alpha2 |
| TCPRoute | Not supported | Not supported | Not supported | v1alpha2 |
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ require (
github.com/stretchr/testify v1.10.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
google.golang.org/grpc v1.71.1
gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.15.4
k8s.io/api v0.32.3
Expand Down Expand Up @@ -237,7 +238,6 @@ require (
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/grpc v1.71.1 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
Expand Down
2 changes: 2 additions & 0 deletions internal/adc/translator/apisixroute.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ func (t *Translator) buildUpstream(tctx *provider.TranslateContext, service *adc
upstreamName := adc.ComposeUpstreamName(ar.Namespace, ar.Name, fmt.Sprintf("%d", ruleIndex), fmt.Sprintf("%d", backendIndex))
upstream.Name = upstreamName
upstream.ID = id.GenID(upstreamName)
upstream.Scheme = cmp.Or(upstream.Scheme, apiv2.SchemeHTTP)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the api7ee, it is necessary.

upstreams = append(upstreams, upstream)
}

Expand All @@ -265,6 +266,7 @@ func (t *Translator) buildUpstream(tctx *provider.TranslateContext, service *adc
upstreamName := adc.ComposeExternalUpstreamName(upsNN.Namespace, upsNN.Name)
upstream.Name = upstreamName
upstream.ID = id.GenID(upstreamName)
upstream.Scheme = cmp.Or(upstream.Scheme, apiv2.SchemeHTTP)
upstreams = append(upstreams, upstream)
}

Expand Down
Loading
Loading