Skip to content

Commit

Permalink
no tls for internal services
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelvillard committed Jun 20, 2022
1 parent d690d73 commit 70c66a4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
1 change: 0 additions & 1 deletion config/200-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ rules:
- apiGroups: ["networking.internal.knative.dev"]
resources: ["ingresses/status"]
verbs: ["update"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
4 changes: 0 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ const (
// ListenerPortAnnotationKey is the annotation key for assigning the ingress to a particular
// envoy listener port. Only applicable to internal services.
ListenerPortAnnotationKey = "kourier.knative.dev/listener-port"

// TLSListenerPortAnnotationKey is the annotation key for assigning the ingress to a particular
// envoy listener port for TLS connection. Only applicable to internal services.
TLSListenerPortAnnotationKey = "kourier.knative.dev/listener-tls-port"
)

var disableHTTP2Annotation = kmap.KeyPriority{
Expand Down
5 changes: 2 additions & 3 deletions pkg/generator/caches.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ func (caches *Caches) ToEnvoySnapshot(ctx context.Context) (cache.Snapshot, erro
localVHostsForListener := localVHostsPerListener[translatedIngress.listener].vhost
localVHostsForListener = append(localVHostsForListener, translatedIngress.internalVirtualHosts...)
localVHostsPerListener[translatedIngress.listener] = portVHost{
port: translatedIngress.port,
tlsPort: translatedIngress.tlsPort,
vhost: localVHostsForListener,
port: translatedIngress.port,
vhost: localVHostsForListener,
}
} else {
localVHosts = append(localVHosts, translatedIngress.internalVirtualHosts...)
Expand Down
10 changes: 0 additions & 10 deletions pkg/generator/ingress_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ type translatedIngress struct {
name types.NamespacedName
listener string
port uint32
tlsPort uint32
sniMatches []*envoy.SNIMatch
clusters []*v3.Cluster
externalVirtualHosts []*route.VirtualHost
Expand Down Expand Up @@ -268,7 +267,6 @@ func (translator *IngressTranslator) translateIngress(ctx context.Context, ingre
}
listener := ""
port := uint32(0)
tlsPort := uint32(0)

if config.FromContext(ctx).Kourier.TrafficIsolation == pkgconfig.IsolationIngressPort {
logger.Infof("Getting namespace %v\n", ingress.Namespace)
Expand All @@ -286,13 +284,6 @@ func (translator *IngressTranslator) translateIngress(ctx context.Context, ingre
}
port = uint32(p)
}
if value, ok := ns.Annotations[pkgconfig.TLSListenerPortAnnotationKey]; ok {
p, err := strconv.ParseInt(value, 10, 32)
if err != nil {
return nil, err
}
tlsPort = uint32(p)
}
}

// REVISIT: When neither annotations if found then default to the default behavior (no isolation)
Expand All @@ -305,7 +296,6 @@ func (translator *IngressTranslator) translateIngress(ctx context.Context, ingre
},
listener: listener,
port: port,
tlsPort: tlsPort,
sniMatches: sniMatches,
clusters: clusters,
externalVirtualHosts: externalHosts,
Expand Down

0 comments on commit 70c66a4

Please sign in to comment.