Merge pull request #1110 from aledbf/master

Fix Endpoint comparison
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-08-11 15:37:52 -04:00 committed by GitHub
commit 36cf018a71
7 changed files with 1264 additions and 71 deletions

View file

@ -587,6 +587,7 @@ func (ic *GenericController) getDefaultUpstream() *ingress.Backend {
endps = []ingress.Endpoint{newDefaultServer()} endps = []ingress.Endpoint{newDefaultServer()}
} }
upstream.Service = svc
upstream.Endpoints = append(upstream.Endpoints, endps...) upstream.Endpoints = append(upstream.Endpoints, endps...)
return upstream return upstream
} }
@ -840,6 +841,8 @@ func (ic *GenericController) createUpstreams(data []interface{}) map[string]*ing
glog.V(3).Infof("creating upstream %v", name) glog.V(3).Infof("creating upstream %v", name)
upstreams[name] = newUpstream(name) upstreams[name] = newUpstream(name)
upstreams[name].Port = path.Backend.ServicePort
if !upstreams[name].Secure { if !upstreams[name].Secure {
upstreams[name].Secure = secUpstream.Secure upstreams[name].Secure = secUpstream.Secure
} }
@ -876,12 +879,12 @@ func (ic *GenericController) createUpstreams(data []interface{}) map[string]*ing
continue continue
} }
if exists { if !exists {
upstreams[name].Service = s.(*api.Service)
} else {
glog.Warningf("service %v does not exists", svcKey) glog.Warningf("service %v does not exists", svcKey)
continue
} }
upstreams[name].Port = path.Backend.ServicePort
upstreams[name].Service = s.(*api.Service)
} }
} }
} }
@ -1006,6 +1009,7 @@ func (ic *GenericController) createServers(data []interface{},
} }
// initialize the default server // initialize the default server
du := ic.getDefaultUpstream()
servers[defServerName] = &ingress.Server{ servers[defServerName] = &ingress.Server{
Hostname: defServerName, Hostname: defServerName,
SSLCertificate: defaultPemFileName, SSLCertificate: defaultPemFileName,
@ -1014,8 +1018,9 @@ func (ic *GenericController) createServers(data []interface{},
{ {
Path: rootLocation, Path: rootLocation,
IsDefBackend: true, IsDefBackend: true,
Backend: ic.getDefaultUpstream().Name, Backend: du.Name,
Proxy: ngxProxy, Proxy: ngxProxy,
Service: du.Service,
}, },
}} }}
@ -1028,12 +1033,13 @@ func (ic *GenericController) createServers(data []interface{},
// check if ssl passthrough is configured // check if ssl passthrough is configured
sslpt := ic.annotations.SSLPassthrough(ing) sslpt := ic.annotations.SSLPassthrough(ing)
dun := ic.getDefaultUpstream().Name du := ic.getDefaultUpstream()
un := du.Name
if ing.Spec.Backend != nil { if ing.Spec.Backend != nil {
// replace default backend // replace default backend
defUpstream := fmt.Sprintf("%v-%v-%v", ing.GetNamespace(), ing.Spec.Backend.ServiceName, ing.Spec.Backend.ServicePort.String()) defUpstream := fmt.Sprintf("%v-%v-%v", ing.GetNamespace(), ing.Spec.Backend.ServiceName, ing.Spec.Backend.ServicePort.String())
if backendUpstream, ok := upstreams[defUpstream]; ok { if backendUpstream, ok := upstreams[defUpstream]; ok {
dun = backendUpstream.Name un = backendUpstream.Name
} }
} }
@ -1053,8 +1059,9 @@ func (ic *GenericController) createServers(data []interface{},
{ {
Path: rootLocation, Path: rootLocation,
IsDefBackend: true, IsDefBackend: true,
Backend: dun, Backend: un,
Proxy: ngxProxy, Proxy: ngxProxy,
Service: &api.Service{},
}, },
}, SSLPassthrough: sslpt} }, SSLPassthrough: sslpt}
} }

View file

@ -47,13 +47,12 @@ func TestEqualConfiguration(t *testing.T) {
} }
if !b.Equal(a) { if !b.Equal(a) {
t.Errorf("expected equal configurations (configuration-a.json and configuration-b.json)") t.Errorf("expected equal configurations (configuration-b.json and configuration-a.json)")
} }
if a.Equal(c) { if a.Equal(c) {
t.Errorf("expected equal configurations (configuration-a.json and configuration-c.json)") t.Errorf("expected equal configurations (configuration-a.json and configuration-c.json)")
} }
} }
func readJSON(p string) (*Configuration, error) { func readJSON(p string) (*Configuration, error) {

View file

@ -199,7 +199,7 @@ type Endpoint struct {
// to consider the endpoint unavailable // to consider the endpoint unavailable
FailTimeout int `json:"failTimeout"` FailTimeout int `json:"failTimeout"`
// Target returns a reference to the object providing the endpoint // Target returns a reference to the object providing the endpoint
Target *api.ObjectReference `json:"target"` Target *api.ObjectReference `json:"target,omipempty"`
} }
// Server describes a website // Server describes a website
@ -253,7 +253,7 @@ type Location struct {
// Backend describes the name of the backend to use. // Backend describes the name of the backend to use.
Backend string `json:"backend"` Backend string `json:"backend"`
Service *api.Service `json:"service"` Service *api.Service `json:"service,omitempty"`
Port intstr.IntOrString `json:"port"` Port intstr.IntOrString `json:"port"`
// BasicDigestAuth returns authentication configuration for // BasicDigestAuth returns authentication configuration for
// an Ingress rule. // an Ingress rule.

View file

@ -149,21 +149,17 @@ func (b1 *Backend) Equal(b2 *Backend) bool {
return false return false
} }
if (b1.Service == nil && b2.Service != nil) || if b1.Service == nil || b2.Service == nil {
(b1.Service != nil && b2.Service == nil) {
return false return false
} }
if b1.Service.GetNamespace() != b2.Service.GetNamespace() {
if b1.Service != nil && b2.Service != nil { return false
if b1.Service.GetNamespace() != b2.Service.GetNamespace() { }
return false if b1.Service.GetName() != b2.Service.GetName() {
} return false
if b1.Service.GetName() != b2.Service.GetName() { }
return false if b1.Service.GetResourceVersion() != b2.Service.GetResourceVersion() {
} return false
if b1.Service.GetResourceVersion() != b2.Service.GetResourceVersion() {
return false
}
} }
if b1.Port != b2.Port { if b1.Port != b2.Port {
@ -258,7 +254,14 @@ func (e1 *Endpoint) Equal(e2 *Endpoint) bool {
if e1.FailTimeout != e2.FailTimeout { if e1.FailTimeout != e2.FailTimeout {
return false return false
} }
if e1.Target != e2.Target {
if e1.Target == nil || e2.Target == nil {
return false
}
if e1.Target.UID != e2.Target.UID {
return false
}
if e1.Target.ResourceVersion != e2.Target.ResourceVersion {
return false return false
} }
@ -324,21 +327,17 @@ func (l1 *Location) Equal(l2 *Location) bool {
return false return false
} }
if (l1.Service == nil && l2.Service != nil) || if l1.Service == nil || l2.Service == nil {
(l1.Service != nil && l2.Service == nil) {
return false return false
} }
if l1.Service.GetNamespace() != l2.Service.GetNamespace() {
if l1.Service != nil && l2.Service != nil { return false
if l1.Service.GetNamespace() != l2.Service.GetNamespace() { }
return false if l1.Service.GetName() != l2.Service.GetName() {
} return false
if l1.Service.GetName() != l2.Service.GetName() { }
return false if l1.Service.GetResourceVersion() != l2.Service.GetResourceVersion() {
} return false
if l1.Service.GetResourceVersion() != l2.Service.GetResourceVersion() {
return false
}
} }
if l1.Port.StrVal != l2.Port.StrVal { if l1.Port.StrVal != l2.Port.StrVal {
@ -398,21 +397,18 @@ func (ptb1 *SSLPassthroughBackend) Equal(ptb2 *SSLPassthroughBackend) bool {
if ptb1.Port != ptb2.Port { if ptb1.Port != ptb2.Port {
return false return false
} }
if (ptb1.Service == nil && ptb2.Service != nil) ||
(ptb1.Service != nil && ptb2.Service == nil) { if ptb1.Service == nil || ptb2.Service == nil {
return false return false
} }
if ptb1.Service.GetNamespace() != ptb2.Service.GetNamespace() {
if ptb1.Service != nil && ptb2.Service != nil { return false
if ptb1.Service.GetNamespace() != ptb2.Service.GetNamespace() { }
return false if ptb1.Service.GetName() != ptb2.Service.GetName() {
} return false
if ptb1.Service.GetName() != ptb2.Service.GetName() { }
return false if ptb1.Service.GetResourceVersion() != ptb2.Service.GetResourceVersion() {
} return false
if ptb1.Service.GetResourceVersion() != ptb2.Service.GetResourceVersion() {
return false
}
} }
return true return true

View file

@ -1,6 +1,35 @@
{ {
"backends": [{ "backends": [{
"name": "upstream-default-backend", "name": "upstream-default-backend",
"service": {
"metadata": {
"name": "default-http-backend",
"namespace": "kube-system",
"selfLink": "/api/v1/namespaces/kube-system/services/default-http-backend",
"uid": "907dc7db-5178-11e7-b3db-080027494b5d",
"resourceVersion": "3249707",
"creationTimestamp": "2017-06-15T03:13:12Z",
"labels": {
"k8s-app": "default-http-backend"
}
},
"spec": {
"ports": [{
"protocol": "TCP",
"port": 80,
"targetPort": 80
}],
"selector": {
"k8s-app": "default-http-backend"
},
"clusterIP": "10.0.0.131",
"type": "ClusterIP",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 0, "port": 0,
"secure": false, "secure": false,
"secureCert": { "secureCert": {
@ -10,10 +39,156 @@
}, },
"sslPassthrough": false, "sslPassthrough": false,
"endpoints": [{ "endpoints": [{
"address": "172.17.0.3",
"port": "80",
"maxFails": 0,
"failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "kube-system",
"name": "default-http-backend-3371703669-4dfnt",
"uid": "72e9c21f-793e-11e7-ac58-080027494b5d",
"resourceVersion": "3700969"
}
}],
"sessionAffinityConfig": {
"name": "",
"cookieSessionAffinity": {
"name": "",
"hash": ""
}
}
}, {
"name": "default-http-svc-80",
"service": {
"metadata": {
"name": "http-svc",
"namespace": "default",
"selfLink": "/api/v1/namespaces/default/services/http-svc",
"uid": "88b3c8a8-517e-11e7-b3db-080027494b5d",
"resourceVersion": "4242",
"creationTimestamp": "2017-06-15T03:55:55Z",
"labels": {
"app": "http-svc"
}
},
"spec": {
"ports": [{
"name": "http",
"protocol": "TCP",
"port": 80,
"targetPort": 8080,
"nodePort": 30301
}],
"selector": {
"app": "http-svc"
},
"clusterIP": "10.0.0.224",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 80,
"secure": false,
"secureCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"sslPassthrough": false,
"endpoints": [{
"address": "172.17.0.2",
"port": "8080",
"maxFails": 0,
"failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "default",
"name": "http-svc-w088k",
"uid": "283a4361-7c7c-11e7-b124-080027494b5d",
"resourceVersion": "3700943"
}
}, {
"address": "172.17.0.5", "address": "172.17.0.5",
"port": "8080", "port": "8080",
"maxFails": 0, "maxFails": 0,
"failTimeout": 0 "failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "default",
"name": "http-svc-tp758",
"uid": "43a82d6e-7303-11e7-ac58-080027494b5d",
"resourceVersion": "3700959"
}
}],
"sessionAffinityConfig": {
"name": "",
"cookieSessionAffinity": {
"name": "",
"hash": ""
}
}
}, {
"name": "kube-system-kubernetes-dashboard-80",
"service": {
"metadata": {
"name": "kubernetes-dashboard",
"namespace": "kube-system",
"selfLink": "/api/v1/namespaces/kube-system/services/kubernetes-dashboard",
"uid": "b957713f-5176-11e7-b3db-080027494b5d",
"resourceVersion": "82",
"creationTimestamp": "2017-06-15T03:00:01Z",
"labels": {
"addonmanager.kubernetes.io/mode": "Reconcile",
"app": "kubernetes-dashboard",
"kubernetes.io/minikube-addons": "dashboard",
"kubernetes.io/minikube-addons-endpoint": "dashboard"
},
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"app\":\"kubernetes-dashboard\",\"kubernetes.io/minikube-addons\":\"dashboard\",\"kubernetes.io/minikube-addons-endpoint\":\"dashboard\"},\"name\":\"kubernetes-dashboard\",\"namespace\":\"kube-system\"},\"spec\":{\"ports\":[{\"nodePort\":30000,\"port\":80,\"targetPort\":9090}],\"selector\":{\"app\":\"kubernetes-dashboard\"},\"type\":\"NodePort\"}}\n"
}
},
"spec": {
"ports": [{
"protocol": "TCP",
"port": 80,
"targetPort": 9090,
"nodePort": 30000
}],
"selector": {
"app": "kubernetes-dashboard"
},
"clusterIP": "10.0.0.120",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 80,
"secure": false,
"secureCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"sslPassthrough": false,
"endpoints": [{
"address": "172.17.0.6",
"port": "9090",
"maxFails": 0,
"failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "kube-system",
"name": "kubernetes-dashboard-m3qc0",
"uid": "b9511631-5176-11e7-b3db-080027494b5d",
"resourceVersion": "3700964"
}
}], }],
"sessionAffinityConfig": { "sessionAffinityConfig": {
"name": "", "name": "",
@ -28,18 +203,47 @@
"sslPassthrough": false, "sslPassthrough": false,
"sslCertificate": "/ingress-controller/ssl/default-fake-certificate.pem", "sslCertificate": "/ingress-controller/ssl/default-fake-certificate.pem",
"sslExpireTime": "0001-01-01T00:00:00Z", "sslExpireTime": "0001-01-01T00:00:00Z",
"sslPemChecksum": "4302f26460e2c49c9a69229449efefb30dc42a9a", "sslPemChecksum": "84d4ecb651dae44d625531bf77b6265d660b60b2",
"locations": [{ "locations": [{
"path": "/", "path": "/",
"isDefBackend": true, "isDefBackend": true,
"backend": "upstream-default-backend", "backend": "upstream-default-backend",
"service": null, "service": {
"metadata": {
"name": "default-http-backend",
"namespace": "kube-system",
"selfLink": "/api/v1/namespaces/kube-system/services/default-http-backend",
"uid": "907dc7db-5178-11e7-b3db-080027494b5d",
"resourceVersion": "3249707",
"creationTimestamp": "2017-06-15T03:13:12Z",
"labels": {
"k8s-app": "default-http-backend"
}
},
"spec": {
"ports": [{
"protocol": "TCP",
"port": 80,
"targetPort": 80
}],
"selector": {
"k8s-app": "default-http-backend"
},
"clusterIP": "10.0.0.131",
"type": "ClusterIP",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 0, "port": 0,
"basicDigestAuth": { "basicDigestAuth": {
"type": "", "type": "",
"realm": "", "realm": "",
"file": "", "file": "",
"secured": false "secured": false,
"fileSha": ""
}, },
"externalAuth": { "externalAuth": {
"url": "", "url": "",
@ -61,6 +265,12 @@
"limit": 0, "limit": 0,
"burst": 0, "burst": 0,
"sharedSize": 0 "sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
} }
}, },
"redirect": { "redirect": {
@ -80,7 +290,8 @@
"readTimeout": 60, "readTimeout": 60,
"bufferSize": "4k", "bufferSize": "4k",
"cookieDomain": "off", "cookieDomain": "off",
"cookiePath": "off" "cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
}, },
"certificateAuth": { "certificateAuth": {
"authSSLCert": { "authSSLCert": {
@ -93,5 +304,386 @@
"use-port-in-redirects": false, "use-port-in-redirects": false,
"configuration-snippet": "" "configuration-snippet": ""
}] }]
}] }, {
"hostname": "dev.mycompany.com",
"sslPassthrough": false,
"sslCertificate": "/ingress-controller/ssl/default-mycompany.pem",
"sslExpireTime": "2027-06-20T20:28:25Z",
"sslPemChecksum": "b9282485e120e4fad8c25d15dc1b7984fcde99ba",
"locations": [{
"path": "/bar",
"isDefBackend": false,
"backend": "default-http-svc-80",
"service": {
"metadata": {
"name": "http-svc",
"namespace": "default",
"selfLink": "/api/v1/namespaces/default/services/http-svc",
"uid": "88b3c8a8-517e-11e7-b3db-080027494b5d",
"resourceVersion": "4242",
"creationTimestamp": "2017-06-15T03:55:55Z",
"labels": {
"app": "http-svc"
}
},
"spec": {
"ports": [{
"name": "http",
"protocol": "TCP",
"port": 80,
"targetPort": 8080,
"nodePort": 30301
}],
"selector": {
"app": "http-svc"
},
"clusterIP": "10.0.0.224",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 80,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false,
"fileSha": ""
},
"externalAuth": {
"url": "",
"host": "",
"signinUrl": "",
"method": "",
"sendBody": false,
"responseHeaders": null
},
"rateLimit": {
"connections": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rps": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
}
},
"redirect": {
"target": "",
"addBaseUrl": false,
"sslRedirect": true,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1m",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
},
"certificateAuth": {
"authSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}, {
"path": "/",
"isDefBackend": true,
"backend": "upstream-default-backend",
"service": {
"metadata": {
"creationTimestamp": null
},
"spec": {},
"status": {
"loadBalancer": {}
}
},
"port": 0,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false,
"fileSha": ""
},
"externalAuth": {
"url": "",
"host": "",
"signinUrl": "",
"method": "",
"sendBody": false,
"responseHeaders": null
},
"rateLimit": {
"connections": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rps": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
}
},
"redirect": {
"target": "",
"addBaseUrl": false,
"sslRedirect": false,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1m",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
},
"certificateAuth": {
"authSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}]
}, {
"hostname": "domain.tld",
"sslPassthrough": false,
"sslCertificate": "",
"sslExpireTime": "0001-01-01T00:00:00Z",
"sslPemChecksum": "",
"locations": [{
"path": "/dashboard",
"isDefBackend": false,
"backend": "kube-system-kubernetes-dashboard-80",
"service": {
"metadata": {
"name": "kubernetes-dashboard",
"namespace": "kube-system",
"selfLink": "/api/v1/namespaces/kube-system/services/kubernetes-dashboard",
"uid": "b957713f-5176-11e7-b3db-080027494b5d",
"resourceVersion": "82",
"creationTimestamp": "2017-06-15T03:00:01Z",
"labels": {
"addonmanager.kubernetes.io/mode": "Reconcile",
"app": "kubernetes-dashboard",
"kubernetes.io/minikube-addons": "dashboard",
"kubernetes.io/minikube-addons-endpoint": "dashboard"
},
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"app\":\"kubernetes-dashboard\",\"kubernetes.io/minikube-addons\":\"dashboard\",\"kubernetes.io/minikube-addons-endpoint\":\"dashboard\"},\"name\":\"kubernetes-dashboard\",\"namespace\":\"kube-system\"},\"spec\":{\"ports\":[{\"nodePort\":30000,\"port\":80,\"targetPort\":9090}],\"selector\":{\"app\":\"kubernetes-dashboard\"},\"type\":\"NodePort\"}}\n"
}
},
"spec": {
"ports": [{
"protocol": "TCP",
"port": 80,
"targetPort": 9090,
"nodePort": 30000
}],
"selector": {
"app": "kubernetes-dashboard"
},
"clusterIP": "10.0.0.120",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 80,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false,
"fileSha": ""
},
"externalAuth": {
"url": "",
"host": "",
"signinUrl": "",
"method": "",
"sendBody": false,
"responseHeaders": null
},
"rateLimit": {
"connections": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rps": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
}
},
"redirect": {
"target": "/",
"addBaseUrl": false,
"sslRedirect": true,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1m",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
},
"certificateAuth": {
"authSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}, {
"path": "/",
"isDefBackend": true,
"backend": "upstream-default-backend",
"service": {
"metadata": {
"creationTimestamp": null
},
"spec": {},
"status": {
"loadBalancer": {}
}
},
"port": 0,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false,
"fileSha": ""
},
"externalAuth": {
"url": "",
"host": "",
"signinUrl": "",
"method": "",
"sendBody": false,
"responseHeaders": null
},
"rateLimit": {
"connections": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rps": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
}
},
"redirect": {
"target": "",
"addBaseUrl": false,
"sslRedirect": false,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1m",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
},
"certificateAuth": {
"authSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}]
}],
"TCPBackends": [],
"UDPBackends": []
} }

View file

@ -1,6 +1,35 @@
{ {
"backends": [{ "backends": [{
"name": "upstream-default-backend", "name": "upstream-default-backend",
"service": {
"metadata": {
"name": "default-http-backend",
"namespace": "kube-system",
"selfLink": "/api/v1/namespaces/kube-system/services/default-http-backend",
"uid": "907dc7db-5178-11e7-b3db-080027494b5d",
"resourceVersion": "3249707",
"creationTimestamp": "2017-06-15T03:13:12Z",
"labels": {
"k8s-app": "default-http-backend"
}
},
"spec": {
"ports": [{
"protocol": "TCP",
"port": 80,
"targetPort": 80
}],
"selector": {
"k8s-app": "default-http-backend"
},
"clusterIP": "10.0.0.131",
"type": "ClusterIP",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 0, "port": 0,
"secure": false, "secure": false,
"secureCert": { "secureCert": {
@ -10,10 +39,156 @@
}, },
"sslPassthrough": false, "sslPassthrough": false,
"endpoints": [{ "endpoints": [{
"address": "172.17.0.3",
"port": "80",
"maxFails": 0,
"failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "kube-system",
"name": "default-http-backend-3371703669-4dfnt",
"uid": "72e9c21f-793e-11e7-ac58-080027494b5d",
"resourceVersion": "3700969"
}
}],
"sessionAffinityConfig": {
"name": "",
"cookieSessionAffinity": {
"name": "",
"hash": ""
}
}
}, {
"name": "default-http-svc-80",
"service": {
"metadata": {
"name": "http-svc",
"namespace": "default",
"selfLink": "/api/v1/namespaces/default/services/http-svc",
"uid": "88b3c8a8-517e-11e7-b3db-080027494b5d",
"resourceVersion": "4242",
"creationTimestamp": "2017-06-15T03:55:55Z",
"labels": {
"app": "http-svc"
}
},
"spec": {
"ports": [{
"name": "http",
"protocol": "TCP",
"port": 80,
"targetPort": 8080,
"nodePort": 30301
}],
"selector": {
"app": "http-svc"
},
"clusterIP": "10.0.0.224",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 80,
"secure": false,
"secureCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"sslPassthrough": false,
"endpoints": [{
"address": "172.17.0.2",
"port": "8080",
"maxFails": 0,
"failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "default",
"name": "http-svc-w088k",
"uid": "283a4361-7c7c-11e7-b124-080027494b5d",
"resourceVersion": "3700943"
}
}, {
"address": "172.17.0.5", "address": "172.17.0.5",
"port": "8080", "port": "8080",
"maxFails": 0, "maxFails": 0,
"failTimeout": 0 "failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "default",
"name": "http-svc-tp758",
"uid": "43a82d6e-7303-11e7-ac58-080027494b5d",
"resourceVersion": "3700959"
}
}],
"sessionAffinityConfig": {
"name": "",
"cookieSessionAffinity": {
"name": "",
"hash": ""
}
}
}, {
"name": "kube-system-kubernetes-dashboard-80",
"service": {
"metadata": {
"name": "kubernetes-dashboard",
"namespace": "kube-system",
"selfLink": "/api/v1/namespaces/kube-system/services/kubernetes-dashboard",
"uid": "b957713f-5176-11e7-b3db-080027494b5d",
"resourceVersion": "82",
"creationTimestamp": "2017-06-15T03:00:01Z",
"labels": {
"addonmanager.kubernetes.io/mode": "Reconcile",
"app": "kubernetes-dashboard",
"kubernetes.io/minikube-addons": "dashboard",
"kubernetes.io/minikube-addons-endpoint": "dashboard"
},
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"app\":\"kubernetes-dashboard\",\"kubernetes.io/minikube-addons\":\"dashboard\",\"kubernetes.io/minikube-addons-endpoint\":\"dashboard\"},\"name\":\"kubernetes-dashboard\",\"namespace\":\"kube-system\"},\"spec\":{\"ports\":[{\"nodePort\":30000,\"port\":80,\"targetPort\":9090}],\"selector\":{\"app\":\"kubernetes-dashboard\"},\"type\":\"NodePort\"}}\n"
}
},
"spec": {
"ports": [{
"protocol": "TCP",
"port": 80,
"targetPort": 9090,
"nodePort": 30000
}],
"selector": {
"app": "kubernetes-dashboard"
},
"clusterIP": "10.0.0.120",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 80,
"secure": false,
"secureCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"sslPassthrough": false,
"endpoints": [{
"address": "172.17.0.6",
"port": "9090",
"maxFails": 0,
"failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "kube-system",
"name": "kubernetes-dashboard-m3qc0",
"uid": "b9511631-5176-11e7-b3db-080027494b5d",
"resourceVersion": "3700964"
}
}], }],
"sessionAffinityConfig": { "sessionAffinityConfig": {
"name": "", "name": "",
@ -24,22 +199,58 @@
} }
}], }],
"servers": [{ "servers": [{
"hostname": "_", "hostname": "domain.tld",
"sslPassthrough": false, "sslPassthrough": false,
"sslCertificate": "/ingress-controller/ssl/default-fake-certificate.pem", "sslCertificate": "",
"sslExpireTime": "0001-01-01T00:00:00Z", "sslExpireTime": "0001-01-01T00:00:00Z",
"sslPemChecksum": "4302f26460e2c49c9a69229449efefb30dc42a9a", "sslPemChecksum": "",
"locations": [{ "locations": [{
"path": "/", "path": "/dashboard",
"isDefBackend": true, "isDefBackend": false,
"backend": "upstream-default-backend", "backend": "kube-system-kubernetes-dashboard-80",
"service": null, "service": {
"port": 0, "metadata": {
"name": "kubernetes-dashboard",
"namespace": "kube-system",
"selfLink": "/api/v1/namespaces/kube-system/services/kubernetes-dashboard",
"uid": "b957713f-5176-11e7-b3db-080027494b5d",
"resourceVersion": "82",
"creationTimestamp": "2017-06-15T03:00:01Z",
"labels": {
"addonmanager.kubernetes.io/mode": "Reconcile",
"app": "kubernetes-dashboard",
"kubernetes.io/minikube-addons": "dashboard",
"kubernetes.io/minikube-addons-endpoint": "dashboard"
},
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"app\":\"kubernetes-dashboard\",\"kubernetes.io/minikube-addons\":\"dashboard\",\"kubernetes.io/minikube-addons-endpoint\":\"dashboard\"},\"name\":\"kubernetes-dashboard\",\"namespace\":\"kube-system\"},\"spec\":{\"ports\":[{\"nodePort\":30000,\"port\":80,\"targetPort\":9090}],\"selector\":{\"app\":\"kubernetes-dashboard\"},\"type\":\"NodePort\"}}\n"
}
},
"spec": {
"ports": [{
"protocol": "TCP",
"port": 80,
"targetPort": 9090,
"nodePort": 30000
}],
"selector": {
"app": "kubernetes-dashboard"
},
"clusterIP": "10.0.0.120",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 80,
"basicDigestAuth": { "basicDigestAuth": {
"type": "", "type": "",
"realm": "", "realm": "",
"file": "", "file": "",
"secured": false "secured": false,
"fileSha": ""
}, },
"externalAuth": { "externalAuth": {
"url": "", "url": "",
@ -61,6 +272,91 @@
"limit": 0, "limit": 0,
"burst": 0, "burst": 0,
"sharedSize": 0 "sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
}
},
"redirect": {
"target": "/",
"addBaseUrl": false,
"sslRedirect": true,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1m",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
},
"certificateAuth": {
"authSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}, {
"path": "/",
"isDefBackend": true,
"backend": "upstream-default-backend",
"service": {
"metadata": {
"creationTimestamp": null
},
"spec": {},
"status": {
"loadBalancer": {}
}
},
"port": 0,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false,
"fileSha": ""
},
"externalAuth": {
"url": "",
"host": "",
"signinUrl": "",
"method": "",
"sendBody": false,
"responseHeaders": null
},
"rateLimit": {
"connections": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rps": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
} }
}, },
"redirect": { "redirect": {
@ -80,7 +376,8 @@
"readTimeout": 60, "readTimeout": 60,
"bufferSize": "4k", "bufferSize": "4k",
"cookieDomain": "off", "cookieDomain": "off",
"cookiePath": "off" "cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
}, },
"certificateAuth": { "certificateAuth": {
"authSSLCert": { "authSSLCert": {
@ -93,5 +390,300 @@
"use-port-in-redirects": false, "use-port-in-redirects": false,
"configuration-snippet": "" "configuration-snippet": ""
}] }]
}] },{
"hostname": "_",
"sslPassthrough": false,
"sslCertificate": "/ingress-controller/ssl/default-fake-certificate.pem",
"sslExpireTime": "0001-01-01T00:00:00Z",
"sslPemChecksum": "84d4ecb651dae44d625531bf77b6265d660b60b2",
"locations": [{
"path": "/",
"isDefBackend": true,
"backend": "upstream-default-backend",
"service": {
"metadata": {
"name": "default-http-backend",
"namespace": "kube-system",
"selfLink": "/api/v1/namespaces/kube-system/services/default-http-backend",
"uid": "907dc7db-5178-11e7-b3db-080027494b5d",
"resourceVersion": "3249707",
"creationTimestamp": "2017-06-15T03:13:12Z",
"labels": {
"k8s-app": "default-http-backend"
}
},
"spec": {
"ports": [{
"protocol": "TCP",
"port": 80,
"targetPort": 80
}],
"selector": {
"k8s-app": "default-http-backend"
},
"clusterIP": "10.0.0.131",
"type": "ClusterIP",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 0,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false,
"fileSha": ""
},
"externalAuth": {
"url": "",
"host": "",
"signinUrl": "",
"method": "",
"sendBody": false,
"responseHeaders": null
},
"rateLimit": {
"connections": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rps": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
}
},
"redirect": {
"target": "",
"addBaseUrl": false,
"sslRedirect": false,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1m",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
},
"certificateAuth": {
"authSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}]
}, {
"hostname": "dev.mycompany.com",
"sslPassthrough": false,
"sslCertificate": "/ingress-controller/ssl/default-mycompany.pem",
"sslExpireTime": "2027-06-20T20:28:25Z",
"sslPemChecksum": "b9282485e120e4fad8c25d15dc1b7984fcde99ba",
"locations": [{
"path": "/bar",
"isDefBackend": false,
"backend": "default-http-svc-80",
"service": {
"metadata": {
"name": "http-svc",
"namespace": "default",
"selfLink": "/api/v1/namespaces/default/services/http-svc",
"uid": "88b3c8a8-517e-11e7-b3db-080027494b5d",
"resourceVersion": "4242",
"creationTimestamp": "2017-06-15T03:55:55Z",
"labels": {
"app": "http-svc"
}
},
"spec": {
"ports": [{
"name": "http",
"protocol": "TCP",
"port": 80,
"targetPort": 8080,
"nodePort": 30301
}],
"selector": {
"app": "http-svc"
},
"clusterIP": "10.0.0.224",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 80,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false,
"fileSha": ""
},
"externalAuth": {
"url": "",
"host": "",
"signinUrl": "",
"method": "",
"sendBody": false,
"responseHeaders": null
},
"rateLimit": {
"connections": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rps": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
}
},
"redirect": {
"target": "",
"addBaseUrl": false,
"sslRedirect": true,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1m",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
},
"certificateAuth": {
"authSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}, {
"path": "/",
"isDefBackend": true,
"backend": "upstream-default-backend",
"service": {
"metadata": {
"creationTimestamp": null
},
"spec": {},
"status": {
"loadBalancer": {}
}
},
"port": 0,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false,
"fileSha": ""
},
"externalAuth": {
"url": "",
"host": "",
"signinUrl": "",
"method": "",
"sendBody": false,
"responseHeaders": null
},
"rateLimit": {
"connections": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rps": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
},
"rpm": {
"name": "",
"limit": 0,
"burst": 0,
"sharedSize": 0
}
},
"redirect": {
"target": "",
"addBaseUrl": false,
"sslRedirect": false,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1m",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off",
"nextUpstream": "error timeout invalid_header http_502 http_503 http_504"
},
"certificateAuth": {
"authSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}]
}],
"TCPBackends": [],
"UDPBackends": []
} }

View file

@ -14,7 +14,14 @@
"address": "172.17.0.8", "address": "172.17.0.8",
"port": "8080", "port": "8080",
"maxFails": 0, "maxFails": 0,
"failTimeout": 0 "failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "kube-system",
"name": "kubernetes-dashboard-m3qc0",
"uid": "b9511631-5176-11e7-b3db-080027494b5d",
"resourceVersion": "3700964"
}
}], }],
"SessionAffinity": { "SessionAffinity": {
"name": "", "name": "",