본문 바로가기
728x90
반응형

kubernetes21

[Kubernetes] 초간단 busybox 설치 busybox.yaml apiVersion: v1 kind: Pod metadata: name: busybox spec: containers: - name: busybox image: busybox command: - sleep - "3600" imagePullPolicy: IfNotPresent restartPolicy: Always 예제 - nc 사용 $ kubectl exec -it busybox sh -- nc localhost 6379 예제 - nslookup 사용 $ kubectl exec -it busybox sh -- nslookup kubernetes Server:10.96.0.10 Address:10.96.0.10:53 2022. 5. 23.
[kubernetes][redis] kubernetes에 redis 간단 설치 kubernetes에서 redis 간단 설치하기 redis.yaml 을 생성한 후 서비스 구동에 필요한 svc, configmap, pod을 정의한다. apiVersion: v1 kind: ConfigMap metadata: name: redis-config data: redis-config: | maxmemory 20mb maxmemory-policy allkeys-lru --- apiVersion: v1 kind: Service metadata: name: redis labels: app: redis spec: selector: app: redis ports: - name: redis protocol: TCP port: 6379 targetPort: 6379 --- apiVersion: v1 kind.. 2022. 5. 23.
[Kubernetes] command terminated with exit code 137 kubernetes pod 이 exit code 137로 죽었을 경우, 이는 OOMKilled (Out Of Memory) error로 pod의 Memory가 부족하여 죽는 경우이다. 이때 Resource에 할당된 Memory limit을 늘려서 OOMKilled를 예방 할 수 있다. Resources 영역에는 request와 limt이 있으며 아래와 같다. request : container에 할당되는 최소한의 memory limit : container에 할당될 수 있는 최대한의 memory exit code 137이 발생하는 경우는 container에서 사용되는 memory가 limit을 넘었을 경우 발생할 수 있다. limit을 늘리는 방법은 아래와 같다. yaml 수정방법 spec: repli.. 2022. 5. 17.
[Kubernetes][Docker] image pull ecr login kubernetes 클러스터 container에서 ecr login 인증을 얻기 위해 secret을 생성한 이후 클러스터 service account에 등록하여 ecr 인증이 되도록 해본다. 1. aws cli를 통해 ecr login aws ecr get-login-password --region ap-southeast-1 | docker login --username AWS --password-stdin {accountId}.dkr.ecr.ap-southeast-1.amazonaws.com 2. ecr login을 위한 secret 생성을 위한 password 얻어오기 $ aws ecr get-login-password --region ap-southeast-1 eyJwYXl....oxNjUyNzQx.. 2022. 5. 16.
728x90
반응형