Add e2e tests

This commit is contained in:
Manuel de Brito Fontes 2017-10-17 19:50:27 -03:00
parent 99a355f25d
commit 601fb7dacf
1163 changed files with 289217 additions and 14195 deletions

57213
test/data/config.json Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,110 @@
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package defaultbackend
import (
"crypto/tls"
"net/http"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/parnurzeal/gorequest"
"k8s.io/ingress-nginx/test/e2e/framework"
)
const defaultBackend = "default backend - 404"
var _ = framework.IngressNginxDescribe("Default backend", func() {
f := framework.NewDefaultFramework("default-backend")
BeforeEach(func() {
})
AfterEach(func() {
})
It("should return 404 sending requests when only a default backend is running", func() {
httpURL, err := f.GetNginxURL(framework.HTTP)
Expect(err).NotTo(HaveOccurred())
httpsURL, err := f.GetNginxURL(framework.HTTPS)
Expect(err).NotTo(HaveOccurred())
request := gorequest.New()
testCases := []struct {
Name string
Host string
Scheme framework.RequestScheme
Method string
Path string
Status int
}{
{"basic HTTP GET request without host to path / should return 404", "", framework.HTTP, "GET", "/", 404},
{"basic HTTP GET request without host to path /demo should return 404", "", framework.HTTP, "GET", "/demo", 404},
{"basic HTTPS GET request without host to path / should return 404", "", framework.HTTPS, "GET", "/", 404},
{"basic HTTPS GET request without host to path /demo should return 404", "", framework.HTTPS, "GET", "/demo", 404},
{"basic HTTP POST request without host to path / should return 404", "", framework.HTTP, "POST", "/", 404},
{"basic HTTP POST request without host to path /demo should return 404", "", framework.HTTP, "POST", "/demo", 404},
{"basic HTTPS POST request without host to path / should return 404", "", framework.HTTPS, "POST", "/", 404},
{"basic HTTPS POST request without host to path /demo should return 404", "", framework.HTTPS, "POST", "/demo", 404},
{"basic HTTP GET request to host foo.bar.com and path / should return 404", " foo.bar.com", framework.HTTP, "GET", "/", 404},
{"basic HTTP GET request to host foo.bar.com and path /demo should return 404", " foo.bar.com", framework.HTTP, "GET", "/demo", 404},
{"basic HTTPS GET request to host foo.bar.com and path / should return 404", " foo.bar.com", framework.HTTPS, "GET", "/", 404},
{"basic HTTPS GET request to host foo.bar.com and path /demo should return 404", " foo.bar.com", framework.HTTPS, "GET", "/demo", 404},
{"basic HTTP POST request to host foo.bar.com and path / should return 404", " foo.bar.com", framework.HTTP, "POST", "/", 404},
{"basic HTTP POST request to host foo.bar.com and path /demo should return 404", " foo.bar.com", framework.HTTP, "POST", "/demo", 404},
{"basic HTTPS POST request to host foo.bar.com and path / should return 404", " foo.bar.com", framework.HTTPS, "POST", "/", 404},
{"basic HTTPS POST request to host foo.bar.com and path /demo should return 404", " foo.bar.com", framework.HTTPS, "POST", "/demo", 404},
}
for _, test := range testCases {
By(test.Name)
var errs []error
var cm *gorequest.SuperAgent
switch test.Scheme {
case framework.HTTP:
cm = request.CustomMethod(test.Method, httpURL)
break
case framework.HTTPS:
cm = request.CustomMethod(test.Method, httpsURL)
// the default backend uses a self generated certificate
cm.Transport = &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
break
default:
Fail("Unexpected request scheme")
}
if test.Host != "" {
cm.Set("Host", test.Host)
}
resp, _, errs := cm.End()
Expect(len(errs)).Should(BeNumerically("==", 0))
Expect(resp.StatusCode).Should(Equal(test.Status))
}
})
})

View file

@ -0,0 +1,76 @@
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package defaultbackend
import (
"crypto/tls"
"net/http"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/parnurzeal/gorequest"
"k8s.io/ingress-nginx/test/e2e/framework"
)
var _ = framework.IngressNginxDescribe("Default backend - SSL", func() {
f := framework.NewDefaultFramework("default-backend")
BeforeEach(func() {
})
AfterEach(func() {
})
It("should return a self generated SSL certificate", func() {
httpsURL, err := f.GetNginxURL(framework.HTTPS)
Expect(err).NotTo(HaveOccurred())
request := gorequest.New()
By("checking SSL Certificate using the NGINX IP address")
cm := request.Post(httpsURL)
// the default backend uses a self generated certificate
cm.Transport = &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
resp, _, errs := cm.End()
Expect(len(errs)).Should(BeNumerically("==", 0))
Expect(len(resp.TLS.PeerCertificates)).Should(BeNumerically("==", 1))
for _, pc := range resp.TLS.PeerCertificates {
Expect(pc.Issuer.CommonName).Should(Equal("Kubernetes Ingress Controller Fake Certificate"))
}
By("checking SSL Certificate using the NGINX catch all server")
cm = request.Post(httpsURL)
// the default backend uses a self generated certificate
cm.Transport = &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
cm.Set("Host", "foo.bar.com")
resp, _, errs = cm.End()
Expect(len(errs)).Should(BeNumerically("==", 0))
Expect(len(resp.TLS.PeerCertificates)).Should(BeNumerically("==", 1))
for _, pc := range resp.TLS.PeerCertificates {
Expect(pc.Issuer.CommonName).Should(Equal("Kubernetes Ingress Controller Fake Certificate"))
}
})
})

44
test/e2e/e2e.go Normal file
View file

@ -0,0 +1,44 @@
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package e2e
import (
"testing"
"github.com/golang/glog"
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/config"
"github.com/onsi/gomega"
"k8s.io/apiserver/pkg/util/logs"
_ "k8s.io/client-go/plugin/pkg/client/auth"
_ "k8s.io/ingress-nginx/test/e2e/defaultbackend"
"k8s.io/ingress-nginx/test/e2e/framework"
)
// RunE2ETests checks configuration parameters (specified through flags) and then runs
// E2E tests using the Ginkgo runner.
func RunE2ETests(t *testing.T) {
logs.InitLogs()
defer logs.FlushLogs()
gomega.RegisterFailHandler(ginkgo.Fail)
// Disable skipped tests unless they are explicitly requested.
if config.GinkgoConfig.FocusString == "" && config.GinkgoConfig.SkipString == "" {
config.GinkgoConfig.SkipString = `\[Flaky\]|\[Feature:.+\]`
}
glog.Infof("Starting e2e run %q on Ginkgo node %d", framework.RunId, config.GinkgoConfig.ParallelNode)
ginkgo.RunSpecs(t, "nginx-ingress-controller e2e suite")
}

34
test/e2e/e2e_test.go Normal file
View file

@ -0,0 +1,34 @@
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package e2e
import (
"testing"
"github.com/golang/glog"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/ingress-nginx/test/e2e/framework"
)
func init() {
framework.RegisterParseFlags()
if "" == framework.TestContext.KubeConfig {
glog.Fatalf("environment variable %v must be set", clientcmd.RecommendedConfigPathEnvVar)
}
}
func TestE2E(t *testing.T) {
RunE2ETests(t)
}

View file

@ -0,0 +1,60 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package framework
import "sync"
type CleanupActionHandle *int
var cleanupActionsLock sync.Mutex
var cleanupActions = map[CleanupActionHandle]func(){}
// AddCleanupAction installs a function that will be called in the event of the
// whole test being terminated. This allows arbitrary pieces of the overall
// test to hook into SynchronizedAfterSuite().
func AddCleanupAction(fn func()) CleanupActionHandle {
p := CleanupActionHandle(new(int))
cleanupActionsLock.Lock()
defer cleanupActionsLock.Unlock()
cleanupActions[p] = fn
return p
}
// RemoveCleanupAction removes a function that was installed by AddCleanupAction.
func RemoveCleanupAction(p CleanupActionHandle) {
cleanupActionsLock.Lock()
defer cleanupActionsLock.Unlock()
delete(cleanupActions, p)
}
// RunCleanupActions runs all functions installed by AddCleanupAction. It does
// not remove them (see RemoveCleanupAction) but it does run unlocked, so they
// may remove themselves.
func RunCleanupActions() {
list := []func(){}
func() {
cleanupActionsLock.Lock()
defer cleanupActionsLock.Unlock()
for _, fn := range cleanupActions {
list = append(list, fn)
}
}()
// Run unlocked.
for _, fn := range list {
fn()
}
}

View file

@ -0,0 +1,145 @@
/*
Copyright 2017 Jetstack Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package framework
import (
"fmt"
"os/exec"
"strings"
"k8s.io/api/core/v1"
apiextcs "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
const (
podName = "test-ingress-controller"
)
type RequestScheme string
// These are valid test request schemes.
const (
HTTP RequestScheme = "http"
HTTPS RequestScheme = "https"
)
// Framework supports common operations used by e2e tests; it will keep a client & a namespace for you.
type Framework struct {
BaseName string
// A Kubernetes and Service Catalog client
KubeClientSet kubernetes.Interface
APIExtensionsClientSet apiextcs.Interface
// Namespace in which all test resources should reside
Namespace *v1.Namespace
// To make sure that this framework cleans up after itself, no matter what,
// we install a Cleanup action before each test and clear it after. If we
// should abort, the AfterSuite hook should run all Cleanup actions.
cleanupHandle CleanupActionHandle
}
// NewFramework makes a new framework and sets up a BeforeEach/AfterEach for
// you (you can write additional before/after each functions).
func NewDefaultFramework(baseName string) *Framework {
f := &Framework{
BaseName: baseName,
}
BeforeEach(f.BeforeEach)
AfterEach(f.AfterEach)
return f
}
// BeforeEach gets a client and makes a namespace.
func (f *Framework) BeforeEach() {
f.cleanupHandle = AddCleanupAction(f.AfterEach)
By("Creating a kubernetes client")
kubeConfig, err := LoadConfig(TestContext.KubeConfig, TestContext.KubeContext)
Expect(err).NotTo(HaveOccurred())
f.KubeClientSet, err = kubernetes.NewForConfig(kubeConfig)
Expect(err).NotTo(HaveOccurred())
By("Building a namespace api object")
f.Namespace, err = CreateKubeNamespace(f.BaseName, f.KubeClientSet)
Expect(err).NotTo(HaveOccurred())
}
// AfterEach deletes the namespace, after reading its events.
func (f *Framework) AfterEach() {
RemoveCleanupAction(f.cleanupHandle)
By("Deleting test namespace")
err := DeleteKubeNamespace(f.KubeClientSet, f.Namespace.Name)
Expect(err).NotTo(HaveOccurred())
By("Waiting for test namespace to no longer exist")
err = WaitForKubeNamespaceNotExist(f.KubeClientSet, f.Namespace.Name)
Expect(err).NotTo(HaveOccurred())
}
// IngressNginxDescribe wrapper function for ginkgo describe. Adds namespacing.
func IngressNginxDescribe(text string, body func()) bool {
return Describe("[nginx-ingress] "+text, body)
}
// GetNginxIP returns the IP address of the minikube cluster
// where the NGINX ingress controller is running
func (f *Framework) GetNginxIP() (string, error) {
out, err := exec.Command("minikube", "ip").Output()
if err != nil {
return "", err
}
return strings.TrimSpace(string(out)), nil
}
// GetNginxPort returns the number of TCP port where NGINX is running
func (f *Framework) GetNginxPort(name string) (int, error) {
s, err := f.KubeClientSet.CoreV1().Services("ingress-nginx").Get("ingress-nginx", meta_v1.GetOptions{})
if err != nil {
return -1, err
}
for _, p := range s.Spec.Ports {
if p.NodePort != 0 && p.Name == name {
return int(p.NodePort), nil
}
}
return -1, err
}
// GetNginxURL returns the URL should be used to make a request to NGINX
func (f *Framework) GetNginxURL(scheme RequestScheme) (string, error) {
ip, err := f.GetNginxIP()
if err != nil {
return "", err
}
port, err := f.GetNginxPort(fmt.Sprintf("%v", scheme))
if err != nil {
return "", err
}
return fmt.Sprintf("%v://%v:%v", scheme, ip, port), nil
}

View file

@ -0,0 +1,56 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package framework
import (
"flag"
"os"
"github.com/onsi/ginkgo/config"
"k8s.io/client-go/tools/clientcmd"
)
const (
RecommendedConfigPathEnvVar = "INGRESSNGINXCONFIG"
)
type TestContextType struct {
KubeHost string
KubeConfig string
KubeContext string
}
var TestContext TestContextType
// Register flags common to all e2e test suites.
func RegisterCommonFlags() {
// Turn on verbose by default to get spec names
config.DefaultReporterConfig.Verbose = true
// Turn on EmitSpecProgress to get spec progress (especially on interrupt)
config.GinkgoConfig.EmitSpecProgress = true
// Randomize specs as well as suites
config.GinkgoConfig.RandomizeAllSpecs = true
flag.StringVar(&TestContext.KubeHost, "kubernetes-host", "http://127.0.0.1:8080", "The kubernetes host, or apiserver, to connect to")
flag.StringVar(&TestContext.KubeConfig, "kubernetes-config", os.Getenv(clientcmd.RecommendedConfigPathEnvVar), "Path to config containing embedded authinfo for kubernetes. Default value is from environment variable "+clientcmd.RecommendedConfigPathEnvVar)
flag.StringVar(&TestContext.KubeContext, "kubernetes-context", "", "config context to use for kuberentes. If unset, will use value from 'current-context'")
}
func RegisterParseFlags() {
RegisterCommonFlags()
flag.Parse()
}

174
test/e2e/framework/util.go Normal file
View file

@ -0,0 +1,174 @@
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package framework
import (
"fmt"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd/api"
)
const (
// Poll how often to poll for conditions
Poll = 2 * time.Second
// Default time to wait for operations to complete
defaultTimeout = 30 * time.Second
)
func nowStamp() string {
return time.Now().Format(time.StampMilli)
}
func log(level string, format string, args ...interface{}) {
fmt.Fprintf(GinkgoWriter, nowStamp()+": "+level+": "+format+"\n", args...)
}
func Logf(format string, args ...interface{}) {
log("INFO", format, args...)
}
func Failf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
log("INFO", msg)
Fail(nowStamp()+": "+msg, 1)
}
func Skipf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
log("INFO", msg)
Skip(nowStamp() + ": " + msg)
}
func RestclientConfig(config, context string) (*api.Config, error) {
Logf(">>> config: %s\n", config)
if config == "" {
return nil, fmt.Errorf("Config file must be specified to load client config")
}
c, err := clientcmd.LoadFromFile(config)
if err != nil {
return nil, fmt.Errorf("error loading config: %v", err.Error())
}
if context != "" {
Logf(">>> context: %s\n", context)
c.CurrentContext = context
}
return c, nil
}
type ClientConfigGetter func() (*rest.Config, error)
func LoadConfig(config, context string) (*rest.Config, error) {
c, err := RestclientConfig(config, context)
if err != nil {
return nil, err
}
return clientcmd.NewDefaultClientConfig(*c, &clientcmd.ConfigOverrides{}).ClientConfig()
}
// RunId unique identifier of the e2e run
var RunId = uuid.NewUUID()
func CreateKubeNamespace(baseName string, c kubernetes.Interface) (*v1.Namespace, error) {
ns := &v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
GenerateName: fmt.Sprintf("e2e-tests-%v-", baseName),
},
}
// Be robust about making the namespace creation call.
var got *v1.Namespace
err := wait.PollImmediate(Poll, defaultTimeout, func() (bool, error) {
var err error
got, err = c.Core().Namespaces().Create(ns)
if err != nil {
Logf("Unexpected error while creating namespace: %v", err)
return false, nil
}
Logf("Created namespace: %v", got.Name)
return true, nil
})
if err != nil {
return nil, err
}
return got, nil
}
func DeleteKubeNamespace(c kubernetes.Interface, namespace string) error {
return c.Core().Namespaces().Delete(namespace, nil)
}
func ExpectNoError(err error, explain ...interface{}) {
if err != nil {
Logf("Unexpected error occurred: %v", err)
}
ExpectWithOffset(1, err).NotTo(HaveOccurred(), explain...)
}
func WaitForKubeNamespaceNotExist(c kubernetes.Interface, namespace string) error {
return wait.PollImmediate(Poll, time.Minute*2, namespaceNotExist(c, namespace))
}
func namespaceNotExist(c kubernetes.Interface, namespace string) wait.ConditionFunc {
return func() (bool, error) {
_, err := c.CoreV1().Namespaces().Get(namespace, metav1.GetOptions{})
if apierrors.IsNotFound(err) {
return true, nil
}
if err != nil {
return false, err
}
return false, nil
}
}
// Waits default amount of time (PodStartTimeout) for the specified pod to become running.
// Returns an error if timeout occurs first, or pod goes in to failed state.
func WaitForPodRunningInNamespace(c kubernetes.Interface, pod *v1.Pod) error {
if pod.Status.Phase == v1.PodRunning {
return nil
}
return waitTimeoutForPodRunningInNamespace(c, pod.Name, pod.Namespace, defaultTimeout)
}
func waitTimeoutForPodRunningInNamespace(c kubernetes.Interface, podName, namespace string, timeout time.Duration) error {
return wait.PollImmediate(Poll, defaultTimeout, podRunning(c, podName, namespace))
}
func podRunning(c kubernetes.Interface, podName, namespace string) wait.ConditionFunc {
return func() (bool, error) {
pod, err := c.CoreV1().Pods(namespace).Get(podName, metav1.GetOptions{})
if err != nil {
return false, err
}
switch pod.Status.Phase {
case v1.PodRunning:
return true, nil
case v1.PodFailed, v1.PodSucceeded:
return false, fmt.Errorf("pod ran to completion")
}
return false, nil
}
}

61
test/e2e/up.sh Executable file
View file

@ -0,0 +1,61 @@
#!/bin/bash
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'
echo "downloading kubectl..."
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/amd64/kubectl && \
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
echo "downloading minikube..."
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \
chmod +x minikube && \
sudo mv minikube /usr/local/bin/
echo "starting minikube..."
sudo minikube start --vm-driver=none --kubernetes-version=$KUBERNETES_VERSION
minikube update-context
echo "waiting for kubernetes cluster"
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True";
do
sleep 1;
done
echo "deploying NGINX Ingress controller"
cat deploy/namespace.yaml | kubectl apply -f -
cat deploy/default-backend.yaml | kubectl apply -f -
cat deploy/configmap.yaml | kubectl apply -f -
cat deploy/tcp-services-configmap.yaml | kubectl apply -f -
cat deploy/udp-services-configmap.yaml | kubectl apply -f -
cat deploy/without-rbac.yaml | kubectl apply -f -
cat deploy/provider/baremetal/service-nodeport.yaml | kubectl apply -f -
echo "updating image..."
kubectl set image \
deployments \
--namespace ingress-nginx \
--selector app=ingress-nginx \
nginx-ingress-controller=gcr.io/google_containers/nginx-ingress-controller:test
sleep 5
echo "waiting NGINX ingress pod..."
until kubectl get pods -n ingress-nginx -l app=ingress-nginx -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True";
do
sleep 1;
done

View file

@ -0,0 +1,690 @@
{
"backends": [{
"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,
"upstream-hash-by": "$request_uri",
"secure": false,
"secureCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"sslPassthrough": false,
"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",
"port": "8080",
"maxFails": 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": {
"name": "",
"cookieSessionAffinity": {
"name": "",
"hash": ""
}
}
}],
"servers": [{
"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": ""
}]
}, {
"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

@ -0,0 +1,690 @@
{
"backends": [{
"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,
"upstream-hash-by": "$request_uri",
"secure": false,
"secureCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"sslPassthrough": false,
"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",
"port": "8080",
"maxFails": 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": {
"name": "",
"cookieSessionAffinity": {
"name": "",
"hash": ""
}
}
}],
"servers": [{
"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": ""
}]
}, {
"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
},
"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": "",
"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
}
}]
}],
"TCPBackends": [],
"UDPBackends": []
}

View file

@ -0,0 +1,261 @@
{
"backends": [{
"name": "upstream-default-backend",
"service": null,
"port": 0,
"secure": false,
"secureCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"sslPassthrough": false,
"endpoints": [{
"address": "172.17.0.8",
"port": "8080",
"maxFails": 0,
"failTimeout": 0,
"target": {
"kind": "Pod",
"namespace": "kube-system",
"name": "kubernetes-dashboard-m3qc0",
"uid": "b9511631-5176-11e7-b3db-080027494b5d",
"resourceVersion": "3700964"
}
}],
"SessionAffinity": {
"name": "",
"CookieSessionAffinity": {
"name": "",
"hash": ""
}
}
}, {
"name": "deis-deis-controller-8000",
"service": {
"metadata": {
"name": "deis-controller",
"namespace": "deis",
"selfLink": "/api/v1/namespaces/deis/services/deis-controller",
"uid": "1cba01a8-50b0-11e7-a384-0800270f5693",
"resourceVersion": "532",
"creationTimestamp": "2017-06-14T03:18:18Z",
"labels": {
"heritage": "deis"
}
},
"spec": {
"ports": [{
"name": "http",
"protocol": "TCP",
"port": 8000,
"targetPort": 8000,
"nodePort": 30171
}],
"selector": {
"app": "deis-controller"
},
"clusterIP": "10.0.0.198",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 8000,
"secure": false,
"secureCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"sslPassthrough": false,
"endpoints": [{
"address": "172.17.0.7",
"port": "8000",
"maxFails": 0,
"failTimeout": 0
}],
"SessionAffinity": {
"name": "",
"CookieSessionAffinity": {
"name": "",
"hash": ""
}
}
}],
"servers": [{
"hostname": "_",
"sslPassthrough": false,
"sslCertificate": "/ingress-controller/ssl/default-fake-certificate.pem",
"sslExpireTime": "0001-01-01T00:00:00Z",
"sslPemChecksum": "123b44425920a2e4825ae779fba0e6e07fbac03d",
"locations": [{
"path": "/",
"isDefBackend": true,
"backend": "upstream-default-backend",
"service": null,
"port": 0,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false
},
"Denied": null,
"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
}
},
"redirect": {
"target": "",
"addBaseUrl": false,
"sslRedirect": false,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1g",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off"
},
"certificateAuth": {
"AuthSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}]
}, {
"hostname": "deis.minikube",
"sslPassthrough": false,
"sslCertificate": "",
"sslExpireTime": "0001-01-01T00:00:00Z",
"sslPemChecksum": "",
"locations": [{
"path": "/",
"isDefBackend": false,
"backend": "deis-deis-controller-8000",
"service": {
"metadata": {
"name": "deis-controller",
"namespace": "deis",
"selfLink": "/api/v1/namespaces/deis/services/deis-controller",
"uid": "1cba01a8-50b0-11e7-a384-0800270f5693",
"resourceVersion": "532",
"creationTimestamp": "2017-06-14T03:18:18Z",
"labels": {
"heritage": "deis"
}
},
"spec": {
"ports": [{
"name": "http",
"protocol": "TCP",
"port": 8000,
"targetPort": 8000,
"nodePort": 30171
}],
"selector": {
"app": "deis-controller"
},
"clusterIP": "10.0.0.198",
"type": "NodePort",
"sessionAffinity": "None"
},
"status": {
"loadBalancer": {}
}
},
"port": 8000,
"basicDigestAuth": {
"type": "",
"realm": "",
"file": "",
"secured": false
},
"Denied": null,
"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
}
},
"redirect": {
"target": "",
"addBaseUrl": false,
"sslRedirect": true,
"forceSSLRedirect": false,
"appRoot": ""
},
"whitelist": {
"cidr": null
},
"proxy": {
"bodySize": "1g",
"conectTimeout": 5,
"sendTimeout": 60,
"readTimeout": 60,
"bufferSize": "4k",
"cookieDomain": "off",
"cookiePath": "off"
},
"certificateAuth": {
"AuthSSLCert": {
"secret": "",
"caFilename": "",
"pemSha": ""
},
"validationDepth": 0
},
"use-port-in-redirects": false,
"configuration-snippet": ""
}]
}]
}