Allow a user specified global static ip via annotation.
This commit is contained in:
parent
4409bed106
commit
3ee943d434
6 changed files with 235 additions and 41 deletions
|
|
@ -34,7 +34,10 @@ import (
|
|||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
const allowHTTPKey = "kubernetes.io/ingress.allowHTTP"
|
||||
const (
|
||||
allowHTTPKey = "kubernetes.io/ingress.allow-http"
|
||||
staticIPNameKey = "kubernetes.io/ingress.global-static-ip-name"
|
||||
)
|
||||
|
||||
// ingAnnotations represents Ingress annotations.
|
||||
type ingAnnotations map[string]string
|
||||
|
|
@ -52,6 +55,14 @@ func (ing ingAnnotations) allowHTTP() bool {
|
|||
return v
|
||||
}
|
||||
|
||||
func (ing ingAnnotations) staticIPName() string {
|
||||
val, ok := ing[staticIPNameKey]
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
// errorNodePortNotFound is an implementation of error.
|
||||
type errorNodePortNotFound struct {
|
||||
backend extensions.IngressBackend
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue