Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved log for tls handling in routes (#3296) #3297

Merged
merged 1 commit into from
Feb 20, 2024
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 pkg/controller/nativeResourceWorker.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (ctlr *Controller) processRoutes(routeGroup string, triggerDelete bool) err
break
}

log.Debugf("Updated Route %s with TLSProfile", rt.ObjectMeta.Name)
log.Debugf("Updated Route %s with TLS", rt.ObjectMeta.Name)
} else {
// handle ab deployment for insecure routes
if isRouteABDeployment(rt) || ctlr.haModeType == Ratio {
Expand Down
6 changes: 5 additions & 1 deletion pkg/controller/resourceConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -2309,6 +2309,7 @@ func (ctlr *Controller) handleRouteTLS(
sslProfileOption := ctlr.getSSLProfileOption(route, policySSLProfiles)
switch sslProfileOption {
case "":
log.Infof("Either TLS spec is not provided for route %v/%v or it's passthrough termination", route.Namespace, route.Name)
break
case PolicySSLOption:
tlsReferenceType = BIGIP
Expand All @@ -2321,6 +2322,7 @@ func (ctlr *Controller) handleRouteTLS(
}
bigIPSSLProfiles.serverSSLs = policySSLProfiles.serverSSLs
}
log.Infof("Policy SSL profiles are given highest priority, using %v with route %v/%v", sslProfileOption, route.Namespace, route.Name)
case AnnotationSSLOption:
if clientSSL, ok := route.ObjectMeta.Annotations[F5ClientSslProfileAnnotation]; ok {
if len(strings.Split(clientSSL, "/")) > 1 {
Expand All @@ -2336,7 +2338,7 @@ func (ctlr *Controller) handleRouteTLS(
}
bigIPSSLProfiles.serverSSLs = append(bigIPSSLProfiles.serverSSLs, serverSSL)
}

log.Infof("Route annotation are given second priority, using %v with route %v/%v", sslProfileOption, route.Namespace, route.Name)
}
case RouteCertificateSSLOption:
tlsReferenceType = Certificate
Expand All @@ -2352,6 +2354,7 @@ func (ctlr *Controller) handleRouteTLS(
if route.Spec.TLS.DestinationCACertificate != "" {
bigIPSSLProfiles.destinationCACertificate = route.Spec.TLS.DestinationCACertificate
}
log.Infof("Route spec certs are given third priority, using %v with route %v/%v", sslProfileOption, route.Namespace, route.Name)
// Set DependsOnTLS to true in case of route certificate and defaultSSLProfile
if ctlr.resources.baseRouteConfig != (cisapiv1.BaseRouteConfig{}) {
//set for default routegroup
Expand Down Expand Up @@ -2383,6 +2386,7 @@ func (ctlr *Controller) handleRouteTLS(
}
bigIPSSLProfiles.serverSSLs = append(bigIPSSLProfiles.serverSSLs, ctlr.resources.baseRouteConfig.DefaultTLS.ServerSSL)
}
log.Infof("Default SSL defined in extended configMap are given least priority, using %v with route %v/%v", sslProfileOption, route.Namespace, route.Name)
// Set DependsOnTLS to true in case of route certificate and defaultSSLProfile
if ctlr.resources.baseRouteConfig != (cisapiv1.BaseRouteConfig{}) {
//Flag to track the route groups which are using TLS Ciphers
Expand Down