![](/img/trans.png)
[英]Setting airflow connections using Values.yaml in Helm (Kubernetes)
[英]Pull docker hub images in Helm chart values.yaml
我是掌舵人和Kubernetes世界的新手。 我正在使用Docker,Kubernetes和Helm的项目中进行尝试,在其中尝试使用Kubernetes上的Helm Chart部署一个简单的Node.js应用程序。
这是我尝试过的:
从Dockerfile
:
FROM node:6.9.2
EXPOSE 30000
COPY server.js .
CMD node server.js
我已经构建了映像,对其进行了标记并将其推送到位于以下位置的MY_USERNAME/myhello:0.2
hub存储库: MY_USERNAME/myhello:0.2
然后我运行简单commad创建一个掌舵的图表为: helm create mychart
它创造了mychart目录witll所有掌舵组件。
然后,我将values.yaml
文件编辑为:
replicaCount: 1
image:
repository: MY_USERNAME/myhello
tag: 0.2
pullPolicy: IfNotPresent
nameOverride: ""
fullnameOverride: ""
service:
type: NodePort
port: 80
externalPort: 30000
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
paths: []
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}
之后,我将图表安装为: helm install --name myhelmdep01 mychart
当运行kubectl get pods
它显示ErrImagePull
我通过将映像名称提到为docker.io/arycloud/myhello
进行了尝试,在这种情况下,映像成功提取,但是出现了另一个错误:
活动探测失败:获取http://172.17.0.5:80/ :拨打tcp 172.17.0.5:80:connect:连接被拒绝
发生错误后立即运行kubectl describe pod <yourpod>
,并且在输出底部附近应该有一个事件可以告诉您确切的图像拉出问题。
在我的头顶上,这可能是以下选项之一:
registry-1.docker.io/arycloud/myhello
如果您发现该错误,那就应该很简单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.