3
社区成员




回归下示例Python应用 cloud_native_hello_py 的目录结构:
.
├── Dockerfile
├── README.md
├── k8s.deployment.yaml
├── k8s.service.yaml
└── src
├── main.py
└── requirements.txt
我们使用 kubectl 命令部署过该 Python 服务,现在,我们用 helm 来部署。
首先,在项目命令下通过 helm 命令创建一个chart 配置文件夹
makedir chart
cd chart
helm create hello-py
此时,目录结构如下:
.
├── Dockerfile
├── README.md
├── chart
│ └── hello-py
│ ├── Chart.yaml
│ ├── charts
│ ├── templates
│ │ ├── NOTES.txt
│ │ ├── _helpers.tpl
│ │ ├── deployment.yaml
│ │ ├── hpa.yaml
│ │ ├── ingress.yaml
│ │ ├── service.yaml
│ │ ├── serviceaccount.yaml
│ │ └── tests
│ │ └── test-connection.yaml
│ └── values.yaml
├── k8s.deployment.yaml
├── k8s.service.yaml
└── src
├── main.py
└── requirements.txt
其中:
修改 values.yaml: ```bash replicaCount: 1
image: image: fanfeilong/cloud_native_hello_py pullPolicy: IfNotPresent ```
现在,使用 heml 安装
helm install ./chart/hello-py/ --generate-name
检测下 k8s 的 deployment 和 sevice:
端口转发:
访问服务:
以下说法错误的是?