HTTP / 1.1 503后端提取失败:大师冥想:XID:1066598

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

[我为在kubernetes集群中运行的清漆缓存服务器创建了舵图,同时使用“外部IP”进行测试时产生了抛出错误,请在下面共享

共享varnish.vcl(在我的情况下为default.vcl的别名),在下面的values.yaml中。我将后端/ Web服务器硬编码为端口为“ 80”的.host =“ www.varnish-cache.org”时,有关如何解决的任何建议。我的要求是在我的情况下执行curl -IL负载平衡器入口IP),我应该使用不如上所述的缓存值(直接从后端服务器)获取响应。

任何解决方案/方法如何解决。请根据我上面的清漆(default.vcl)和values.yaml文件给出任何响应/建议。请将此作为最高优先级。

varnish.vcl:

 VCL version 5.0 is not supported so it should be 4.0 or 4.1 even though actually used Varnish version is 6
vcl 4.1;

import std;
# The minimal Varnish version is 5.0
# For SSL offloading, pass the following header in your proxy server or load balancer: 'X-Forwarded-Proto: https'



{{  .Values.varnishconfigData | indent 2 }}

sub vcl_recv {

  if(req.url == "/healthcheck") {
    return(synth(200,"OK"));
  }
}

values.yaml:

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

replicaCount: 1

image:
  repository: varnish
  tag: 6.3
  pullPolicy: IfNotPresent

nameOverride: ""
fullnameOverride: ""

service:
 # type: ClusterIP
  type: LoadBalancer
  port: 80

varnishconfigData: |- 
       backend default {
          .host = "35.170.216.115";
          .port = "80";
          .first_byte_timeout = 60s;
          .connect_timeout = 300s ;
          .probe = {
                 .url = "/";
                 .timeout = 1s;
                 .interval = 5s;
                 .window = 5;
                 .threshold = 3;
}
         sub vcl_backend_response {
           set beresp.ttl = 5m;
         }

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

我为在kubernetes集群中运行的清漆缓存服务器创建了helm图表,同时使用“外部IP”进行测试时会产生其抛出错误,在共享varnish.vcl(alias ...

kubernetes-helm varnish
1个回答
0
投票
。host =“ www.google.com”;

使用IP地址代替主机名

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