mirror of
https://github.com/alibaba/higress.git
synced 2026-05-28 06:37:26 +08:00
Feat https fallback (#1020)
This commit is contained in:
6
go.mod
6
go.mod
@@ -259,7 +259,6 @@ require (
|
|||||||
golang.org/x/crypto v0.17.0 // indirect
|
golang.org/x/crypto v0.17.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
|
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
|
||||||
golang.org/x/mod v0.11.0 // indirect
|
golang.org/x/mod v0.11.0 // indirect
|
||||||
golang.org/x/net v0.17.0 // indirect
|
|
||||||
golang.org/x/oauth2 v0.6.0 // indirect
|
golang.org/x/oauth2 v0.6.0 // indirect
|
||||||
golang.org/x/sync v0.3.0 // indirect
|
golang.org/x/sync v0.3.0 // indirect
|
||||||
golang.org/x/sys v0.15.0 // indirect
|
golang.org/x/sys v0.15.0 // indirect
|
||||||
@@ -281,6 +280,8 @@ require (
|
|||||||
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
|
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
|
||||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||||
k8s.io/apiserver v0.22.5 // indirect
|
k8s.io/apiserver v0.22.5 // indirect
|
||||||
|
k8s.io/component-base v0.22.5 // indirect
|
||||||
|
k8s.io/klog/v2 v2.60.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect
|
k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect
|
||||||
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
|
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
|
||||||
oras.land/oras-go v0.4.0 // indirect
|
oras.land/oras-go v0.4.0 // indirect
|
||||||
@@ -312,10 +313,9 @@ require (
|
|||||||
github.com/kylelemons/godebug v1.1.0
|
github.com/kylelemons/godebug v1.1.0
|
||||||
github.com/mholt/acmez v1.2.0
|
github.com/mholt/acmez v1.2.0
|
||||||
github.com/tidwall/gjson v1.17.0
|
github.com/tidwall/gjson v1.17.0
|
||||||
|
golang.org/x/net v0.17.0
|
||||||
helm.sh/helm/v3 v3.7.1
|
helm.sh/helm/v3 v3.7.1
|
||||||
k8s.io/apiextensions-apiserver v0.25.4
|
k8s.io/apiextensions-apiserver v0.25.4
|
||||||
k8s.io/component-base v0.22.5
|
|
||||||
k8s.io/klog/v2 v2.60.1
|
|
||||||
knative.dev/networking v0.0.0-20220302134042-e8b2eb995165
|
knative.dev/networking v0.0.0-20220302134042-e8b2eb995165
|
||||||
knative.dev/pkg v0.0.0-20220301181942-2fdd5f232e77
|
knative.dev/pkg v0.0.0-20220301181942-2fdd5f232e77
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const (
|
|||||||
// Config is the configuration of automatic https.
|
// Config is the configuration of automatic https.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
AutomaticHttps bool `json:"automaticHttps"`
|
AutomaticHttps bool `json:"automaticHttps"`
|
||||||
|
FallbackForInvalidSecret bool `json:"fallbackForInvalidSecret"`
|
||||||
RenewBeforeDays int `json:"renewBeforeDays"`
|
RenewBeforeDays int `json:"renewBeforeDays"`
|
||||||
CredentialConfig []CredentialEntry `json:"credentialConfig"`
|
CredentialConfig []CredentialEntry `json:"credentialConfig"`
|
||||||
ACMEIssuer []ACMEIssuerEntry `json:"acmeIssuer"`
|
ACMEIssuer []ACMEIssuerEntry `json:"acmeIssuer"`
|
||||||
@@ -275,6 +276,7 @@ func newDefaultConfig(email string) *Config {
|
|||||||
defaultCredentialConfig := make([]CredentialEntry, 0)
|
defaultCredentialConfig := make([]CredentialEntry, 0)
|
||||||
config := &Config{
|
config := &Config{
|
||||||
AutomaticHttps: true,
|
AutomaticHttps: true,
|
||||||
|
FallbackForInvalidSecret: false,
|
||||||
RenewBeforeDays: DefaultRenewBeforeDays,
|
RenewBeforeDays: DefaultRenewBeforeDays,
|
||||||
ACMEIssuer: defaultIssuer,
|
ACMEIssuer: defaultIssuer,
|
||||||
CredentialConfig: defaultCredentialConfig,
|
CredentialConfig: defaultCredentialConfig,
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import (
|
|||||||
higressv1 "github.com/alibaba/higress/api/networking/v1"
|
higressv1 "github.com/alibaba/higress/api/networking/v1"
|
||||||
extlisterv1 "github.com/alibaba/higress/client/pkg/listers/extensions/v1alpha1"
|
extlisterv1 "github.com/alibaba/higress/client/pkg/listers/extensions/v1alpha1"
|
||||||
netlisterv1 "github.com/alibaba/higress/client/pkg/listers/networking/v1"
|
netlisterv1 "github.com/alibaba/higress/client/pkg/listers/networking/v1"
|
||||||
|
"github.com/alibaba/higress/pkg/cert"
|
||||||
"github.com/alibaba/higress/pkg/ingress/kube/annotations"
|
"github.com/alibaba/higress/pkg/ingress/kube/annotations"
|
||||||
"github.com/alibaba/higress/pkg/ingress/kube/common"
|
"github.com/alibaba/higress/pkg/ingress/kube/common"
|
||||||
"github.com/alibaba/higress/pkg/ingress/kube/configmap"
|
"github.com/alibaba/higress/pkg/ingress/kube/configmap"
|
||||||
@@ -144,6 +145,8 @@ type IngressConfig struct {
|
|||||||
namespace string
|
namespace string
|
||||||
|
|
||||||
clusterId string
|
clusterId string
|
||||||
|
|
||||||
|
httpsConfigMgr *cert.ConfigMgr
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewIngressConfig(localKubeClient kube.Client, XDSUpdater model.XDSUpdater, namespace, clusterId string) *IngressConfig {
|
func NewIngressConfig(localKubeClient kube.Client, XDSUpdater model.XDSUpdater, namespace, clusterId string) *IngressConfig {
|
||||||
@@ -180,6 +183,9 @@ func NewIngressConfig(localKubeClient kube.Client, XDSUpdater model.XDSUpdater,
|
|||||||
higressConfigController := configmap.NewController(localKubeClient, clusterId, namespace)
|
higressConfigController := configmap.NewController(localKubeClient, clusterId, namespace)
|
||||||
config.configmapMgr = configmap.NewConfigmapMgr(XDSUpdater, namespace, higressConfigController, higressConfigController.Lister())
|
config.configmapMgr = configmap.NewConfigmapMgr(XDSUpdater, namespace, higressConfigController, higressConfigController.Lister())
|
||||||
|
|
||||||
|
httpsConfigMgr, _ := cert.NewConfigMgr(namespace, localKubeClient)
|
||||||
|
config.httpsConfigMgr = httpsConfigMgr
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,6 +353,10 @@ func (m *IngressConfig) convertGateways(configs []common.WrapperConfig) []config
|
|||||||
Gateways: map[string]*common.WrapperGateway{},
|
Gateways: map[string]*common.WrapperGateway{},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
httpsCredentialConfig, err := m.httpsConfigMgr.GetConfigFromConfigmap()
|
||||||
|
if err != nil {
|
||||||
|
IngressLog.Errorf("Get higress https configmap err %v", err)
|
||||||
|
}
|
||||||
for idx := range configs {
|
for idx := range configs {
|
||||||
cfg := configs[idx]
|
cfg := configs[idx]
|
||||||
clusterId := common.GetClusterId(cfg.Config.Annotations)
|
clusterId := common.GetClusterId(cfg.Config.Annotations)
|
||||||
@@ -356,7 +366,7 @@ func (m *IngressConfig) convertGateways(configs []common.WrapperConfig) []config
|
|||||||
if ingressController == nil {
|
if ingressController == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err := ingressController.ConvertGateway(&convertOptions, &cfg); err != nil {
|
if err := ingressController.ConvertGateway(&convertOptions, &cfg, httpsCredentialConfig); err != nil {
|
||||||
IngressLog.Errorf("Convert ingress %s/%s to gateway fail in cluster %s, err %v", cfg.Config.Namespace, cfg.Config.Name, clusterId, err)
|
IngressLog.Errorf("Convert ingress %s/%s to gateway fail in cluster %s, err %v", cfg.Config.Namespace, cfg.Config.Name, clusterId, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ package common
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/alibaba/higress/pkg/cert"
|
||||||
|
"github.com/alibaba/higress/pkg/ingress/kube/annotations"
|
||||||
networking "istio.io/api/networking/v1alpha3"
|
networking "istio.io/api/networking/v1alpha3"
|
||||||
"istio.io/istio/pilot/pkg/model"
|
"istio.io/istio/pilot/pkg/model"
|
||||||
"istio.io/istio/pkg/config"
|
"istio.io/istio/pkg/config"
|
||||||
gatewaytool "istio.io/istio/pkg/config/gateway"
|
gatewaytool "istio.io/istio/pkg/config/gateway"
|
||||||
listerv1 "k8s.io/client-go/listers/core/v1"
|
listerv1 "k8s.io/client-go/listers/core/v1"
|
||||||
"k8s.io/client-go/tools/cache"
|
"k8s.io/client-go/tools/cache"
|
||||||
|
|
||||||
"github.com/alibaba/higress/pkg/ingress/kube/annotations"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServiceKey struct {
|
type ServiceKey struct {
|
||||||
@@ -121,7 +121,7 @@ type IngressController interface {
|
|||||||
|
|
||||||
SecretLister() listerv1.SecretLister
|
SecretLister() listerv1.SecretLister
|
||||||
|
|
||||||
ConvertGateway(convertOptions *ConvertOptions, wrapper *WrapperConfig) error
|
ConvertGateway(convertOptions *ConvertOptions, wrapper *WrapperConfig, httpsCredentialConfig *cert.Config) error
|
||||||
|
|
||||||
ConvertHTTPRoute(convertOptions *ConvertOptions, wrapper *WrapperConfig) error
|
ConvertHTTPRoute(convertOptions *ConvertOptions, wrapper *WrapperConfig) error
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ import (
|
|||||||
"github.com/alibaba/higress/pkg/ingress/kube/secret"
|
"github.com/alibaba/higress/pkg/ingress/kube/secret"
|
||||||
"github.com/alibaba/higress/pkg/ingress/kube/util"
|
"github.com/alibaba/higress/pkg/ingress/kube/util"
|
||||||
. "github.com/alibaba/higress/pkg/ingress/log"
|
. "github.com/alibaba/higress/pkg/ingress/log"
|
||||||
|
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -87,8 +88,6 @@ type controller struct {
|
|||||||
secretController secret.SecretController
|
secretController secret.SecretController
|
||||||
|
|
||||||
statusSyncer *statusSyncer
|
statusSyncer *statusSyncer
|
||||||
|
|
||||||
configMgr *cert.ConfigMgr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewController creates a new Kubernetes controller
|
// NewController creates a new Kubernetes controller
|
||||||
@@ -107,7 +106,6 @@ func NewController(localKubeClient, client kubeclient.Client, options common.Opt
|
|||||||
IngressLog.Infof("Skipping IngressClass, resource not supported for cluster %s", options.ClusterId)
|
IngressLog.Infof("Skipping IngressClass, resource not supported for cluster %s", options.ClusterId)
|
||||||
}
|
}
|
||||||
|
|
||||||
configMgr, _ := cert.NewConfigMgr(options.SystemNamespace, client.Kube())
|
|
||||||
c := &controller{
|
c := &controller{
|
||||||
options: options,
|
options: options,
|
||||||
queue: q,
|
queue: q,
|
||||||
@@ -118,7 +116,6 @@ func NewController(localKubeClient, client kubeclient.Client, options common.Opt
|
|||||||
serviceInformer: serviceInformer.Informer(),
|
serviceInformer: serviceInformer.Informer(),
|
||||||
serviceLister: serviceInformer.Lister(),
|
serviceLister: serviceInformer.Lister(),
|
||||||
secretController: secretController,
|
secretController: secretController,
|
||||||
configMgr: configMgr,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handler := controllers.LatestVersionHandlerFuncs(controllers.EnqueueForSelf(q))
|
handler := controllers.LatestVersionHandlerFuncs(controllers.EnqueueForSelf(q))
|
||||||
@@ -354,7 +351,7 @@ func extractTLSSecretName(host string, tls []ingress.IngressTLS) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *controller) ConvertGateway(convertOptions *common.ConvertOptions, wrapper *common.WrapperConfig) error {
|
func (c *controller) ConvertGateway(convertOptions *common.ConvertOptions, wrapper *common.WrapperConfig, httpsCredentialConfig *cert.Config) error {
|
||||||
if convertOptions == nil {
|
if convertOptions == nil {
|
||||||
return fmt.Errorf("convertOptions is nil")
|
return fmt.Errorf("convertOptions is nil")
|
||||||
}
|
}
|
||||||
@@ -377,7 +374,6 @@ func (c *controller) ConvertGateway(convertOptions *common.ConvertOptions, wrapp
|
|||||||
common.IncrementInvalidIngress(c.options.ClusterId, common.EmptyRule)
|
common.IncrementInvalidIngress(c.options.ClusterId, common.EmptyRule)
|
||||||
return fmt.Errorf("invalid ingress rule %s:%s in cluster %s, either `defaultBackend` or `rules` must be specified", cfg.Namespace, cfg.Name, c.options.ClusterId)
|
return fmt.Errorf("invalid ingress rule %s:%s in cluster %s, either `defaultBackend` or `rules` must be specified", cfg.Namespace, cfg.Name, c.options.ClusterId)
|
||||||
}
|
}
|
||||||
httpsCredentialConfig, _ := c.configMgr.GetConfigFromConfigmap()
|
|
||||||
for _, rule := range ingressV1Beta.Rules {
|
for _, rule := range ingressV1Beta.Rules {
|
||||||
// Need create builder for every rule.
|
// Need create builder for every rule.
|
||||||
domainBuilder := &common.IngressDomainBuilder{
|
domainBuilder := &common.IngressDomainBuilder{
|
||||||
@@ -429,11 +425,24 @@ func (c *controller) ConvertGateway(convertOptions *common.ConvertOptions, wrapp
|
|||||||
// Get tls secret matching the rule host
|
// Get tls secret matching the rule host
|
||||||
secretName := extractTLSSecretName(rule.Host, ingressV1Beta.TLS)
|
secretName := extractTLSSecretName(rule.Host, ingressV1Beta.TLS)
|
||||||
secretNamespace := cfg.Namespace
|
secretNamespace := cfg.Namespace
|
||||||
|
if secretName != "" {
|
||||||
|
if httpsCredentialConfig != nil && httpsCredentialConfig.FallbackForInvalidSecret {
|
||||||
|
_, err := c.secretController.Lister().Secrets(secretNamespace).Get(secretName)
|
||||||
|
if err != nil {
|
||||||
|
if k8serrors.IsNotFound(err) {
|
||||||
// If there is no matching secret, try to get it from configmap.
|
// If there is no matching secret, try to get it from configmap.
|
||||||
if secretName == "" && httpsCredentialConfig != nil {
|
|
||||||
secretName = httpsCredentialConfig.MatchSecretNameByDomain(rule.Host)
|
secretName = httpsCredentialConfig.MatchSecretNameByDomain(rule.Host)
|
||||||
secretNamespace = c.options.SystemNamespace
|
secretNamespace = c.options.SystemNamespace
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If there is no matching secret, try to get it from configmap.
|
||||||
|
if httpsCredentialConfig != nil {
|
||||||
|
secretName = httpsCredentialConfig.MatchSecretNameByDomain(rule.Host)
|
||||||
|
secretNamespace = c.options.SystemNamespace
|
||||||
|
}
|
||||||
|
}
|
||||||
if secretName == "" {
|
if secretName == "" {
|
||||||
// There no matching secret, so just skip.
|
// There no matching secret, so just skip.
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ func testConvertGateway(t *testing.T, c common.IngressController) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, testcase := range testcases {
|
for _, testcase := range testcases {
|
||||||
err := c.ConvertGateway(testcase.input.options, testcase.input.wrapperConfig)
|
err := c.ConvertGateway(testcase.input.options, testcase.input.wrapperConfig, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
require.Equal(t, testcase.expectNoError, false)
|
require.Equal(t, testcase.expectNoError, false)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import (
|
|||||||
"github.com/alibaba/higress/pkg/ingress/kube/secret"
|
"github.com/alibaba/higress/pkg/ingress/kube/secret"
|
||||||
"github.com/alibaba/higress/pkg/ingress/kube/util"
|
"github.com/alibaba/higress/pkg/ingress/kube/util"
|
||||||
. "github.com/alibaba/higress/pkg/ingress/log"
|
. "github.com/alibaba/higress/pkg/ingress/log"
|
||||||
|
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -85,8 +86,6 @@ type controller struct {
|
|||||||
secretController secret.SecretController
|
secretController secret.SecretController
|
||||||
|
|
||||||
statusSyncer *statusSyncer
|
statusSyncer *statusSyncer
|
||||||
|
|
||||||
configMgr *cert.ConfigMgr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewController creates a new Kubernetes controller
|
// NewController creates a new Kubernetes controller
|
||||||
@@ -99,7 +98,6 @@ func NewController(localKubeClient, client kubeclient.Client, options common.Opt
|
|||||||
classes := client.KubeInformer().Networking().V1().IngressClasses()
|
classes := client.KubeInformer().Networking().V1().IngressClasses()
|
||||||
classes.Informer()
|
classes.Informer()
|
||||||
|
|
||||||
configMgr, _ := cert.NewConfigMgr(options.SystemNamespace, client.Kube())
|
|
||||||
c := &controller{
|
c := &controller{
|
||||||
options: options,
|
options: options,
|
||||||
queue: q,
|
queue: q,
|
||||||
@@ -110,7 +108,6 @@ func NewController(localKubeClient, client kubeclient.Client, options common.Opt
|
|||||||
serviceInformer: serviceInformer.Informer(),
|
serviceInformer: serviceInformer.Informer(),
|
||||||
serviceLister: serviceInformer.Lister(),
|
serviceLister: serviceInformer.Lister(),
|
||||||
secretController: secretController,
|
secretController: secretController,
|
||||||
configMgr: configMgr,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handler := controllers.LatestVersionHandlerFuncs(controllers.EnqueueForSelf(q))
|
handler := controllers.LatestVersionHandlerFuncs(controllers.EnqueueForSelf(q))
|
||||||
@@ -346,7 +343,7 @@ func extractTLSSecretName(host string, tls []ingress.IngressTLS) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *controller) ConvertGateway(convertOptions *common.ConvertOptions, wrapper *common.WrapperConfig) error {
|
func (c *controller) ConvertGateway(convertOptions *common.ConvertOptions, wrapper *common.WrapperConfig, httpsCredentialConfig *cert.Config) error {
|
||||||
// Ignore canary config.
|
// Ignore canary config.
|
||||||
if wrapper.AnnotationsConfig.IsCanary() {
|
if wrapper.AnnotationsConfig.IsCanary() {
|
||||||
return nil
|
return nil
|
||||||
@@ -363,7 +360,6 @@ func (c *controller) ConvertGateway(convertOptions *common.ConvertOptions, wrapp
|
|||||||
return fmt.Errorf("invalid ingress rule %s:%s in cluster %s, either `defaultBackend` or `rules` must be specified", cfg.Namespace, cfg.Name, c.options.ClusterId)
|
return fmt.Errorf("invalid ingress rule %s:%s in cluster %s, either `defaultBackend` or `rules` must be specified", cfg.Namespace, cfg.Name, c.options.ClusterId)
|
||||||
}
|
}
|
||||||
|
|
||||||
httpsCredentialConfig, _ := c.configMgr.GetConfigFromConfigmap()
|
|
||||||
for _, rule := range ingressV1.Rules {
|
for _, rule := range ingressV1.Rules {
|
||||||
// Need create builder for every rule.
|
// Need create builder for every rule.
|
||||||
domainBuilder := &common.IngressDomainBuilder{
|
domainBuilder := &common.IngressDomainBuilder{
|
||||||
@@ -415,11 +411,25 @@ func (c *controller) ConvertGateway(convertOptions *common.ConvertOptions, wrapp
|
|||||||
// Get tls secret matching the rule host
|
// Get tls secret matching the rule host
|
||||||
secretName := extractTLSSecretName(rule.Host, ingressV1.TLS)
|
secretName := extractTLSSecretName(rule.Host, ingressV1.TLS)
|
||||||
secretNamespace := cfg.Namespace
|
secretNamespace := cfg.Namespace
|
||||||
|
if secretName != "" {
|
||||||
|
if httpsCredentialConfig != nil && httpsCredentialConfig.FallbackForInvalidSecret {
|
||||||
|
_, err := c.secretController.Lister().Secrets(secretNamespace).Get(secretName)
|
||||||
|
if err != nil {
|
||||||
|
if k8serrors.IsNotFound(err) {
|
||||||
// If there is no matching secret, try to get it from configmap.
|
// If there is no matching secret, try to get it from configmap.
|
||||||
if secretName == "" && httpsCredentialConfig != nil {
|
|
||||||
secretName = httpsCredentialConfig.MatchSecretNameByDomain(rule.Host)
|
secretName = httpsCredentialConfig.MatchSecretNameByDomain(rule.Host)
|
||||||
secretNamespace = c.options.SystemNamespace
|
secretNamespace = c.options.SystemNamespace
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If there is no matching secret, try to get it from configmap.
|
||||||
|
if httpsCredentialConfig != nil {
|
||||||
|
secretName = httpsCredentialConfig.MatchSecretNameByDomain(rule.Host)
|
||||||
|
secretNamespace = c.options.SystemNamespace
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if secretName == "" {
|
if secretName == "" {
|
||||||
// There no matching secret, so just skip.
|
// There no matching secret, so just skip.
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -17,11 +17,8 @@ package tests
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/alibaba/higress/test/e2e/conformance/utils/cert"
|
|
||||||
"github.com/alibaba/higress/test/e2e/conformance/utils/http"
|
"github.com/alibaba/higress/test/e2e/conformance/utils/http"
|
||||||
"github.com/alibaba/higress/test/e2e/conformance/utils/kubernetes"
|
|
||||||
"github.com/alibaba/higress/test/e2e/conformance/utils/suite"
|
"github.com/alibaba/higress/test/e2e/conformance/utils/suite"
|
||||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -34,11 +31,6 @@ var ConfigmapHttps = suite.ConformanceTest{
|
|||||||
Manifests: []string{"tests/configmap-https.yaml"},
|
Manifests: []string{"tests/configmap-https.yaml"},
|
||||||
Features: []suite.SupportedFeature{suite.HTTPConformanceFeature},
|
Features: []suite.SupportedFeature{suite.HTTPConformanceFeature},
|
||||||
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
|
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
|
||||||
// Prepare secrets for testcases
|
|
||||||
_, _, caCert, caKey := cert.MustGenerateCaCert(t)
|
|
||||||
svcCertOut, svcKeyOut := cert.MustGenerateCertWithCA(t, cert.ServerCertType, caCert, caKey, []string{"foo.com"})
|
|
||||||
fooSecret := kubernetes.ConstructTLSSecret("higress-system", "foo-com-secret", svcCertOut.Bytes(), svcKeyOut.Bytes())
|
|
||||||
suite.Applier.MustApplyObjectsWithCleanup(t, suite.Client, suite.TimeoutConfig, []client.Object{fooSecret}, suite.Cleanup)
|
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
httpAssert http.Assertion
|
httpAssert http.Assertion
|
||||||
@@ -46,22 +38,80 @@ var ConfigmapHttps = suite.ConformanceTest{
|
|||||||
{
|
{
|
||||||
httpAssert: http.Assertion{
|
httpAssert: http.Assertion{
|
||||||
Meta: http.AssertionMeta{
|
Meta: http.AssertionMeta{
|
||||||
TestCaseName: "test configmap https",
|
TestCaseName: "test configmap bar-com https",
|
||||||
TargetBackend: "infra-backend-v2",
|
TargetBackend: "infra-backend-v2",
|
||||||
TargetNamespace: "higress-conformance-infra",
|
TargetNamespace: "higress-conformance-infra",
|
||||||
},
|
},
|
||||||
Request: http.AssertionRequest{
|
Request: http.AssertionRequest{
|
||||||
ActualRequest: http.Request{
|
ActualRequest: http.Request{
|
||||||
Path: "/foohttps",
|
Path: "/barhttps",
|
||||||
Host: "foo.com",
|
Host: "bar.com",
|
||||||
TLSConfig: &http.TLSConfig{
|
TLSConfig: &http.TLSConfig{
|
||||||
SNI: "foo.com",
|
SNI: "bar.com",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ExpectedRequest: &http.ExpectedRequest{
|
ExpectedRequest: &http.ExpectedRequest{
|
||||||
Request: http.Request{
|
Request: http.Request{
|
||||||
Path: "/foohttps",
|
Path: "/barhttps",
|
||||||
Host: "foo.com",
|
Host: "bar.com",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Response: http.AssertionResponse{
|
||||||
|
ExpectedResponse: http.Response{
|
||||||
|
StatusCode: 200,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
httpAssert: http.Assertion{
|
||||||
|
Meta: http.AssertionMeta{
|
||||||
|
TestCaseName: "test configmap a-foo-com https",
|
||||||
|
TargetBackend: "infra-backend-v2",
|
||||||
|
TargetNamespace: "higress-conformance-infra",
|
||||||
|
},
|
||||||
|
Request: http.AssertionRequest{
|
||||||
|
ActualRequest: http.Request{
|
||||||
|
Path: "/afoohttps",
|
||||||
|
Host: "a.foo.com",
|
||||||
|
TLSConfig: &http.TLSConfig{
|
||||||
|
SNI: "a.foo.com",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ExpectedRequest: &http.ExpectedRequest{
|
||||||
|
Request: http.Request{
|
||||||
|
Path: "/afoohttps",
|
||||||
|
Host: "a.foo.com",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Response: http.AssertionResponse{
|
||||||
|
ExpectedResponse: http.Response{
|
||||||
|
StatusCode: 200,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
httpAssert: http.Assertion{
|
||||||
|
Meta: http.AssertionMeta{
|
||||||
|
TestCaseName: "test configmap b-foo-com https",
|
||||||
|
TargetBackend: "infra-backend-v2",
|
||||||
|
TargetNamespace: "higress-conformance-infra",
|
||||||
|
},
|
||||||
|
Request: http.AssertionRequest{
|
||||||
|
ActualRequest: http.Request{
|
||||||
|
Path: "/bfoohttps",
|
||||||
|
Host: "b.foo.com",
|
||||||
|
TLSConfig: &http.TLSConfig{
|
||||||
|
SNI: "b.foo.com",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ExpectedRequest: &http.ExpectedRequest{
|
||||||
|
Request: http.Request{
|
||||||
|
Path: "/bfoohttps",
|
||||||
|
Host: "b.foo.com",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ data:
|
|||||||
cert: |
|
cert: |
|
||||||
automaticHttps: true
|
automaticHttps: true
|
||||||
renewBeforeDays: 30
|
renewBeforeDays: 30
|
||||||
|
fallbackForInvalidSecret: true
|
||||||
acmeIssuer:
|
acmeIssuer:
|
||||||
- ak: test
|
- ak: test
|
||||||
sk: test
|
sk: test
|
||||||
@@ -34,22 +35,98 @@ data:
|
|||||||
version: test
|
version: test
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
tls.crt: LS0tLS1CRUdJTiBD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GRnd3lpNDNwaHA4S2dBU2FJRXNFU212L1JMZzN4CjVwR2RHNUxMRzRTNWxWOURha1ArNU5FQ2dZQXFkdEh5WXZkVFhWeVpERDFTRGxPSENYb2ZlSmRmZCtOc3FzMlUKd3RLc3U0Y2lFUFZkaEliZnRQdERDT0UrWnlja0F2SnU0SWMxRWFBU3FCZVhzWDFDKzhrc01PQUcvajVXQ1k4Kwp4TXRWNTFGa1UzMC9vdmZlYTlVR2wxRFdFNTJtTUJBMFBjNzlrWFVFN3lMWjNxdnlmMnFsaEoxNlg5MlhUKzYwCjFVL3EvUUtCZ0RQVUxrQ1V3ZElRYXZpTXczUXZjYUZoVGR3dTBJT2hQYWhlWm9kRmdYSXpWUVdZbmovT2lpSTIKK0U2eHhNVGNyY0czTGgwWkFyNTBXaUZKYWpMeUswd042WUVGVWNlcHV0c0ZOQjdEOXFCeStlZWoyVGRCS2kwVwozRTk3cmVjVXdZR3QvdnpPaURiU29zajdWbitCQVFaQnRGOXBCdTJwYzZDaW1Vb1JsOGZjCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: foo-com-secret
|
||||||
|
namespace: higress-system
|
||||||
|
type: kubernetes.io/tls
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURLakNDQWhLZ0F3SUJBZ0lSQVBObk9PUTBvQVJvMHhTN2xKVDJXWHN3RFFZSktvWklodmNOQVFFTEJRQXcKTFRFWk1CY0dBMVVFQ2hNUVNHbG5jbVZ6Y3lCRk1rVWdWR1Z6ZERFUU1BNEdBMVVFQXhNSFpHVm1ZWFZzZERBZQpGdzB5TkRBMU16RXdOVEExTURKYUZ3MHlOVEExTXpFd05UQTFNREphTUMweEdUQVhCZ05WQkFvVEVFaHBaM0psCmMzTWdSVEpG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SDdrQm1JNVMyWkJGa3R0OFoxTEpwT2VUCkU5bmpKd0tCZ1FEYi81VzlhN2Q5Qzc4LzBHWjN6OVg1dnZKYU1YMkF6WDN5d3oydWl6U0sydkZsUnJ2MFZzTUcKZzArcmxGSnlYMGZDZE1wSTFwZUJYZUh4QlZDOXY3VXk3VkN4c3EwVEJVaHdaMTJobUtUVkNRSzBQR0F4dURzOQpLbEcxQXpDOFp6cXI4TWxUY1djaXNWNkhRSG5sc3NOUTBHZVd1NHNuRWxzK3Z6ZUFBLzMyb3c9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: bar-com-secret
|
||||||
|
namespace: higress-conformance-infra
|
||||||
|
type: kubernetes.io/tls
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: httproute-configmap-https
|
name: httproute-bar-configmap-https
|
||||||
namespace: higress-conformance-infra
|
namespace: higress-conformance-infra
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: higress
|
ingressClassName: higress
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- "foo.com"
|
- "bar.com"
|
||||||
|
secretName: bar-com-secret
|
||||||
rules:
|
rules:
|
||||||
- host: "foo.com"
|
- host: "bar.com"
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- pathType: Exact
|
- pathType: Exact
|
||||||
path: "/foohttps"
|
path: "/barhttps"
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: infra-backend-v2
|
||||||
|
port:
|
||||||
|
number: 8080
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: httproute-afoo-configmap-https
|
||||||
|
namespace: higress-conformance-infra
|
||||||
|
spec:
|
||||||
|
ingressClassName: higress
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- "a.foo.com"
|
||||||
|
rules:
|
||||||
|
- host: "a.foo.com"
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- pathType: Exact
|
||||||
|
path: "/afoohttps"
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: infra-backend-v2
|
||||||
|
port:
|
||||||
|
number: 8080
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: httproute-foo2-configmap-https
|
||||||
|
namespace: higress-conformance-infra
|
||||||
|
spec:
|
||||||
|
ingressClassName: higress
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- "b.foo.com"
|
||||||
|
secretName: b-foo-com-secret
|
||||||
|
rules:
|
||||||
|
- host: "b.foo.com"
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- pathType: Exact
|
||||||
|
path: "/bfoohttps"
|
||||||
backend:
|
backend:
|
||||||
service:
|
service:
|
||||||
name: infra-backend-v2
|
name: infra-backend-v2
|
||||||
@@ -59,3 +136,4 @@ spec:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user