有时我们会发现ES中缺少一些日志,而在Kubernetes中却可以看到它们。
我只能在日志中找到问题,指出 kubernetes 解析器的问题,在 fluid-bit 日志中包含以下内容:
[2020/11/22 09:53:18] [debug] [filter:kubernetes:kubernetes.1] could not merge JSON log as requested
一旦我们将 kubernetes 过滤器的“Merge_Log”选项配置为“Off”,问题似乎就消失了(至少在流利位日志中不再出现“警告/错误”)。但是,我们当然会失去一个重要的功能,例如实际上拥有除“消息”本身之外的字段/值。
除此之外,在 fluid-bit 或 elasticsearch 中没有其他错误/警告消息,这就是我主要怀疑的原因。日志(info中的log_level)填充为:
k --context contexto09 -n logging-system logs -f -l app=fluent-bit --max-log-requests 31 | grep -iv "\[ info\]"
[2020/11/22 19:45:02] [ warn] [engine] failed to flush chunk '1-1606074289.692844263.flb', retry in 25 seconds: task_id=31, input=appstream > output=es.0
[2020/11/22 19:45:02] [ warn] [engine] failed to flush chunk '1-1606074208.938295842.flb', retry in 25 seconds: task_id=67, input=appstream > output=es.0
[2020/11/22 19:45:08] [ …
Run Code Online (Sandbox Code Playgroud) 这个可以换吗
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: elastic-operator
labels:
argocd.application.type: "system"
spec:
ignoreDifferences:
- group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
jsonPointers:
- /webhooks/0/clientConfig/caBundle
- group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
jsonPointers:
- /webhooks/1/clientConfig/caBundle
- group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
jsonPointers:
- /webhooks/2/clientConfig/caBundle
Run Code Online (Sandbox Code Playgroud)
对于使用“通配符”的东西?以下是我正在寻找的“非工作”示例:
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: elastic-operator
labels:
argocd.application.type: "system"
spec:
ignoreDifferences:
- group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
jsonPointers:
- /webhooks/[*]/clientConfig/caBundle
Run Code Online (Sandbox Code Playgroud)
我无法在他们的文档中找到任何说明这是可能的或相反的内容。iehttps://argoproj.github.io/argo-cd/user-guide/diffing/ 似乎正在使用“json-patch”,但阅读了一些 RFC,我也找不到有关通配符的任何信息。
谢谢!
我正在尝试检查某些字符串是否是列表的元素之一。我设法获得了预期的结果,但是如果没有警告说,我无法找到一种方法:
[警告]:当语句不应包含jinja2模板分隔符时,例如{{}}或{%%}。
您能帮助我了解如何针对此用例做出正确的“何时”声明吗?
这是变量的内容repos
:
TASK [debug msg={{ repos }}]
ok: [zimbramta01.essi.lab] => {
"msg": {
"changed": true,
"cmd": "yum repolist | cut -f1 -d\" \" | grep -iv
\"repolist\\|loaded\\|repo\"",
"delta": "0:00:10.884070",
"end": "2018-09-20 08:03:55.210767",
"failed": false,
"rc": 0,
"start": "2018-09-20 08:03:44.326697",
"stderr": "",
"stderr_lines": [],
"stdout": "epel/x86_64\nrhel-7-server-htb-rpms/x86_64\nrhel-7-server-
rpms/7Server/x86_64\nzimbra\nzimbra-889-network\nzimbra-889-oss",
"stdout_lines": [
"epel/x86_64",
"rhel-7-server-htb-rpms/x86_64",
"rhel-7-server-rpms/7Server/x86_64",
"zimbra",
"zimbra-889-network",
"zimbra-889-oss"
]
}
}
Run Code Online (Sandbox Code Playgroud)
这就是我的“何时”语句的样子(它正在起作用,我只想学习如何正确编写它)。
- name: agrega repositorio epel
shell: rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
args:
warn: False
when: '"epel/x86_64" not in {{ repos.stdout_lines …
Run Code Online (Sandbox Code Playgroud) 为了获得与 IP 地址/网络掩码对应的值“24”,我有以下工作代码:
- set_fact:
ip: "{{ ansible_default_ipv4.address }}/{{ansible_default_ipv4.netmask }}"
- set_fact:
mask_cidr: "{{ ip | ipaddr('prefix') }}"
Run Code Online (Sandbox Code Playgroud)
其中ansible_default_ipv4.address
=172.16.1.67
和ansible_default_ipv4.netmask
是255.255.255.0
按照gather_facts
或setup
模块。
我尝试了不同的方法来使这段代码“更智能”,所以我只需要设置 1 个事实而不是 2 个,但是我的过滤能力并不强。
关于如何将这两个事实转换为一个更聪明的事实的想法?
尝试使用timeout
andbash
作为入口点未按预期工作。即使在指定的超时后,Pod 仍会继续运行。目的是有一个bash -c
入口点,我可以为其定义超时,之后 pod 会进入“错误”状态。一旦它起作用,这将用于使备份/清理等作业超时,否则这些作业可能会永远卡住。
apiVersion: v1
kind: Pod
metadata:
labels:
run: redis-cli
name: redis-cli
spec:
containers:
- name: redis-cli
image: xxxx/redis-cli:0.0.1
imagePullPolicy: Always
env:
- name: REDIS_SERVICE
value: redis.svc
- name: REDIS_PORT
value: "6666"
command: ['/usr/bin/timeout', '20', '/bin/bash', '-c' ]
args:
- sleep 6000
resources:
limits:
memory: "12Gi"
cpu: "2000m"
dnsPolicy: ClusterFirst
restartPolicy: Never
Run Code Online (Sandbox Code Playgroud) 我想在单个 GKE 项目中配置 Google ArtifactRegistry,以便所有其他项目都可以访问此集中式 ArtifactRegistry。
在 Google 文档中,我不清楚如何实现这一点,特别是对于使用默认帐户的 Google Kubernetes Engine 节点。
您知道如何配置访问权限来实现该场景吗?
谢谢你,
repository google-cloud-platform google-kubernetes-engine google-artifact-registry cicd
给定以下值.yaml
elements:
first:
enabled: true
url: first.url
second:
enabled: flase
url: second.url
third:
enabled: true
url: third.url
Run Code Online (Sandbox Code Playgroud)
获得以下结果的好方法是什么:
list_of_elements=first,third
Run Code Online (Sandbox Code Playgroud)
结果列表只需包含已启用的元素。该列表必须是单行逗号分隔的项目。
kubernetes ×3
ansible ×2
jinja2 ×2
argocd ×1
cicd ×1
fluent-bit ×1
fluentd ×1
json-patch ×1
jsonpath ×1
repository ×1
yaml ×1