| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: pouchlab-redis
- namespace: pouchlab
- labels:
- app: pouchlab-redis
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: pouchlab-redis
- template:
- metadata:
- labels:
- app: pouchlab-redis
- spec:
- nodeSelector:
- kubernetes.io/hostname: k8s-node1
- containers:
- - name: redis
- image: k8s.device.wenhq.top:8583/docker_r/redis:7-alpine-amd64
- imagePullPolicy: IfNotPresent
- args: ["redis-server", "--maxmemory", "128mb", "--maxmemory-policy", "allkeys-lru", "--save", ""]
- ports:
- - name: redis
- containerPort: 6379
- resources:
- requests:
- cpu: 20m
- memory: 32Mi
- limits:
- cpu: 200m
- memory: 192Mi
- readinessProbe:
- exec:
- command: ["redis-cli", "ping"]
- initialDelaySeconds: 5
- periodSeconds: 10
- livenessProbe:
- exec:
- command: ["redis-cli", "ping"]
- initialDelaySeconds: 15
- periodSeconds: 20
- # Redis 仅作缓存(key 全部可重建),无需持久化卷
- volumes: []
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: pouchlab-redis
- namespace: pouchlab
- labels:
- app: pouchlab-redis
- spec:
- type: ClusterIP
- selector:
- app: pouchlab-redis
- ports:
- - name: redis
- port: 6379
- targetPort: 6379
|