ClusterIP
---
apiVersion: v1
kind: Service
metadata:
name: myapp-svc
labels:
app: myapp
release: stable
spec:
selector:
app: myapp
release: stable
type: ClusterIP
ports:
- name: myapp
port: 80
protocol: TCP
targetPort: app-port
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-deploy
namespace: default
spec:
replicas: 3
revisionHistoryLimit: 3
selector:
matchLabels:
app: myapp
release: stable
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
name: myapp-container
namespace: default
labels:
app: myapp
release: stable
spec:
containers:
- name: myapp-container
image: ikubernetes/myapp:v1
ports:
- name: app-port
containerPort: 80
protocol: TCP