<p>I have a pod yaml file(see below). It has all the properties I want, except replica properties. So that I have to write deployment yaml.</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: app-ykt
  labels:
    app: app-ykt
    purpose: ykt_production
spec:
  containers:
  - name: app-ykt
    image: app
    imagePullPolicy: IfNotPresent
    ports:
      - containerPort: 80
    volumeMounts:
      - name: volume-app-ykt
        mountPath: /usr/application
    env:
      - name: spring.config.location
        value: application.properties
  volumes:
      - name: volume-app-ykt
        hostPath:
          path: /opt/docker/datalook-pre-core
          type: Directory
</code></pre>

<p>When writing deployment file, I have to mention image and other properties which I donot want. What's more, it creates another pod and missing some properties I must have, for example volume. My target is just this replica, so that I could get high availability for the pod. Any solution?</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-ykt
  labels:
    app: app-ykt
spec:
  replicas: 1
  selector:
    matchLabels:
      app: app-ykt
  template:
    metadata:
      labels:
        app: app-ykt
    spec:
      containers:
      - name: app-ykt
        image: app
        ports:
        - containerPort: 80
</code></pre>

user84592
<p>First of all, I think hostPath volume is not HA solutions, so you should concern to share a volume as ReadWriteMany Persistent Volume across kubernetes cluster. 
And then you also need the internal load balancer among replicated pods like Services[0].</p>

<p>I hope it help you.</p>

<p>[0][<a href="https://kubernetes.io/docs/concepts/services-networking/service/]" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/]</a></p>
