Skip to content

Instantly share code, notes, and snippets.

@erhwenkuo
Created April 14, 2019 04:16
Show Gist options
  • Save erhwenkuo/cf289bcb437b1354ee94f5f773571e12 to your computer and use it in GitHub Desktop.
Save erhwenkuo/cf289bcb437b1354ee94f5f773571e12 to your computer and use it in GitHub Desktop.
Kubernetes網路是如何運作?Part#3 (Ingress & Ingress Controller)
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: test-web-deployment
namespace: default
labels:
app: test-web
spec:
replicas: 3
selector:
matchLabels:
app: test-web
template:
metadata:
labels:
app: test-web
spec:
containers:
- name: test-web
image: nginx
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 80
protocol: TCP
apiVersion: v1
kind: Service
metadata:
name: test-web-service
namespace: default
labels:
app: test-web
spec:
type: ClusterIP
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: test-web
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-web-ingress
namespace: default
spec:
rules:
- host: test.example.com
http:
paths:
- backend:
serviceName: test-web-service
servicePort: 80
path: /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment