我正在尝试在 minikube 上使用 terraform 部署舵图。部署和 pod 都没有问题地部署,但是 helm 一直在抱怨
example-chart: Still creating..[2m10s elapsed]
....
Error: timed out waiting for the condition
当我尝试 helm history
时,我看到以下内容。
Release <chartname> failed: timed out waiting for the condition
尝试 helm test chart --debug
会显示以下内容
NAME: <chart>
LAST DEPLOYED: Wed Jun 30 04:23:44 2021
NAMESPACE: default
STATUS: failed
REVISION: 1
TEST SUITE: None
USER-SUPPLIED VALUES:
null
我不确定它指的是什么条件。
当我尝试使用简单的 helm 命令安装图表时,它运行良好,没有问题。这些是文件的内容
main.tf
provider "kubernetes" {
config_path = "~/.kube/config"
}
provider "helm" {
kubernetes {
config_path = "~/.kube/config"
}
}
resource "helm_release" "example-chart" {
name = "example-chart"
chart = "./config/k8s/example-chart"
}
我的实际图表有一个简单的 deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: brw-user-server-deployment
labels:
app: brw-user-server
spec:
replicas: 1
selector:
matchLabels:
app: brw-user-server
template:
metadata:
labels:
app: brw-user-server
spec:
containers:
- name: brw-user-server
image: {{ .Values.image.repository}}:1.0.0
imagePullPolicy: Never
ports:
- containerPort: {{ .Values.image.grpcPort}}
- containerPort: {{ .Values.image.httpPort}}
readinessProbe:
# tcpSocket:
# port: {{ .Values.image.httpPort}}
initialDelaySeconds: 5
periodSeconds: 10
httpGet:
path: /
port: {{ .Values.image.httpPort}}
scheme: HTTP
我认为这与就绪性探测器有关,但这也没有解决问题。