apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: go-demo-hostname
spec:
replicas: 2
template:
metadata:
labels:
app: go-demo-hostname
spec:
volumes:
- name: apps
hostPath:
path: /home/docker/go_path/src/go_demo
containers:
- name: go-demo-hostname
image: zhouyang209117/yd-golang1.10.2:v2
# resources:
# limits:
# memory: 1Gi
ports:
- containerPort: 80
volumeMounts:
- mountPath: /opt/apps/go_path/src/go_demo
name: apps
command:
- /opt/apps/go_path/src/go_demo/hostname/run.sh
readinessProbe:
exec:
command:
- /opt/apps/go_path/src/go_demo/hostname/readinessProbe.sh
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
exec:
command:
- /opt/apps/go_path/src/go_demo/hostname/livenessProbe.sh
initialDelaySeconds: 5
periodSeconds: 5
---
kind: Service
apiVersion: v1
metadata:
labels:
app: go-demo-hostname
name: go-demo-hostname
spec:
type: NodePort
ports:
- name: http
port: 80
protocol: TCP
nodePort: 30929
targetPort: 80
selector:
app: go-demo-hostname