k8s启动单机influxdb

1. 编排文件

创建 influxd.yml文件如下:

kind: Deployment
apiVersion: apps/v1
metadata:
name: iot-influxdb
namespace: iot-influxdb
spec:
replicas: 1
selector:
matchLabels:
name: influxdb
template:
metadata:
labels:
name: influxdb
spec:
containers:
- name: iot-influxdb
image: influxdb:1.8.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8086
protocol: TCP
volumeMounts:
- mountPath: /var/lib/influxdb
name: influxdata
env:
- name: NFLUXDB_REPORTING_DISABLED
value: "true"
- name: INFLUXDB_HTTP_FLUX_ENABLED
value: "false"
- name: INFLUXDB_HTTP_LOG_ENABLED
value: "false"
- name: INFLUXDB_HTTP_ACCESS_LOG_PATH
value: "/var/lib/influxdb/influxdb_http.log"
- name: INFLUXDB_RETENTION_ENABLED
value: "true"
- name: INFLUXDB_RETENTION_CHECK_INTERVAL
value: "8h"
- name: INFLUXDB_DB
value: "iot"
- name: TZ
value: Asia/Shanghai
volumes:
- name: influxdata
persistentVolumeClaim:
claimName: influx-data
---
kind: Service
apiVersion: v1
metadata:
name: iot-influxdb
namespace: iot-influxdb
labels:
name: iot-influxdb
spec:
type: NodePort
ports:
- protocol: TCP
nodePort: 31523
targetPort: 8086
port: 8086
selector:
name: influxdb
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: influx-data
namespace: iot-influxdb
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi

2. 创建服务

# kubectl create namespace influxdb
# kubectl create -f influxdb.yml

在这里插入图片描述

posted on   运维开发玄德公  阅读(33)  评论(0编辑  收藏  举报  

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示