<p>I was following this <a href="https://kubernetes.io/docs/tutorials/configuration/configure-redis-using-configmap/#real-world-example-configuring-redis-using-a-configmap/" rel="nofollow noreferrer">tutorial</a> to setup a configmap for a redis.conf. After I create the Redis deployment, I check to ensure that the redis.conf file is in each of the pods, and they are there. The problem is that when go in the redis-cli and check the configuration there, the redis.conf values aren't used. The default values are being used as if the Redis did not start up with the redis.conf file. </p>

<p>redis.conf</p>

<pre><code>maxclients 2000
requirepass "test"
</code></pre>

<p>redis-config configmap</p>

<pre><code>{
    "apiVersion": "v1",
    "data": {
        "redis-config": "maxclients 2000\nrequirepass \"test\"\n\n"
    },
    "kind": "ConfigMap",
    "metadata": {
        "creationTimestamp": "2018-03-07T15:28:19Z",
        "name": "redis-config",
        "namespace": "default",
        "resourceVersion": "2569562",
        "selfLink": "/api/v1/namespaces/default/configmaps/redis-config",
        "uid": "29d250ea-221c-11e8-969f-06c0c8d545d2"
    }
}
</code></pre>

<p>k8 redis manifest.json</p>

<pre><code>{
    "kind" : "Deployment",
    "apiVersion" : "extensions/v1beta1",
    "metadata" : {
        "name" : "redis-master",
        "creationTimestamp" : null
    },
    "spec" : {
        "replicas" : 2,
        "template" : {
            "metadata" : {
                "creationTimestamp" : null,
                "labels" : {
                    "app" : "redis",
                    "role" : "master",
                    "tier" : "backend"
                }
            },
            "spec" : {
                "hostNetwork" : true,
                "nodeSelector" :{ "role": "cache"},
                "containers" : [{
                        "name" : "master",
                        "image" : "redis",
                        "ports" : [{
                                "containerPort" : 6379,
                                "hostPort" : 6379,
                                "protocol" : "TCP"
                            }
                        ],
                        "volumeMounts" : [{
                                "mountPath" : "/redis-master",
                                "name": "config"
                            }
                        ],
                        "resources" : {},
                        "terminationMessagePath" : "/dev/termination-log",
                        "imagePullPolicy" : "IfNotPresent"
                    }],
                "volumes" : [{
                    "name" : "config",
                    "configMap" : {
                        "name" : "redis-config",
                        "items": [{
                            "key": "redis-config",
                            "path": "redis.conf"
                        }]
                        }
                    }
                ],    
                "restartPolicy" : "Always",
                "terminationGracePeriodSeconds" : 30,
                "dnsPolicy" : "ClusterFirst",
                "securityContext" : {}
            }
        }
    },
    "status" : {}
}
</code></pre>

<p>Now I know the tutorial uses a Pod kind, and I am using a Deployment kind, but I don't think that is the issue here.</p>

<p>It looks like you are pulling the default redis container. If you check the redis Dokerfiles, for example <a href="https://github.com/docker-library/redis/blob/d53b982b387634092c6f11069401679034054ecb/4.0/alpine/Dockerfile" rel="nofollow noreferrer">https://github.com/docker-library/redis/blob/d53b982b387634092c6f11069401679034054ecb/4.0/alpine/Dockerfile</a>, at the bottom, they have:</p>

<pre><code>CMD ["redis-server"]
</code></pre>

<p>which will start redis with the default configuration.</p>

<p>Per redis documentation:
<a href="https://redis.io/topics/quickstart" rel="nofollow noreferrer">https://redis.io/topics/quickstart</a>
under "Starting Redis" section, if you want to provide a different configuration, you would need to start redis with:</p>

<pre><code>redis-server &lt;config file&gt;
</code></pre>

<p>Additionally the example in Kubernetes documentation uses a different redis containter: </p>

<pre><code>image: kubernetes/redis
</code></pre>

<p>And from the Dokerfile: <a href="https://github.com/kubernetes/kubernetes/blob/master/examples/storage/redis/image/Dockerfile" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/master/examples/storage/redis/image/Dockerfile</a>, it seems like that one starts Redis with the provided configuration.</p>
