added cluster-name
This commit is contained in:
parent
9e85a199a7
commit
393904c21c
3 changed files with 15 additions and 8 deletions
|
|
@ -111,6 +111,7 @@ spec:
|
|||
#- --tls-cipher-suites="TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
|
||||
- --cloud-provider=pve
|
||||
- --leader-elect=true
|
||||
- --cluster-name=kubernetes
|
||||
image: reg.k8s.giftfish.de/library/pve-cloud-controller-manager-amd64:dev
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ spec:
|
|||
- args:
|
||||
- --cloud-config=/etc/kubernetes/pve.json
|
||||
- --leader-elect=true
|
||||
- --cluster-name=kubernetes
|
||||
name: manager
|
||||
image: reg.k8s.giftfish.de/library/pve-csr-approver-manager-amd64:dev
|
||||
imagePullPolicy: Always
|
||||
|
|
|
|||
|
|
@ -60,6 +60,14 @@ func (lb *loadbalancer) GetLoadBalancerName(ctx context.Context, clusterName str
|
|||
return fullname(clusterName, service)
|
||||
}
|
||||
|
||||
const (
|
||||
FrontendHAProxyLBOptions = "frontend.haproxy-lb/options"
|
||||
BackendHAProxyLBOptions = "backend.haproxy-lb/options"
|
||||
BackendHAProxyLBProxyProtocol = "backend.haproxy-lb/proxy-protocol"
|
||||
BackendHAProxyLBCheckProxyProtocol = "backend.haproxy-lb/check-proxy-protocol"
|
||||
BackendHAProxyLBDefaultServer = "backend.haproxy-lb/default-server"
|
||||
)
|
||||
|
||||
func (lb *loadbalancer) EnsureLoadBalancer(ctx context.Context, clusterName string, service *v1.Service, nodes []*v1.Node) (status *v1.LoadBalancerStatus, err error) {
|
||||
/*TODO service annotations
|
||||
port <node.Status.HealthCheckNodePort (int32)>
|
||||
|
|
@ -69,30 +77,27 @@ func (lb *loadbalancer) EnsureLoadBalancer(ctx context.Context, clusterName stri
|
|||
v1.ServiceExternalTrafficPolicyTypeCluster
|
||||
*/
|
||||
var slb schema.LoadBalancer
|
||||
if fo, ok := service.Annotations["frontend.haproxy-lb/options"]; ok {
|
||||
if fo, ok := service.Annotations[FrontendHAProxyLBOptions]; ok {
|
||||
slb.Options.Frontend = strings.Split(fo, ",")
|
||||
}
|
||||
if bo, ok := service.Annotations["backend.haproxy-lb/options"]; ok {
|
||||
if bo, ok := service.Annotations[BackendHAProxyLBOptions]; ok {
|
||||
slb.Options.Backend = strings.Split(bo, ",")
|
||||
}
|
||||
if cp, ok := service.Annotations["backend.haproxy-lb/proxy-protocol"]; ok {
|
||||
if cp, ok := service.Annotations[BackendHAProxyLBProxyProtocol]; ok {
|
||||
if cp == "v1" || cp == "v2" {
|
||||
slb.Options.ProxyProtocol = cp
|
||||
}
|
||||
}
|
||||
if cpp, ok := service.Annotations["backend.haproxy-lb/check-proxy-protocol"]; ok {
|
||||
if cpp, ok := service.Annotations[BackendHAProxyLBCheckProxyProtocol]; ok {
|
||||
slb.Options.CheckProxyProtocol = cpp == "true"
|
||||
}
|
||||
if df, ok := service.Annotations["backend.haproxy-lb/default-server"]; ok {
|
||||
if df, ok := service.Annotations[BackendHAProxyLBDefaultServer]; ok {
|
||||
slb.Options.DefaultServer = df
|
||||
}
|
||||
|
||||
for _, port := range service.Spec.Ports {
|
||||
sp := schema.Port{Port: int(port.Port)}
|
||||
for _, node := range nodes {
|
||||
if len(node.Status.Addresses) == 0 {
|
||||
continue
|
||||
}
|
||||
ip := ""
|
||||
for _, a := range node.Status.Addresses {
|
||||
if a.Type == v1.NodeInternalIP {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue