资源定义创建haproxy
[root@master manifest]# cat deployment4.yaml
---
apiVersion: v1
kind: Pod
metadata:
name: haproxy
spec:
restartPolicy: Always
containers:
- image: sktystwd/haproxy:v0.1
imagePullPolicy: IfNotPresent
name: haproxy
livenessProbe:
httpGet:
port: 80
initialDelaySeconds: 40
periodSeconds: 10
volumeMounts:
- name: sys-bs
mountPath: /config
volumes:
- name: sys-bs
hostPath:
path: /opt/date
---
apiVersion: v1
kind: Service
metadata:
name: haproxy
spec:
ports:
- port: 80
targetPort: 80
selector:
app: apache
type: NodePort