- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试为要在Kubernetes集群上部署/运行的 Varnish 创建Helm图表。在运行具有Docker社区上的 Varnish 图像的helm软件包时,其抛出错误
Readiness probe failed: HTTP probe failed with statuscode: 503
Liveness probe failed: HTTP probe failed with statuscode: 503
values.yaml
,
deployment.yaml
,
varnish-config.yaml
和
varnish.vcl
。
# Default values for tt.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
#vcl 4.0;
#import std;
#backend default {
# .host = "www.varnish-cache.org";
# .port = "80";
# .first_byte_timeout = 60s;
# .connect_timeout = 300s;
#}
varnishBackendService: "www.varnish-cache.org"
varnishBackendServicePort: "80"
image:
repository: varnish
tag: 6.0.6
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: {}
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 }}
# annotations:
# sidecar.istio.io/rewriteAppHTTPProbers: "true"
spec:
volumes:
- name: varnish-config
configMap:
name: {{ include "varnish.fullname" . }}-varnish-config
items:
- key: default.vcl
path: default.vcl
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: VARNISH_VCL
value: /etc/varnish/default.vcl
volumeMounts:
- name: varnish-config
mountPath : /etc/varnish/
ports:
- name: http
containerPort: 80
protocol: TCP
targetPort: 80
livenessProbe:
httpGet:
path: /healthcheck
port: http
port: 80
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 }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "varnish.fullname" . }}-varnish-config
labels:
app: {{ template "varnish.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
default.vcl: |-
{{ $file := (.Files.Get "config/varnish.vcl") }}
{{ tpl $file . | indent 4 }}
# 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'
backend default {
#.host = "{{ default "google.com" .Values.varnishBackendService }}";
.host = "{{ .Values.varnishBackendService }}";
.port = "{{ .Values.varnishBackendServicePort }}";
#.port = "{{ default "80" .Values.varnishBackendServicePort }}";
.first_byte_timeout = 60s;
.connect_timeout = 300s ;
.probe = {
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
}
}
backend server2 {
.host = "74.125.24.105:80";
.probe = {
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
}
}
import directors;
sub vcl_init {
new vdir = directors.round_robin();
vdir.add_backend(default);
vdir.add_backend(server2);
}
#sub vcl_recv {
# if (req.url ~ "/healthcheck"){
# error 200 "imok";
# set req.http.Connection = "close";
# }
#}
最佳答案
Kubernetes的就绪性和 liveness 探针均返回HTTP 503
错误,这意味着与您的后端的连接可能存在问题。
有趣的是,这还不重要。那些探针无法对HTTP流执行端到端测试。探针仅用于验证其监视的服务是否响应。
这就是为什么在捕获指向/healthcheck
的请求时仅返回综合HTTP响应的原因。
这是执行此操作的VCL代码:
sub vcl_recv {
if(req.url == "/healthcheck") {
return(synth(200,"OK"));
}
}
HTTP 503
错误的事实,但是至少可以进行探测。
关于kubernetes - 准备就绪和活跃度探测失败: HTTP probe failed with statuscode: 503 during starting of Varnish using Helm Chart Kubernetes”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60637970/
在 GKE 上,我尝试使用就绪探针/活性探针,并使用监控发布警报 https://cloud.google.com/monitoring/alerts/using-alerting-ui 作为测试,我
在我的 K8S 工作负载中,我实现了 Readiness 探测和 Liveness 探测以进行 pod 健康检查。 我想知道我是否应该将间隔 (periodSeconds) 设置为低至 1 秒,因为它
我正在尝试在 minicube kubernetes 集群中设置 istio1.5.1,我正在按照 Knative 的官方文档设置 istio 而无需 sidecar 注入(inject)。我正面临
我正在研究 linux 设备驱动程序。目前,我大致了解设备驱动程序的流程,但我不知道 probe() 函数如何获取其参数。 例如,这是我的代码,它基于内核 3.10。 static int gpio_
我正在编写一个简单的 YAML 文件以使用 Centos.6 上的 TCP 端口应用 active 探测 我从公共(public)存储库中提取了一个 centos:6 图像 使用图像启动了一个容器。
我对我的数据库使用了 Idera 的 SQL Doctor。它在“查询优化”类别中生成报告,我发现“列上的函数“PROBE”可能导致表扫描”。工具提供链接http://sqldoctor.idera.
我对我的数据库使用了 Idera 的 SQL Doctor。它在“查询优化”类别中生成报告,我发现“列上的函数“PROBE”可能导致表扫描”。工具提供链接http://sqldoctor.idera.
我正在努力理解 this omap2 Pandas 板的mcspi驱动代码。 不明白是谁调用了probe函数,this中的调用链是什么?驱动代码? 设备连接后如何通知驱动程序? 最佳答案 spi-om
我开始为通过笔记本电脑的 PCIe 扩展槽连接的 PCI 设备开发 Linux 设备驱动程序。 启动时,一切正常。但是,我正在尝试在线获得基本的 Hotplug 支持。当我弹出卡时,我可以看到(在 d
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 我们不允许提出有关书籍、工具、软件库等方面的建议的问题。您可以编辑问题,以便用事实和引用来回答它。 关闭
我正在使用 stale-if-error 来提供陈旧的内容,而在 grace 中查看 keep 和 vcl_hit 对象选项时,服务器被标记为不健康。 问题是:进入vcl子程序vcl_backend_
在我的 Kubernetes 设置中,我有 2 个 pod - A(通过部署)和 B(通过 DS)。 Pod B 以某种方式依赖于 Pod A 的完全启动。我现在想在 Pod B 中设置一个 HTTP
我目前正在研究哈希表,对双重哈希有点困惑。首先让我从我得到的信息开始。 首先创建一个数组来保存所有数据,并且它们按键排序。我使用公式 K % size 来查找键在数组中的位置。如果您将 key 提交到
有一个函数将从两个不同的平台驱动程序调用。我想知道linux的平台驱动核心是否有机会同时调用两个不同设备的probe()?如果是,那么从这两个 probe() 调用的公共(public)函数应该设计为
我正在尝试使用 linux perf 工具在特定功能期间监控性能统计数据。 我正在按照 https://perf.wiki.kernel.org/index.php/Jolsa_Features_To
在 kubernetes 官方文档中,我正在阅读此页面(关于 container probe 以及为什么我们应该使用 startup-probe) when-should-you-use-a-star
我正在尝试设置一个 2 节点 gluster 服务器。我已经在这两个节点中安装了 gluster-server 并启动了 glusterd 服务。 我能够从两台机器上对这些机器中的每台进行 ping
我有一个在 Ubuntu 容器内运行的进程,如果该进程被终止,我想重新部署该容器。我在容器规范中添加了以下活性探针 livenessProbe: exec: command:
所以我知道我想为其创建一个书签的应用程序,我知道该应用程序是使用 Angular 6 构建的。我做了一些谷歌搜索,找到了一种使用 article 修改 DOM 的方法。 第一步是调用probe ng上
我有一个 k8s 集群。我们的服务是基于队列的。我们的 pod 订阅事件队列,获取事件并执行任务。那么对于这种服务,k8s的liveness probe和readiness probe怎么定义呢? 最
我是一名优秀的程序员,十分优秀!