Deploy GitHub Pages
This commit is contained in:
parent
fae0dc0303
commit
e73476191a
23 changed files with 248 additions and 152 deletions
|
|
@ -15,10 +15,13 @@ spec:
|
|||
- host: stickyingress-samesite-none.example.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
|
|
@ -35,7 +38,10 @@ spec:
|
|||
- host: stickyingress-samesite-strict.example.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
|
|
@ -13,7 +13,10 @@ spec:
|
|||
- host: stickyingress.example.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
|
|
|
|||
|
|
@ -32,9 +32,12 @@
|
|||
<span class=go> http:</span>
|
||||
<span class=go> paths:</span>
|
||||
<span class=go> - path: /</span>
|
||||
<span class=go> pathType: Prefix</span>
|
||||
<span class=go> backend:</span>
|
||||
<span class=go> serviceName: http-svc</span>
|
||||
<span class=go> servicePort: 80</span>
|
||||
<span class=go> service: </span>
|
||||
<span class=go> name: http-svc</span>
|
||||
<span class=go> port: </span>
|
||||
<span class=go> number: 80</span>
|
||||
<span class=go>" | kubectl create -f -</span>
|
||||
</code></pre></div> <div class=highlight><pre><span></span><code>$ curl -v http://10.2.29.4/ -H 'Host: foo.bar.com'
|
||||
* Trying 10.2.29.4...
|
||||
|
|
|
|||
|
|
@ -19,10 +19,13 @@ spec:
|
|||
- host: mydomain.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- mydomain.com
|
||||
|
|
|
|||
|
|
@ -23,10 +23,13 @@ spec:
|
|||
- host: external-auth-01.sample.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
status:
|
||||
loadBalancer:
|
||||
ingress:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ spec:
|
|||
- host: external-auth-01.sample.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
|
|
@ -11,11 +11,13 @@ spec:
|
|||
- host: __INGRESS_HOST__
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: kubernetes-dashboard
|
||||
servicePort: 80
|
||||
path: /
|
||||
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: kubernetes-dashboard
|
||||
port:
|
||||
number: 80
|
||||
---
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
|
|
@ -28,10 +30,13 @@ spec:
|
|||
- host: __INGRESS_HOST__
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: oauth2-proxy
|
||||
servicePort: 4180
|
||||
path: /oauth2
|
||||
- path: /oauth2
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: oauth2-proxy
|
||||
port:
|
||||
number: 4180
|
||||
tls:
|
||||
- hosts:
|
||||
- __INGRESS_HOST__
|
||||
|
|
|
|||
|
|
@ -64,7 +64,15 @@ metadata:
|
|||
name: nginxhello-ingress
|
||||
namespace: default
|
||||
spec:
|
||||
backend:
|
||||
serviceName: nginxhello
|
||||
servicePort: 80
|
||||
rules:
|
||||
- host: foo.bar.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: nginxhello
|
||||
port:
|
||||
number: 80
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,10 @@ spec:
|
|||
- host: custom.configuration.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
|
|
|
|||
|
|
@ -56,10 +56,13 @@ spec:
|
|||
- host: public-demo-echo-service.kube.local
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: demo-echo-service
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: demo-echo-service
|
||||
port:
|
||||
number: 80
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
|
|
@ -74,7 +77,10 @@ spec:
|
|||
- host: secure-demo-echo-service.kube.local
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: demo-echo-service
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: demo-echo-service
|
||||
port:
|
||||
number: 80
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@ spec:
|
|||
- host: registry.<your domain>
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: docker-registry
|
||||
servicePort: 5000
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: docker-registry
|
||||
port:
|
||||
number: 5000
|
||||
|
|
@ -12,7 +12,10 @@ spec:
|
|||
- host: registry.<your domain>
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: docker-registry
|
||||
servicePort: 5000
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: docker-registry
|
||||
port:
|
||||
number: 5000
|
||||
|
|
|
|||
|
|
@ -115,14 +115,20 @@ spec:
|
|||
- host: foo.bar.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
- host: bar.baz.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: nginx
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service
|
||||
name: nginx
|
||||
port:
|
||||
number: 80
|
||||
|
|
|
|||
|
|
@ -11,10 +11,13 @@
|
|||
<span class=go> - host: rewrite.bar.com</span>
|
||||
<span class=go> http:</span>
|
||||
<span class=go> paths:</span>
|
||||
<span class=go> - backend:</span>
|
||||
<span class=go> serviceName: http-svc</span>
|
||||
<span class=go> servicePort: 80</span>
|
||||
<span class=go> path: /something(/|$)(.*)</span>
|
||||
<span class=go> - path: /something(/|$)(.*)</span>
|
||||
<span class=go> pathType: Prefix</span>
|
||||
<span class=go> backend:</span>
|
||||
<span class=go> service:</span>
|
||||
<span class=go> name: http-svc</span>
|
||||
<span class=go> port: </span>
|
||||
<span class=go> number: 80</span>
|
||||
<span class=go>' | kubectl create -f -</span>
|
||||
</code></pre></div> <p>In this ingress definition, any characters captured by <code>(.*)</code> will be assigned to the placeholder <code>$2</code>, which is then used as a parameter in the <code>rewrite-target</code> annotation.</p> <p>For example, the ingress definition above will result in the following rewrites:</p> <ul> <li><code>rewrite.bar.com/something</code> rewrites to <code>rewrite.bar.com/</code></li> <li><code>rewrite.bar.com/something/</code> rewrites to <code>rewrite.bar.com/</code></li> <li><code>rewrite.bar.com/something/new</code> rewrites to <code>rewrite.bar.com/new</code></li> </ul> <h3 id=app-root>App Root<a class=headerlink href=#app-root title="Permanent link"> ¶</a></h3> <p>Create an Ingress rule with an app-root annotation: <div class=highlight><pre><span></span><code>$ echo "
|
||||
apiVersion: networking.k8s.io/v1
|
||||
|
|
@ -29,10 +32,13 @@ spec:
|
|||
- host: approot.bar.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
path: /
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
" | kubectl create -f -
|
||||
</code></pre></div></p> <p>Check the rewrite is working</p> <div class=highlight><pre><span></span><code>$ curl -I -k http://approot.bar.com/
|
||||
HTTP/1.1 302 Moved Temporarily
|
||||
|
|
|
|||
|
|
@ -9,7 +9,11 @@ spec:
|
|||
rules:
|
||||
- http:
|
||||
paths:
|
||||
- backend:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
# This assumes http-svc exists and routes to healthy endpoints.
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
|
|
|
|||
|
|
@ -14,10 +14,13 @@
|
|||
<span class=nt>http</span><span class=p>:</span>
|
||||
<span class=nt>paths</span><span class=p>:</span>
|
||||
<span class="p p-Indicator">-</span> <span class=nt>path</span><span class=p>:</span> <span class="l l-Scalar l-Scalar-Plain">/</span>
|
||||
<span class=nt>pathType</span><span class=p>:</span> <span class="l l-Scalar l-Scalar-Plain">Prefix</span>
|
||||
<span class=nt>backend</span><span class=p>:</span>
|
||||
<span class=c1># This assumes http-svc exists and routes to healthy endpoints</span>
|
||||
<span class=nt>serviceName</span><span class=p>:</span> <span class="l l-Scalar l-Scalar-Plain">http-svc</span>
|
||||
<span class=nt>servicePort</span><span class=p>:</span> <span class="l l-Scalar l-Scalar-Plain">80</span>
|
||||
<span class=nt>service</span><span class=p>:</span>
|
||||
<span class=nt>name</span><span class=p>:</span> <span class="l l-Scalar l-Scalar-Plain">http-svc</span>
|
||||
<span class=nt>port</span><span class=p>:</span>
|
||||
<span class=nt>number</span><span class=p>:</span> <span class="l l-Scalar l-Scalar-Plain">80</span>
|
||||
</code></pre></div> <p>The following command instructs the controller to terminate traffic using the provided TLS cert, and forward un-encrypted HTTP traffic to the test HTTP service.</p> <div class=highlight><pre><span></span><code><span class=go>kubectl apply -f ingress.yaml</span>
|
||||
</code></pre></div> <h2 id=validation>Validation<a class=headerlink href=#validation title="Permanent link"> ¶</a></h2> <p>You can confirm that the Ingress works.</p> <div class=highlight><pre><span></span><code><span class=gp>$</span> kubectl describe ing nginx-test
|
||||
<span class=go>Name: nginx-test</span>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,10 @@ spec:
|
|||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
# This assumes http-svc exists and routes to healthy endpoints
|
||||
serviceName: http-svc
|
||||
servicePort: 80
|
||||
service:
|
||||
name: http-svc
|
||||
port:
|
||||
number: 80
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue