kubernetes redis 数据持久化
来源:互联网 发布:淘宝保养品店铺推荐 编辑:程序博客网 时间:2024/06/12 16:11
1.编写 configmap : redis-config 文件 就是 redis 的配置文件 这里略。
(1)创建configmap
$ kubectl create configmap example-redis-config --from-file=configmap/redis-config
(2)查看configmap 信息
$ kubectl get configmap example-redis-config -o yaml
2.编写 redis-rc.yml
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: f-registry:5000/redis_db
env:
- name: MASTER
value: "true"
ports:
- containerPort: 6378
hostPort: 6378
resources:
limits:
cpu: "0.1"
volumeMounts:
- mountPath: /data
name: data1
#- mountPath: /data
# name: data2
- mountPath: /usr/local/etc/redis
name: config
volumes:
- name: data1
#emptyDir: {}
hostPath:
path: /data/redis
#- name: data2
#hostPath:
#path: /data/redis//usr/local/bin/redis-check-aof
- name: config
configMap:
name: example-redis-config
items:
- key: redis-config
path: redis.conf
3. 官方的 redis 镜像默认没有 redis.conf 编写 Dockerfile
FROM index.tenxcloud.com/docker_library/redis
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
redis.conf 略
- kubernetes redis 数据持久化
- kubernetes mysql数据持久化
- redis数据持久化
- Redis数据持久化
- redis数据持久化
- redis数据持久化
- Redis数据持久化
- Redis数据持久化
- Redis数据持久化
- redis 数据持久化
- Redis 数据持久化
- Redis 数据持久化
- redis数据持久化
- Redis数据持久化
- redis 数据持久化
- Redis 数据持久化
- redis 数据持久化
- Redis数据持久化
- GO语言并发编程
- c3p0三种配置方式
- 关于qt下输出汉字出现乱码的解决办法
- ListView实现CheckBox的单选与多选
- 链表问题---判断一个链表是否为回文结构
- kubernetes redis 数据持久化
- 踩坑记录史,一把辛酸泪
- JQuery的ajaxFileUpload的使用
- Gcc编译器
- 123
- android抽奖大转盘
- 使用nginx的gzip大幅度提升页面的加载速度
- Android中内存泄漏的几种情况
- 3个 优秀Linux 网络监视器!