From 175346661d0311152691d340ded19f78f8baea48 Mon Sep 17 00:00:00 2001 From: JIAN QIU Date: Mon, 15 Jan 2018 16:16:16 +0800 Subject: [PATCH] Add more example and remvoe port_in_redirect flag (#3) --- examples/auth-ingress.yaml | 1 + examples/catalog-ui-ingress.yaml | 56 +++++++++++++++++++ examples/elastic-ingress.yaml | 32 +++++++++++ examples/image-manager-ingress.yaml | 36 ++++++++++++ examples/ui-ingress.yaml | 21 ++++++- .../opt/ibm/router/nginx/template/nginx.tmpl | 4 -- 6 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 examples/catalog-ui-ingress.yaml create mode 100644 examples/elastic-ingress.yaml create mode 100644 examples/image-manager-ingress.yaml diff --git a/examples/auth-ingress.yaml b/examples/auth-ingress.yaml index 8dbdc9c1a6..597f736ce6 100644 --- a/examples/auth-ingress.yaml +++ b/examples/auth-ingress.yaml @@ -84,6 +84,7 @@ metadata: namespace: kube-system annotations: kubernetes.io/ingress.class: "ibm-icp-management" + icp.management.ibm.com/rewrite-target: "/" spec: rules: - http: diff --git a/examples/catalog-ui-ingress.yaml b/examples/catalog-ui-ingress.yaml new file mode 100644 index 0000000000..c731cef674 --- /dev/null +++ b/examples/catalog-ui-ingress.yaml @@ -0,0 +1,56 @@ +--- + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: catalog-ui + namespace: kube-system + annotations: + kubernetes.io/ingress.class: "ibm-icp-management" + icp.management.ibm.com/auth-type: "id-token" +spec: + rules: + - http: + paths: + - path: /catalog + backend: + serviceName: catalog-ui + servicePort: 4000 + +--- + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: helm-api + namespace: kube-system + annotations: + kubernetes.io/ingress.class: "ibm-icp-management" + icp.management.ibm.com/rewrite-target: "/" +spec: + rules: + - http: + paths: + - path: /helm-api/ + backend: + serviceName: helm-api + servicePort: 3000 + +--- + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: helm-repo + namespace: kube-system + annotations: + kubernetes.io/ingress.class: "ibm-icp-management" + icp.management.ibm.com/rewrite-target: "/" +spec: + rules: + - http: + paths: + - path: /helm-repo/ + backend: + serviceName: helmrepo + servicePort: 3001 diff --git a/examples/elastic-ingress.yaml b/examples/elastic-ingress.yaml new file mode 100644 index 0000000000..4605386d2f --- /dev/null +++ b/examples/elastic-ingress.yaml @@ -0,0 +1,32 @@ +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: elastic + namespace: kube-system + annotations: + kubernetes.io/ingress.class: "ibm-icp-management" + icp.management.ibm.com/auth-type: "id-token" + icp.management.ibm.com/configuration-snippet: | + if ($request_uri ~* "/_([0-9A-Za-z]*)\?_timestamp=[0-9]*(.*)") { + proxy_pass http://$proxy_upstream_name/_$1?$2; + } +spec: + rules: + - http: + paths: + - path: /_cat + backend: + serviceName: elasticsearch + servicePort: 9200 + - path: /elasticsearch* + backend: + serviceName: elasticsearch + servicePort: 9200 + - path: /logstash* + backend: + serviceName: elasticsearch + servicePort: 9200 + - path: /heapster* + backend: + serviceName: elasticsearch + servicePort: 9200 diff --git a/examples/image-manager-ingress.yaml b/examples/image-manager-ingress.yaml new file mode 100644 index 0000000000..7fa8e35d0c --- /dev/null +++ b/examples/image-manager-ingress.yaml @@ -0,0 +1,36 @@ +--- + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: image-manager-auth + namespace: kube-system + annotations: + kubernetes.io/ingress.class: "ibm-icp-management" +spec: + rules: + - http: + paths: + - path: /image-manager/api/v1/auth/ + backend: + serviceName: image-manager + servicePort: 8600 + +--- + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: image-manager + namespace: kube-system + annotations: + kubernetes.io/ingress.class: "ibm-icp-management" + icp.management.ibm.com/auth-type: "id-token" +spec: + rules: + - http: + paths: + - path: /image-manager/api/v1 + backend: + serviceName: image-manager + servicePort: 8600 diff --git a/examples/ui-ingress.yaml b/examples/ui-ingress.yaml index 72ed25f9bc..35552441aa 100644 --- a/examples/ui-ingress.yaml +++ b/examples/ui-ingress.yaml @@ -8,11 +8,30 @@ metadata: annotations: kubernetes.io/ingress.class: "ibm-icp-management" icp.management.ibm.com/auth-type: "access-token" + icp.management.ibm.com/app-root: "/console" spec: rules: - http: paths: - - path: /console/ + - path: /console + backend: + serviceName: platform-ui + servicePort: 3000 + +--- + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: platform-ui-api + namespace: kube-system + annotations: + kubernetes.io/ingress.class: "ibm-icp-management" +spec: + rules: + - http: + paths: + - path: /console/api/ backend: serviceName: platform-ui servicePort: 3000 diff --git a/rootfs/opt/ibm/router/nginx/template/nginx.tmpl b/rootfs/opt/ibm/router/nginx/template/nginx.tmpl index b4bdf93d11..5071834bbf 100644 --- a/rootfs/opt/ibm/router/nginx/template/nginx.tmpl +++ b/rootfs/opt/ibm/router/nginx/template/nginx.tmpl @@ -107,10 +107,6 @@ http { '' $host; } - - server_name_in_redirect off; - port_in_redirect off; - ssl_protocols {{ $cfg.SSLProtocols }}; # turn on session caching to drastically improve performance