得到错误“使用Helm Chart Kubernetes启动Varnish期间,“活泼和就绪状态”探针失败” [关闭]

问题描述 投票:-1回答:1

我正在尝试创建用于Helen的Helm图表,以在kubernetes集群上部署/运行。运行包含来自Docker社区的清漆图像的helm软件包时,其抛出错误

“准备就绪探针失败:获取http://100.101.0.34:80/healthcheck:拨号tcp 100.101.0.34:80:连接:连接被拒绝回退重启失败的容器” ..

欢迎使用任何解决方案。.>

DeploymentFile.yaml:

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: {{ include "varnish.fullname" . }}
  labels:
    app: {{ include "varnish.name" . }}
    chart: {{ include "varnish.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app: {{ include "varnish.name" . }}
      release: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app: {{ include "varnish.name" . }}
        release: {{ .Release.Name }}
    spec:
      volumes: 
        - name: varnish-config
          configMap:
             name: {{ include "varnish.fullname" . }}-varnish-config
             items:
               - key: default.vcl
                 path: default.vcl
         #- name: varnish-config-start
          # confiMap:
              #name: {{ include "varnish.fullname" . }}-varnish-config-start
              #items:
                #- key: varnish.vcl
                 # path: varnish.vcl
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          #command: [ "/bin/bash", "-ce", "tail -f /dev/null" ]
          command: ['sh', '-c', 'echo Container 1 is Running ; sleep 3600']
         # args:
         # - /server
          imagePullPolicy: {{ .Values.image.pullPolicy }}    
          env:
          - name: VARNISH_VCL
            value: /etc/varnish/default.vcl
          #- name: VARNISH_VCL_START
           # value: /etc/default/varnish.vcl
          volumeMounts: 
            - name: varnish-config
              mountPath : /etc/varnish/
           # - name: varnish-config
             # mountPath: /etc/default
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
              targetPort: 80
          livenessProbe: 
            #exec:
              #command: 
                # - /home/ubuntu/k8s/kube/DebasisHelm/varnish/templates/default.vcl 
            httpGet:
              path: /healthcheck
             # port: http
              port: 80
              #httpHeaders:
              #- name: Custom-Header
              #  value: Awesome
            failureThreshold: 3
            initialDelaySeconds: 45
            timeoutSeconds: 10
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /healthcheck
             # port: http
              port: 80
            initialDelaySeconds: 10
            timeoutSeconds: 15
            periodSeconds: 5
          restartPolicy: "Always"
          resources:
{{ toYaml .Values.resources | indent 12 }}
    {{- with .Values.nodeSelector }}
      nodeSelector:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.affinity }}
      affinity:
{{ toYaml . | indent 8 }}
    {{- end }}
    {{- with .Values.tolerations }}
      tolerations:
{{ toYaml . | indent 8 }}
    {{- end }}

Values.yaml:

# Default values for tt.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1


#backendHost: "www.varnish-cache.org:80"
#backendPort: "80"

image:
  repository: varnish
  tag: 6.3
  pullPolicy: IfNotPresent

nameOverride: ""
fullnameOverride: ""

service:
  type: ClusterIP
  port: 80



#probes:
 # enabled: true

ingress:
  enabled: false
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  path: /
  hosts:
    - chart-example.local
  tls: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

resources:
  limits:
    memory: 128Mi
  requests:
    memory: 64Mi

#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: {}

我正在尝试创建用于Helen的Helm图表,以在kubernetes集群上部署/运行。运行包含来自Docker社区的清漆图像的helm软件包时,其抛出错误“ Readiness ...

kubernetes charts kubernetes-helm varnish
1个回答
0
投票

Kubernetes将检查您的Varnish窗格是否正确响应。

© www.soinside.com 2019 - 2024. All rights reserved.