init
This commit is contained in:
103
deploy.yaml
Normal file
103
deploy.yaml
Normal file
@@ -0,0 +1,103 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
namespace: test2
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nginx
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
nodeName: node1
|
||||
containers:
|
||||
- image: nginx
|
||||
name: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-service
|
||||
namespace: test2
|
||||
spec:
|
||||
selector:
|
||||
app: nginx
|
||||
type: NodePort
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
nodePort: 31080
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nginx-endpoint
|
||||
namespace: test2
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/service.serversscheme: "http"
|
||||
traefik.ingress.kubernetes.io/service.passhostheader: "true"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
||||
|
||||
---
|
||||
|
||||
kind: Endpoints
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: nginx-endpoint
|
||||
namespace: test2
|
||||
subsets:
|
||||
- addresses:
|
||||
- ip: 192.168.9.201
|
||||
ports:
|
||||
- port: 31080
|
||||
- addresses:
|
||||
- ip: 192.168.9.202
|
||||
ports:
|
||||
- port: 31080
|
||||
- addresses:
|
||||
- ip: 192.168.9.203
|
||||
ports:
|
||||
- port: 31080
|
||||
---
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
labels:
|
||||
baremetal-ingress: traefik-nsk
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: traefik-lb
|
||||
external-dns.alpha.kubernetes.io/hostname: lb.k8s-nsk.tk
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: https
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
traefik.ingress.kubernetes.io/router.tls.certresolver: letsEncrypt
|
||||
name: nginx-ingress
|
||||
namespace: test2
|
||||
spec:
|
||||
rules:
|
||||
- host: lb.k8s-nsk.tk
|
||||
http:
|
||||
paths:
|
||||
- pathType: Prefix
|
||||
path: "/"
|
||||
backend:
|
||||
service:
|
||||
name: nginx-endpoint
|
||||
port:
|
||||
number: 80
|
||||
---
|
Reference in New Issue
Block a user