Kubernetes码头工程量安装选项

use*_*872 5 docker kubernetes minikube

我有一个docker图像,其中包含属性文件的选项,

CMD java -jar /opt/test/test-service.war 
--spring.config.location=file:/conf/application.properties
Run Code Online (Sandbox Code Playgroud)

-vdocker run命令中使用volume mount,如下所示.

-v /usr/xyz/props/application.properties:/conf/application.properties
Run Code Online (Sandbox Code Playgroud)

我不知道如何在Kubernetes中实现同样的目标.
我使用minikube在我的本地mac中运行kubernetes.

Von*_*onC 6

这应该是主机路径卷,用此示例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
Run Code Online (Sandbox Code Playgroud)