Notice
Recent Posts
Recent Comments
Link
«   2024/11   »
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
Archives
Today
Total
관리 메뉴

hellokiseok

Redis Docker or Docker-compose 본문

Docker

Redis Docker or Docker-compose

hellokiseok 2020. 5. 27. 18:11

Docker

# 간단 버전
docker run --name redis -d -p 6379:6379 redis redis-server

# 인증 추가
docker run --name redis -d -p 6379:6379 redis redis-server --requirepass 1234

 

Docker-compose

docker-compose.yml

version: '3.1'

services:
  redis:
    image: redis
    command: --requirepass 1234
    restart: always
    ports:
      - 6379:6379
docker-compose -f docker-compose.yml -p redis up

 

 


Kubernetes

Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis
  labels:
    app: redis
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: redis
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
        - name: redis
          image: redis
          command:
            - redis-server
          ports:
            - name: redis
              containerPort: 6379
---
apiVersion: v1
kind: Service
metadata:
  name: redis
  labels:
    name: redis
spec:
  ports:
    - port: 6379
      targetPort: 6379
  type: LoadBalancer
  selector:
    app: redis

 

 

 

 

 

참고 사이트 : https://hub.docker.com/_/redis

'Docker' 카테고리의 다른 글

Mysql Docker or Docker-compose  (0) 2020.05.26
Next.js + Docker 설정하기  (0) 2020.05.26