mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
add notes
This commit is contained in:
parent
61d29d8ac1
commit
7128b76adf
@ -27,6 +27,6 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: myapp
|
- name: myapp
|
||||||
image: calinrus/api-redis-ha:1.0
|
image: aimvector/api-redis-ha:1.0
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5000
|
- containerPort: 5000
|
@ -1,9 +1,25 @@
|
|||||||
|
|
||||||
|
# Create a namespace
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl create ns example
|
||||||
|
```
|
||||||
|
|
||||||
|
# Deploy our statefulset
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl -n example apply -f .\kubernetes\statefulsets\statefulset.yaml
|
||||||
|
kubectl -n example apply -f .\kubernetes\statefulsets\example-app.yaml
|
||||||
|
```
|
||||||
|
|
||||||
# Enable Redis Cluster
|
# Enable Redis Cluster
|
||||||
|
|
||||||
|
```
|
||||||
$IPs = $(kubectl -n example get pods -l app=redis-cluster -o jsonpath='{range.items[*]}{.status.podIP}:6379 ')
|
$IPs = $(kubectl -n example get pods -l app=redis-cluster -o jsonpath='{range.items[*]}{.status.podIP}:6379 ')
|
||||||
kubectl -n example exec -it redis-cluster-1 -- /bin/sh -c "redis-cli -h 127.0.0.1 -p 6379 --cluster create ${IPs}"
|
kubectl -n example exec -it redis-cluster-1 -- /bin/sh -c "redis-cli -h 127.0.0.1 -p 6379 --cluster create ${IPs}"
|
||||||
kubectl -n example exec -it redis-cluster-0 -- /bin/sh -c "redis-cli -h 127.0.0.1 -p 6379 cluster info"
|
kubectl -n example exec -it redis-cluster-0 -- /bin/sh -c "redis-cli -h 127.0.0.1 -p 6379 cluster info"
|
||||||
|
```
|
||||||
|
|
||||||
# More info
|
# More info
|
||||||
|
|
||||||
https://rancher.com/blog/2019/deploying-redis-cluster
|
https://rancher.com/blog/2019/deploying-redis-cluster
|
Loading…
x
Reference in New Issue
Block a user