O.Man
O.Man

Reputation: 639

Expose container in Kubernetes

I want to create specific version of redis to be used as a cache. Task:

This are my steps:

Upvotes: 0

Views: 313

Answers (2)

aballaci
aballaci

Reputation: 1083

The best way to go about it is to take a stable helm chart from https://hub.helm.sh/charts/stable/redis-ha. Do a helm pull and modify the values as you need. Redis should be definde as a Statefulset for various reasons. You could also do a

mkdir my-redis
helm fetch --untar --untardir . 'stable/redis' #makes a directory called redis 
helm template --output-dir './my-redis' './redis' #redis dir (local helm chart), export to my-redis dir

then use Kustomise if you like.

You will notice that a redis deployment definition is not so trivial when you see how much code there is in the stable chart.

You can then expose it in various ways, but normally you need the access only within the cluster. If you need a fast way to test from outside the cluster or use it as a development environment check the official ways to do that.

Upvotes: 0

Arghya Sadhu
Arghya Sadhu

Reputation: 44549

You should not use sleep to keep a redis pod running. As long as the redis process runs in the container the pod will be running.

Upvotes: 1

Related Questions