我正在尝试写我的第一个舵图
这就是我的部署 在这一部分中:containerPort: {{ .Values.port }} ...它的工作 购买不适用于此: 值:{{ .Values.port |引用 }} 值:{{ .Value.logs |引用 }} 我不明白为什么......并且错误没有帮助我 请帮忙
部署.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-deployment
labels:
app: test
spec:
replicas: 1
selector:
matchLabels:
app: test
template:
metadata:
labels:
app: test
spec:
containers:
- name: test
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
ports:
- name: http
containerPort: {{ .Values.port }}
protocol: TCP
- env:
- name: PORT
value: {{ .Values.port | quote }}
- name: LOGS
value: {{ .Value.logs | quote }}
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
这是我的:
values.yaml
port: 8080
logs: "/logs/access.log"
replicaCount: 1
image:
repository: #
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "develop"
lint 或 helm install 给出错误消息:
gitlab-runner:~$ helm install test ./test --dry-run --debug
install.go:173: [debug] Original chart version: ""
install.go:190: [debug] CHART PATH: /home/gitlab-runner/test
Error: template: test/templates/deployment.yaml:28:28: executing "test/templates/deployment.yaml" at <.Value.logs>: nil pointer evaluating interface {}.logs
helm.go:88: [debug] template: test/templates/deployment.yaml:28:28: executing "test/templates/deployment.yaml" at <.Value.logs>: nil pointer evaluating interface {}.logs
我不明白我做错了什么 我很抱歉我的英语不好^^
计划1
部署.yaml
- env:
- name: PORT
value: "{{ .Values.port }}"
- name: LOGS
value: "{{ .Value.logs }}"
values.yaml
port: 8080
logs: /logs/access.log
计划2
部署.yaml
- env:
- name: PORT
value: {{ .Values.port | quote }}
- name: LOGS
value: {{ .Value.logs | quote }}
values.yaml
port: 8080
logs: /logs/access.log