Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
efc2989d
Commit
efc2989d
authored
Jun 13, 2017
by
Nick Sardo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final fixes
parent
3ea26e74
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
gce_annotations.go
pkg/cloudprovider/providers/gce/gce_annotations.go
+2
-0
gce_loadbalancer_internal.go
pkg/cloudprovider/providers/gce/gce_loadbalancer_internal.go
+0
-0
gce_loadbalancer_naming.go
pkg/cloudprovider/providers/gce/gce_loadbalancer_naming.go
+9
-2
No files found.
pkg/cloudprovider/providers/gce/gce_annotations.go
View file @
efc2989d
...
@@ -55,6 +55,8 @@ func GetLoadBalancerAnnotationType(service *v1.Service) (LoadBalancerType, bool)
...
@@ -55,6 +55,8 @@ func GetLoadBalancerAnnotationType(service *v1.Service) (LoadBalancerType, bool)
}
}
}
}
// GetLoadBalancerAnnotationBackendShare returns whether this service's backend service should be
// shared with other load balancers. Health checks and the healthcheck firewall will be shared regardless.
func
GetLoadBalancerAnnotationBackendShare
(
service
*
v1
.
Service
)
bool
{
func
GetLoadBalancerAnnotationBackendShare
(
service
*
v1
.
Service
)
bool
{
l
,
exists
:=
service
.
Annotations
[
ServiceAnnotationILBBackendShare
]
l
,
exists
:=
service
.
Annotations
[
ServiceAnnotationILBBackendShare
]
if
exists
&&
l
==
"true"
{
if
exists
&&
l
==
"true"
{
...
...
pkg/cloudprovider/providers/gce/gce_loadbalancer_internal.go
View file @
efc2989d
This diff is collapsed.
Click to expand it.
pkg/cloudprovider/providers/gce/gce_loadbalancer_naming.go
View file @
efc2989d
...
@@ -43,7 +43,14 @@ func makeBackendServiceName(loadBalancerName, clusterID string, shared bool, sch
...
@@ -43,7 +43,14 @@ func makeBackendServiceName(loadBalancerName, clusterID string, shared bool, sch
hashed
:=
hex
.
EncodeToString
(
hash
.
Sum
(
nil
))
hashed
:=
hex
.
EncodeToString
(
hash
.
Sum
(
nil
))
hashed
=
hashed
[
:
16
]
hashed
=
hashed
[
:
16
]
// 3 + 1 + 16 + 1 + 8 + 1 + 3 + 16
// k8s- 4
// {clusterid}- 17
// {scheme}- 9 (internal/external)
// {protocol}- 4 (tcp/udp)
// nmv1- 5 (naming convention version)
// {suffix} 16 (hash of settings)
// -----------------
// 55 characters used
return
fmt
.
Sprintf
(
"k8s-%s-%s-%s-nmv1-%s"
,
clusterID
,
strings
.
ToLower
(
string
(
scheme
)),
strings
.
ToLower
(
string
(
protocol
)),
hashed
)
return
fmt
.
Sprintf
(
"k8s-%s-%s-%s-nmv1-%s"
,
clusterID
,
strings
.
ToLower
(
string
(
scheme
)),
strings
.
ToLower
(
string
(
protocol
)),
hashed
)
}
}
return
loadBalancerName
return
loadBalancerName
...
@@ -72,7 +79,7 @@ func makeBackendServiceDescription(nm types.NamespacedName, shared bool) string
...
@@ -72,7 +79,7 @@ func makeBackendServiceDescription(nm types.NamespacedName, shared bool) string
if
shared
{
if
shared
{
return
""
return
""
}
}
return
fmt
.
Sprintf
(
`{"kubernetes.io/service-name":"%s"`
,
nm
.
String
())
return
fmt
.
Sprintf
(
`{"kubernetes.io/service-name":"%s"
}
`
,
nm
.
String
())
}
}
// External Load Balancer
// External Load Balancer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment