55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: php-website-deployment
|
|
namespace: website-production
|
|
labels:
|
|
app: php-website
|
|
spec:
|
|
replicas: 2
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 0
|
|
maxUnavailable: 1
|
|
selector:
|
|
matchLabels:
|
|
app: php-website
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: php-website
|
|
spec:
|
|
affinity:
|
|
podAntiAffinity:
|
|
preferredDuringSchedulingIgnoredDuringExecution: # requiredDuringSchedulingIgnoredDuringExecution:
|
|
- weight: 100
|
|
podAffinityTerm:
|
|
labelSelector:
|
|
matchExpressions:
|
|
- key: app
|
|
operator: In
|
|
values:
|
|
- php-website
|
|
topologyKey: "kubernetes.io/hostname"
|
|
containers:
|
|
- name: php-app
|
|
image: local-registry-svc.container-registry.svc.cluster.local:5000/php-website:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 80
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: php-website-service
|
|
namespace: website-production
|
|
spec:
|
|
type: NodePort
|
|
ports:
|
|
- port: 80
|
|
targetPort: 80
|
|
nodePort: 30080
|
|
selector:
|
|
app: php-website
|