惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News - Newest:
Hacker News - Newest: "LLM"
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
N
News and Events Feed by Topic
T
Troy Hunt's Blog
PCI Perspectives
PCI Perspectives
W
WeLiveSecurity
N
News | PayPal Newsroom
Recent Commits to openclaw:main
Recent Commits to openclaw:main
V2EX - 技术
V2EX - 技术
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threat Research - Cisco Blogs
L
LINUX DO - 热门话题
Cloudbric
Cloudbric
S
Secure Thoughts
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
Y
Y Combinator Blog
L
LangChain Blog
Recorded Future
Recorded Future
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
Attack and Defense Labs
Attack and Defense Labs
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
小众软件
小众软件
H
Hacker News: Front Page
The Hacker News
The Hacker News
T
Tailwind CSS Blog
The Register - Security
The Register - Security
Hacker News: Ask HN
Hacker News: Ask HN
P
Privacy & Cybersecurity Law Blog
P
Palo Alto Networks Blog
S
Securelist
腾讯CDC
雷峰网
雷峰网
G
Google Developers Blog
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
P
Privacy International News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
Arctic Wolf
www.infosecurity-magazine.com
www.infosecurity-magazine.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
阮一峰的网络日志
阮一峰的网络日志
AI
AI

Oskyla 烹茶室

修复 Joplin on KDE 菜单栏显示问题 Copy Fail:Linux 内核 2017 年至今的高危漏洞(附临时缓解方案) | CVE-2026-31431 Hermes Agent — 在 K3s / K8s 中运行指南 在 K3s 节点上安装并使用 nerdctl Mouser:轻量开源的罗技鼠标驱动替代方案 Claude Opus 4.7:优缺点与评测信息汇总 openFuyao NPU-Operator故障排查 openFuyao 2603 共测测试报告 openFuyao InferNex AI推理集成部署 310P(300I Pro) 环境问题记录及解决 ceph mon Operation not permitted 问题解决 Ascend 310P + openFuyao + NPU-Operator 故障排查 KDE Plasma6 禁用全局菜单,恢复正常应用菜单 终极指南:在 Linux 裸机服务器上快速部署 Moltbot (原 Clawbot) 并集成飞书 Windows 配置 Claude Code 解决 settings.json 不生效 Windows 配置 Claude Code 全流程 2025-12-31 | 年终总结 AI 生图精品提示词|第二期:城市星球 AI 生图精品提示词|第一期 Kubernetes kubectl --raw 使用指南 彻底解决阿里云和 tailscale 冲突 2025-10-21 | 沉淀思维 macOS 单独为鼠标或触控板开启自然滚动 2025-10-16 | 负载高低 2025-10-15 | 睡眠周期 2025-10-14 | 转换情绪与独立观点 go 拉取 gitcode.com 私有 mod Git 将某个文件恢复到其他分支的状态 SSH 通过跳板机连接 lxc 使用 chronyc 构建 ntp 服务 2025-10-13 | 独立思考于未来能源 2025-10-12|AI Review 及高质量工作流 2025-10-11 | 人生阶段 2025-10-10 | AI Logo | 远程操控 AI 2025-10-09 | 去班味|银杏|域名 2025-10-08 2025-10-07 2025-10-06 2025-10-05 优秀的 SubReddit 清单 Synology 群晖重置 Syncthing 密码 让 LLM 看到真实世界的 Playwright MCP 磁盘占用分析利器 ncdu 自建 gitlab 徽标问题导致项目 500 问题解决 harbor Chartmuseum helm 图表缓存刷新 grep exclude 排除 Debian 11 + PVE LACP Mac 冲突问题调查与解决方案 Claude Code 实用技巧 CentOS 7 重置 root 密码 telnet 如何退出 kubernetes 的挂载传播(mount propagation)机制 vim 将命令输出到当前位置 harbor 替换 ssl 证书 AI提效之使用 cherry-studio + k8sgpt 实现 AI 巡检 k8s Claude Code Subagents 快速开始 《我看见的世界:李飞飞自传》 Lyra - AI Prompt Optimization Specialist Linux 自签名 CA 证书安装方法 超级玛丽、魂斗罗等经典小游戏聚合站 | PlayUnb 个人业余开发项目清单 快速选出收益最高的理财产品 | finance-calculator 苹果液态玻璃风格图像生成和模拟器 | LiquedGlass.icu Linux 进程绑定NUMA节点或CPU核心 判断GPT是否降智的几个问题 Harmony next hap 安装 名侦探柯南贝尔摩德出场集数 k3s k8s 快速部署轻量节点监控方案 beszel k3s-k8s 实现 DevOps 方案横向对比 k8s 配置访问私有镜像仓库 GoAccess 分析多网站日志方法 Octant - 以开发人员为中心的开源 Kubernetes Web 界面 Tailscale 自建 DERP 并配置 SSL 完整教程 OpenManus 使用记录 Plausible 缺失 location 信息的研究 解决 Nginx Ingress returns 413 Entity Too Large 绘图模型效果对比之城市气象 【转】k8s 认知路线 OpenFOAM 两大分支的详细比较 第一个 CUDA 程序之矩阵运算计算效能对比 Archlinux KDE Apache JMeter 配置高分屏缩放 解决 gitlab-runner 移除残留文件 permission denied nginx-ingress 配置路由 302 k8s 触发 pod 重新拉取镜像平滑升级的方法 Clickhouse 迁移后 permission denied 问题解决 Linux CPU 运行模式及功耗分析 Linux vim vi 翻页跳转命令快捷键 git 拉取所有 branch 和 tag 到本地并推送到远程 Rails 性能分析工具 rack-mini-profiler 和 bullet 全球国家、城市、地区开源数据库 Rails Active Record 常用命令 Rails Rake 简介与编写 如何调试 Vim 脚本 名侦探柯南松田阵平出场集数(最新1069话) 名侦探柯南妃英理出场集数(最新1069话) 《名侦探柯南》官方人气投票结果 名侦探柯南TV安室透出场集数(最新1110话) 名侦探柯南TV赤井秀一出场集数(更新至1194话) [转]名侦探柯南TV主线集数整理(截止1165集) 架构风格总结 [转译] 如何成为一个好的开发者? 【影评】名侦探柯南·零的执行人
k8s 使用官方 compose 部署 plausible
Tianlun Song · 2024-11-11 · via Oskyla 烹茶室

本文 首发于 🌱 煎茶转载 请注明 来源

主要记录使用 kompose 转换部署 compose 程序的思路,具体过程根据情况调整。

首先获取官方 compose 配置:

git clone -b v2.1.4 --single-branch https://github.com/plausible/community-edition plausible-ce
cd plausible-ce

调整配置

之后根据需要定制配置文件:

$ touch .env
$ echo "BASE_URL=https://plausible.example.com" >> .env
$ echo "SECRET_KEY_BASE=$(openssl rand -base64 48)" >> .env

# 服务暴露根据需要配置
# 这里采用反代的方法
$ echo "HTTP_PORT=8000" >> .env

之后定制一下 compose.yaml,其中有一些不合理的地方,直接使用 kompose 转换会出问题:

diff --git a/compose.yml b/compose.yml
index 2fe91e5..dd42713 100644
--- a/compose.yml
+++ b/compose.yml
@@ -1,16 +1,18 @@
 services:
-  plausible_db:
+  plausible-db:
     image: postgres:16-alpine
     restart: always
     volumes:
       - db-data:/var/lib/postgresql/data
     environment:
       - POSTGRES_PASSWORD=postgres
+    ports:
+      - 5432:5432
     healthcheck:
       test: ["CMD-SHELL", "pg_isready -U postgres"]
       start_period: 1m
 
-  plausible_events_db:
+  plausible-events-db:
     image: clickhouse/clickhouse-server:24.3.3.102-alpine
     restart: always
     volumes:
@@ -24,6 +26,8 @@ services:
       nofile:
         soft: 262144
         hard: 262144
+    ports:
+      - 5432:5432
     healthcheck:
       test: ["CMD-SHELL", "wget --no-verbose --tries=1 -O - http://127.0.0.1:8123/ping || exit 1"]
       start_period: 1m
@@ -33,9 +37,9 @@ services:
     restart: always
     command: sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
     depends_on:
-      plausible_db:
+      plausible-db:
         condition: service_healthy
-      plausible_events_db:
+      plausible-events-db:
         condition: service_healthy
     volumes:
       - plausible-data:/var/lib/plausible
@@ -43,6 +47,9 @@ services:
       nofile:
         soft: 65535
         hard: 65535
+    env_file: ".env"
+    ports:
+      - 8000:8000
     environment:
       - TMPDIR=/var/lib/plausible/tmp
       # required: https://github.com/plausible/community-edition/wiki/configuration#required
@@ -54,28 +61,28 @@ services:
       - DISABLE_REGISTRATION
       - ENABLE_EMAIL_VERIFICATION
       # web: https://github.com/plausible/community-edition/wiki/configuration#web
-      - HTTP_PORT
+      - HTTP_PORT=8000
       - HTTPS_PORT
       # databases: https://github.com/plausible/community-edition/wiki/configuration#database
-      - DATABASE_URL
-      - CLICKHOUSE_DATABASE_URL
+      - DATABASE_URL=postgres://postgres:postgres@plausible_db:5432/plausible_db
+      - CLICKHOUSE_DATABASE_URL=http://plausible_events_db:8123/plausible_events_db

之后需要对 clickhouse 做一些配置,暂时解决 Application: Disabling cgroup memory observer because of an error during initialization: Code: 107. DB::Exception: Cannot find cgroups v1 or v2 current memory file 问题:

diff --git a/clickhouse/ipv4-only.xml b/clickhouse/ipv4-only.xml
index 7eb0a5c..4c8222d 100644
--- a/clickhouse/ipv4-only.xml
+++ b/clickhouse/ipv4-only.xml
@@ -1,3 +1,4 @@
 <clickhouse>
     <listen_host>0.0.0.0</listen_host>
+    <cgroups_memory_usage_observer_wait_time>0</cgroups_memory_usage_observer_wait_time>
 </clickhouse>

转换资源清单

一切就绪后转换:

kompose convert -f compose.yaml  --controller statefulset -o plausible.yaml

检查一下文件,不喜欢的可以再调整,比如条整 pvc 大小。

最后使用 ingress 暴露:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-plausible
  namespace: plausible
  annotations:
    cert-manager.io/cluster-issuer: issuer01
spec:
  ingressClassName: nginx
  rules:
  - host: example.com
    http:
      paths:
      - backend:
          service:
            name: plausible
            port:
              number: 8000
        path: /
        pathType: Prefix
  tls:
  - hosts:
      - example.com
    secretName: plausible-example-com-tls

检查 pod 状态,检查服务状态,最后访问,结束。

问题解决

pv 权限问题

如果出现这个故障:

Attaching to plausible
plausible  | Loading plausible..
plausible  | Starting dependencies..
plausible  | Starting repos..
plausible  | Plausible.Repo database already exists
plausible  | Plausible.IngestRepo database already exists
plausible  | Creation of Db successful!
plausible  | Loading plausible..
plausible  | Starting dependencies..
plausible  | Starting repos..
plausible  | Runtime terminating during boot (terminating)
plausible  | 09:55:19.599 [notice] Application tzdata exited: exited in: Tzdata.App.start(:normal, [])
plausible  |     ** (EXIT) an exception was raised:
plausible  |         ** (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed_to_start_child, Tzdata.EtsHolder, {%File.Error{reason: :enoent, path: "/var/lib/plausible/tzdata_data/release_ets", action: "list directory"}, [{File, :ls!, 1, [file: ~c"lib/file.ex", line: 1700]}, {Tzdata.EtsHolder, :release_files_for_dir, 1, [file: ~c"lib/tzdata/ets_holder.ex", line: 127]}, {Tzdata.EtsHolder, :make_sure_a_release_is_on_file, 0, [file: ~c"lib/tzdata/ets_holder.ex", line: 90]}, {Tzdata.EtsHolder, :init, 1, [file: ~c"lib/tzdata/ets_holder.ex", line: 16]}, {:gen_server, :init_it, 2, [file: ~c"gen_server.erl", line: 2057]}, {:gen_server, :init_it, 6, [file: ~c"gen_server.erl", line: 2012]}, {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 329]}]}}}}
plausible  |             (tzdata 1.1.2) lib/tzdata/tzdata_app.ex:13: Tzdata.App.start/2
plausible  |             (kernel 10.0) application_master.erl:295: :application_master.start_it_old/4
plausible  |
plausible exited with code 1

找到 pv 位置执行:

chown -R 999:nogroup /mnt/hdd-mirror/docker/plausible/data/

之后重启 plausible pod 即可。

References

#Kubernetes