kind: Deployment
apiVersion: apps/v1
metadata:
labels:
app: test-yfs
version: v0.1
name: test-yfs
namespace: kube-ops
spec:
replicas: 1
selector:
matchLabels:
app: test-yfs
template:
metadata:
labels:
app: test-yfs
spec:
containers:
- name: test-yfs
image: harbor.test.com/test/tomcat8.5:v2
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
protocol: TCP
volumeMounts:
- name: test-yfs
mountPath: /usr/local/tomcat/webapps
volumes:
- name: test-yfs
hostPath:
path: /opt/test
type: Directory
nodeSelector:
test.com/projet: test
kind: Service
apiVersion: v1
metadata:
labels:
app: test-svc
name: test-svc
namespace: kube-ops
spec:
type: NodePort
ports:
- port: 8080
name: http
targetPort: 8080
nodePort: 30807
selector:
app: test-yfs
sessionAffinity: ClientIP