working configuration
This commit is contained in:
commit
65d0de25c7
17
cluster-with-ingress.yml
Normal file
17
cluster-with-ingress.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
kind: Cluster
|
||||||
|
apiVersion: kind.x-k8s.io/v1alpha4
|
||||||
|
nodes:
|
||||||
|
- role: control-plane
|
||||||
|
kubeadmConfigPatches:
|
||||||
|
- |
|
||||||
|
kind: InitConfiguration
|
||||||
|
nodeRegistration:
|
||||||
|
kubeletExtraArgs:
|
||||||
|
node-labels: "ingress-ready=true"
|
||||||
|
extraPortMappings:
|
||||||
|
- containerPort: 80
|
||||||
|
hostPort: 80
|
||||||
|
protocol: TCP
|
||||||
|
- containerPort: 443
|
||||||
|
hostPort: 443
|
||||||
|
protocol: TCP
|
9273
contour.yaml
Normal file
9273
contour.yaml
Normal file
File diff suppressed because it is too large
Load Diff
35
httpbin-deployment.yaml
Normal file
35
httpbin-deployment.yaml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: httpbin
|
||||||
|
name: httpbin
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: httpbin
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: httpbin
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: docker.io/kennethreitz/httpbin
|
||||||
|
name: httpbin
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: httpbin
|
||||||
|
name: httpbin
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 80
|
||||||
|
selector:
|
||||||
|
app: httpbin
|
||||||
|
sessionAffinity: None
|
||||||
|
type: ClusterIP
|
28
ingress.yml
Normal file
28
ingress.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
apiVersion: projectcontour.io/v1
|
||||||
|
kind: HTTPProxy
|
||||||
|
metadata:
|
||||||
|
name: ingress-httpbin-nginx
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/rewrite-target: /$2
|
||||||
|
spec:
|
||||||
|
virtualhost:
|
||||||
|
fqdn: localhost
|
||||||
|
routes:
|
||||||
|
- services:
|
||||||
|
- name: nginx
|
||||||
|
port: 80
|
||||||
|
conditions:
|
||||||
|
- prefix: /nginx
|
||||||
|
pathRewritePolicy:
|
||||||
|
replacePrefix:
|
||||||
|
- prefix: /nginx
|
||||||
|
replacement: /
|
||||||
|
- services:
|
||||||
|
- name: httpbin
|
||||||
|
port: 80
|
||||||
|
conditions:
|
||||||
|
- prefix: /httpbin
|
||||||
|
pathRewritePolicy:
|
||||||
|
replacePrefix:
|
||||||
|
- prefix: /httpbin
|
||||||
|
replacement: /
|
35
nginx-deployment.yml
Normal file
35
nginx-deployment.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nginx
|
||||||
|
replicas: 2 # tells deployment to run 2 pods matching the template
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx:1.14.2
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
name: nginx
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 80
|
||||||
|
selector:
|
||||||
|
app: nginx
|
||||||
|
sessionAffinity: None
|
||||||
|
type: ClusterIP
|
Loading…
Reference in New Issue
Block a user