eksctl, kubectl, helm 설치
brew tap weaveworks/tap
brew install weaveworks/tap/eksctl
eksctl version
brew install kubectl
kubectl version
aws eks update-kubeconfig --region ap-northeast-2 --name __cluster_name__
brew install helm
helm version
helm repo version
namespace 생성
# kubectl -n redis apply -f namespace.yml
apiVersion: v1
kind: Namespace
metadata:
name: redis
bitnami 차트 설치 및 버전 확인
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm search repo bitnami/redis --versions
가장 최근 버전의 yaml 파일 가져오기
helm show values bitnami/redis --version=20.5.0 > values_override.yaml
다음 정보 수정
master:
count: 1 -> 3
persistence:
enabled: true -> false
replica:
persistence:
enabled: true -> false
인스톨 명령
helm -n redis upgrade --install redis bitnami/redis \
--values values_override.yaml \
--version 20.5.0
결과
Release "redis" does not exist. Installing it now.
NAME: redis
LAST DEPLOYED: Mon Dec 16 15:11:04 2024
NAMESPACE: redis
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: redis
CHART VERSION: 20.5.0
APP VERSION: 7.4.1
Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami for more information.
** Please be patient while the chart is being deployed **
Redis® can be accessed on the following DNS names from within your cluster:
redis-master.redis.svc.cluster.local for read/write operations (port 6379)
redis-replicas.redis.svc.cluster.local for read-only operations (port 6379)
To get your password run:
export REDIS_PASSWORD=$(kubectl get secret --namespace redis redis -o jsonpath="{.data.redis-password}" | base64 -d)
To connect to your Redis® server:
1. Run a Redis® pod that you can use as a client:
kubectl run --namespace redis redis-client --restart='Never' --env REDIS_PASSWORD=$REDIS_PASSWORD --image docker.io/bitnami/redis:7.4.1-debian-12-r2 --command -- sleep infinity
Use the following command to attach to the pod:
kubectl exec --tty -i redis-client \
--namespace redis -- bash
2. Connect using the Redis® CLI:
REDISCLI_AUTH="$REDIS_PASSWORD" redis-cli -h redis-master
REDISCLI_AUTH="$REDIS_PASSWORD" redis-cli -h redis-replicas
To connect to your database from outside the cluster execute the following commands:
kubectl port-forward --namespace redis svc/redis-master 6379:6379 &
REDISCLI_AUTH="$REDIS_PASSWORD" redis-cli -h 127.0.0.1 -p 6379
WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs:
- replica.resources
- master.resources
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
'Operating System > Kubernetes' 카테고리의 다른 글
[Kubernetes] k8s, helm으로 kafka 설치하는 방법 (0) | 2024.12.15 |
---|