cm ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: redissearch-conf
  namespace: sre
data:
  redis.conf: |
    bind 0.0.0.0
    port 6379
    requirepass 123456
    cluster-node-timeout 5000
    protected-mode no


Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: redisearch
  namespace: sre
spec:
  replicas: 1
  selector:
    matchLabels:
      name: redisearch
  template:
    metadata:
      labels:
        name: redisearch
    spec:
      containers:
        - name: redisearch
          image: redislabs/redisearch:2.4.0  
          imagePullPolicy: IfNotPresent
          command:
            - sh
            - -c
            - "exec redis-server /etc/redis/redis.conf"
          ports:
            - containerPort: 6379
              name: redis
              protocol: TCP
          volumeMounts:
            - name: redis-config
              mountPath: /etc/redis
      volumes:
        - name: redis-config
          configMap:
            name: redissearch-conf

svc

kind: Service
apiVersion: v1
metadata:
  name: redisearch
  namespace: sre
spec:
  type: NodePort
  ports:
    - name: redis
      port: 6379
      targetPort: 6379
      nodePort: 30077
      protocol: TCP
  selector:
    name: redissearch-conf

发表回复

您的电子邮箱地址不会被公开。

Captcha Code