Kubernetes docker 卷安装选项

Kubernetes docker volume mounting option

我有一张 docker 图片,带有 属性 文件的选项,例如

CMD java -jar /opt/test/test-service.war 
--spring.config.location=file:/conf/application.properties

我在 docker run 命令中使用 -v 卷安装,如下所示。

-v /usr/xyz/props/application.properties:/conf/application.properties

我不确定如何在 Kubernetes 中实现相同的功能。
我在本地 mac.

中使用 minikube 来 运行 kubernetes

这应该是一个 host path volume,用这个例子 pod 说明。

apiVersion: v1
kind: Pod
metadata:
  name: test-pd
spec:
  containers:
  - image: k8s.gcr.io/test-webserver
    name: test-container
    volumeMounts:
    - mountPath: /test-pd
      name: test-volume
  volumes:
  - name: test-volume
    hostPath:
      # directory location on host
      path: /data
      # this field is optional
      type: Directory