Skip to content

Commit 1ca75e1

Browse files
committed
Merge branch 'master' of github.com:apache/apisix-ingress-controller into revolyssup/tcpudproute
2 parents 1fd1544 + 5107775 commit 1ca75e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+20177
-270
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ GATEAY_API_VERSION ?= v1.3.0
5555
SUPPORTED_EXTENDED_FEATURES = "HTTPRouteDestinationPortMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteRequestMirror,HTTPRouteSchemeRedirect,GatewayAddressEmpty,HTTPRouteResponseHeaderModification,GatewayPort8080"
5656
CONFORMANCE_TEST_REPORT_OUTPUT ?= $(DIR)/apisix-ingress-controller-conformance-report.yaml
5757
## https://github.com/kubernetes-sigs/gateway-api/blob/v1.3.0/conformance/utils/suite/profiles.go
58-
CONFORMANCE_PROFILES ?= GATEWAY-HTTP
58+
CONFORMANCE_PROFILES ?= GATEWAY-HTTP,GATEWAY-GRPC
5959

6060
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6161
ifeq (,$(shell go env GOBIN))

PROJECT

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# This file is used to track the info used to scaffold your project
33
# and allow the plugins properly work.
44
# More info: https://book.kubebuilder.io/reference/project-config.html
5-
domain: github.com
65
layout:
76
- go.kubebuilder.io/v4
87
projectName: apisix-ingress-controller
@@ -12,24 +11,13 @@ resources:
1211
crdVersion: v1
1312
namespaced: true
1413
controller: true
15-
domain: github.com
16-
group: apisix.apache.org
17-
kind: Guestbook
18-
path: github.com/apache/apisix-ingress-controller/api/v1alpha1
19-
version: v1alpha1
20-
- api:
21-
crdVersion: v1
22-
namespaced: true
23-
controller: true
24-
domain: github.com
2514
group: apisix.apache.org
2615
kind: GatewayProxy
2716
path: github.com/apache/apisix-ingress-controller/api/v1alpha1
2817
version: v1alpha1
2918
- api:
3019
crdVersion: v1
3120
namespaced: true
32-
domain: github.com
3321
group: apisix.apache.org
3422
kind: HTTPRoutePolicy
3523
path: github.com/apache/apisix-ingress-controller/api/v1alpha1
@@ -38,7 +26,6 @@ resources:
3826
crdVersion: v1
3927
namespaced: true
4028
controller: true
41-
domain: github.com
4229
group: apisix.apache.org
4330
kind: ApisixRoute
4431
path: github.com/apache/apisix-ingress-controller/api/v2
@@ -47,7 +34,6 @@ resources:
4734
crdVersion: v1
4835
namespaced: true
4936
controller: true
50-
domain: github.com
5137
group: apisix.apache.org
5238
kind: ApisixConsumer
5339
path: github.com/apache/apisix-ingress-controller/api/v2
@@ -56,7 +42,6 @@ resources:
5642
crdVersion: v1
5743
namespaced: true
5844
controller: true
59-
domain: github.com
6045
group: apisix.apache.org
6146
kind: ApisixGlobalRule
6247
path: github.com/apache/apisix-ingress-controller/api/v2
@@ -65,7 +50,6 @@ resources:
6550
crdVersion: v1
6651
namespaced: true
6752
controller: true
68-
domain: github.com
6953
group: apisix.apache.org
7054
kind: ApisixTls
7155
path: github.com/apache/apisix-ingress-controller/api/v2
@@ -74,17 +58,24 @@ resources:
7458
crdVersion: v1
7559
namespaced: true
7660
controller: true
77-
domain: github.com
7861
group: apisix.apache.org
7962
kind: ApisixUpstream
8063
path: github.com/apache/apisix-ingress-controller/api/v2
8164
version: v2
8265
- api:
8366
crdVersion: v1
8467
namespaced: true
85-
domain: github.com
8668
group: apisix.apache.org
8769
kind: ApisixPluginConfig
8870
path: github.com/apache/apisix-ingress-controller/api/v2
8971
version: v2
72+
- core: true
73+
domain: k8s.io
74+
group: networking
75+
kind: Ingress
76+
path: k8s.io/api/networking/v1
77+
version: v1
78+
webhooks:
79+
validation: true
80+
webhookVersion: v1
9081
version: "3"

api/adc/types.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,6 @@ const (
344344

345345
type Scheme string
346346

347-
const (
348-
SchemeHTTP = "http"
349-
)
350-
351347
type UpstreamType string
352348

353349
const (
@@ -519,11 +515,13 @@ func ComposeServiceNameWithRule(namespace, name string, rule string) string {
519515
return buf.String()
520516
}
521517

522-
func ComposeServiceNameWithStream(namespace, name string, rule string) string {
523-
// FIXME Use sync.Pool to reuse this buffer if the upstream
524-
// name composing code path is hot.
518+
func ComposeGRPCServiceNameWithRule(namespace, name string, rule string) string {
519+
return ComposeServicesNameWithScheme(namespace, name, rule, "grpc")
520+
}
521+
522+
func ComposeServicesNameWithScheme(namespace, name string, rule string, scheme string) string {
525523
var p []byte
526-
plen := len(namespace) + len(name) + 6
524+
plen := len(namespace) + len(name) + len(rule) + len(scheme) + 3
527525

528526
p = make([]byte, 0, plen)
529527
buf := bytes.NewBuffer(p)
@@ -532,11 +530,16 @@ func ComposeServiceNameWithStream(namespace, name string, rule string) string {
532530
buf.WriteString(name)
533531
buf.WriteByte('_')
534532
buf.WriteString(rule)
535-
buf.WriteString("_stream")
533+
buf.WriteByte('_')
534+
buf.WriteString(scheme)
536535

537536
return buf.String()
538537
}
539538

539+
func ComposeServiceNameWithStream(namespace, name string, rule string) string {
540+
return ComposeServicesNameWithScheme(namespace, name, rule, "stream")
541+
}
542+
540543
func ComposeConsumerName(namespace, name string) string {
541544
// FIXME Use sync.Pool to reuse this buffer if the upstream
542545
// name composing code path is hot.
@@ -569,9 +572,8 @@ func NewDefaultUpstream() *Upstream {
569572
"managed-by": "apisix-ingress-controller",
570573
},
571574
},
572-
Nodes: make(UpstreamNodes, 0),
573-
Scheme: SchemeHTTP,
574-
Type: Roundrobin,
575+
Nodes: make(UpstreamNodes, 0),
576+
Type: Roundrobin,
575577
}
576578
}
577579

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# The following manifests contain a self-signed issuer CR and a metrics certificate CR.
2+
# More document can be found at https://docs.cert-manager.io
3+
apiVersion: cert-manager.io/v1
4+
kind: Certificate
5+
metadata:
6+
labels:
7+
app.kubernetes.io/name: apisix-ingress-controller
8+
app.kubernetes.io/managed-by: kustomize
9+
name: metrics-certs # this name should match the one appeared in kustomizeconfig.yaml
10+
namespace: system
11+
spec:
12+
dnsNames:
13+
# SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
14+
# replacements in the config/default/kustomization.yaml file.
15+
- SERVICE_NAME.SERVICE_NAMESPACE.svc
16+
- SERVICE_NAME.SERVICE_NAMESPACE.svc.cluster.local
17+
issuerRef:
18+
kind: Issuer
19+
name: selfsigned-issuer
20+
secretName: metrics-server-cert
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# The following manifests contain a self-signed issuer CR and a certificate CR.
2+
# More document can be found at https://docs.cert-manager.io
3+
apiVersion: cert-manager.io/v1
4+
kind: Certificate
5+
metadata:
6+
labels:
7+
app.kubernetes.io/name: apisix-ingress-controller
8+
app.kubernetes.io/managed-by: kustomize
9+
name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
10+
namespace: system
11+
spec:
12+
# SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
13+
# replacements in the config/default/kustomization.yaml file.
14+
dnsNames:
15+
- SERVICE_NAME.SERVICE_NAMESPACE.svc
16+
- SERVICE_NAME.SERVICE_NAMESPACE.svc.cluster.local
17+
issuerRef:
18+
kind: Issuer
19+
name: selfsigned-issuer
20+
secretName: webhook-server-cert

config/certmanager/issuer.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# The following manifest contains a self-signed issuer CR.
2+
# More information can be found at https://docs.cert-manager.io
3+
# WARNING: Targets CertManager v1.0. Check https://cert-manager.io/docs/installation/upgrading/ for breaking changes.
4+
apiVersion: cert-manager.io/v1
5+
kind: Issuer
6+
metadata:
7+
labels:
8+
app.kubernetes.io/name: apisix-ingress-controller
9+
app.kubernetes.io/managed-by: kustomize
10+
name: selfsigned-issuer
11+
namespace: system
12+
spec:
13+
selfSigned: {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resources:
2+
- issuer.yaml
3+
- certificate-webhook.yaml
4+
- certificate-metrics.yaml
5+
6+
configurations:
7+
- kustomizeconfig.yaml
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This configuration is for teaching kustomize how to update name ref substitution
2+
nameReference:
3+
- kind: Issuer
4+
group: cert-manager.io
5+
fieldSpecs:
6+
- kind: Certificate
7+
group: cert-manager.io
8+
path: spec/issuerRef/name

config/crd/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ patches:
4242
# [WEBHOOK] To enable webhook, uncomment the following section
4343
# the following config is for teaching kustomize how to do kustomization for CRDs.
4444

45-
#configurations:
46-
#- kustomizeconfig.yaml
45+
configurations:
46+
- kustomizeconfig.yaml

0 commit comments

Comments
 (0)