53 lines
922 B
YAML
53 lines
922 B
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: testapp-srv
|
|
labels:
|
|
app: testapp-srv
|
|
version: v1
|
|
spec:
|
|
replicas: 3
|
|
selector:
|
|
matchLabels:
|
|
app: testapp-srv
|
|
version: v1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: testapp-srv
|
|
version: v1
|
|
spec:
|
|
containers:
|
|
- name: testapp-srv
|
|
image: 127.0.0.1:5000/testapp/srv:v1
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8080
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: testapp-srv
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- name: http
|
|
port: 8080
|
|
selector:
|
|
app: testapp-srv
|
|
---
|
|
---
|
|
apiVersion: networking.k8s.io/v1beta1
|
|
kind: Ingress
|
|
metadata:
|
|
name: testapp-srv
|
|
annotations:
|
|
kubernetes.io/ingress.class: "nginx"
|
|
spec:
|
|
rules:
|
|
- host: k8s-testapp.example.com
|
|
http:
|
|
paths:
|
|
- backend:
|
|
serviceName: testapp-srv
|
|
servicePort: 8080
|