본문 바로가기

kubernetes, helm, rancher

(22)
master node untaint is not working. (taint를 지우려고 해도 계속 생겨나는 현상) VM으로 ubuntu를 사용하고 있는 나로써는, kubernetes를 cluster로 이용하기 위해서 매일 3개의 노드를 켰다, 껏다 하는 것이 귀찮아서 그냥 사소한 이슈는 master node에서만 실행하고 있었다. 그래서 항상 kube-system namespace에서 pod를 보면 항상 proxy와 coredns 2개는 항상 꺼져있었다. 그런데 cni인 weave-net은 왜 3개가 다 켜져있는거지? master node만 ready상태인데? 이건 또 따로 알아봐야할 것 같다. 일단, 오늘도 master node를 켜고 swapoff를 한 뒤, 아래와 같이 master node의 taint를 확인하고 삭제한다. 어라? 그런데 좀 이상한게 있다. 맨 마지막에 원래는 이라고 나와야하는데 taint가 안..
pod내의 Serviceaccount token 값과 secret token값이 다른 이유. pod 내에서 service account 이름을 지정해 줄 수 있으며, 지정을 안할 경우 default로 지정이 된다. default service account는 namespace가 만들어지면 자동으로 생성되고, secret 또한 자동으로 생성된다. 이러한 secret은 namespace(현재 service account가 존재하는), token, ca.crt 정보가 들어가 있다. 그리고 pod에서 이러한 값들을 mount한다. 그런데 여기서 이상한 점이 발견됬다. secret의 token 내용과 mount 된 token 내용이 다른 것이다. secret의 token 내용 mount된 token 내용 내용이 다른 이유는 아래 링크에 설명되어있는데, https://stackoverflow.com/que..
kubernetes config, Role, Rolebinding 기본적인 kubernetes resource, option 등을 설명한 블로그입니다. 추가적인 기능을 보고싶으시면 docs를 참고바랍니다. https://kubernetes.io/docs/home/ Kubernetes Documentation Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation. kubernetes.io 실제 서비스단계에서는 다양한 cluster, 다양한 c..
kubernetes etcdctl backup kubernetes volume, resources 등을 backup 하는 방법은 여러가지가 있다. 예를 들어 declative한 방법으로, 모든 resource를 하나의 yaml 파일안에 넣어 create하는 방법이 있다. kubectl get all --all-namespaces -o yaml > [file-name.yaml] -> 모든 resource 정보를 한 파일에 저장. 또한 etcdctl을 이용해 backup, restore 하는 방법도 있다. 하지만 아래와 같은 이유로 kubernetes 자원과 volume을 백업, 관리해주는 velero를 사용하는 것이 좋다. 개인 local에 kubernetes cluster가 있는 것이 아니라 GKE를 사용하는 등의 etcd 접근 권한이 없을 경우. ..
kubernetes networks, ingress, ingress controller 1. 기본적인 networking ip link # interface 확인 ip addr add [본인 cidr ex)192.168.0.5/24] dev [interface name ex)eth0] route # 다른 network로 가기위한 route table 확인 # 0.0.0.0의 gateway는 내부망으로 이동. ip route add [dest cidr 192.168.1.0/24] via [본인 게이트웨이 ex)192.168.0.1] # dest cidr에 default나 0.0.0.0을 넣어 모든 request는 게이트웨이로 보낼 수 있다. echo 1 > /proc/sys/net/ipv4/ip_forward # 중간다리 해주는 linux host는 default로 interface # fo..
kubernetes cluster upgrade kubernetes의 버전이 빠르게 update 되고 있는 시점에서 update를 어떻게 하면 좋을지 작성해보려고 한다. kubernetes 공식 문서에 cluster upgrade라고 검색하면 나오는데 그 과정을 정리해보겠다. cluster의 version을 upgrade하기 위해서 바로 최신버전으로 upgrade하는 것이 아니고 한단계를 upgrade를 해야한다. master node upgrade -> worker node upgrade at once(한번에) or 한개씩 한개씩. or add new version node. 1. Control plane upgrade master node를 먼저 upgrade를 하고 worker node를 차근차근 upgrade 하는 방식이다. 만약 node만 u..
kubernetes Auto Scaling, metric server kubernetes Autoscailing은 Cluster level scalability와 Pods layer autoscale로 나뉠 수 있다. Cluster level scalability는 pod를 node에 실행할 때 자원이 없어 pending상태라면 CA(Cluster Autoscailing)이 새로운 node를 확장한다. 이는 CSP환경(AWS, GCP, ASURE)에 적합하다. Pods layer autoscale은 HPA(Horizontal Pod Autocaler)는 pod개수를 계속적으로 증가해주는 것이고, VPA(Vertical Pods Autoscaler)는 pod의 request 자원의 limit을 증가시키는 것. Autoscailing을 사용하기 위해서는 Metrics-Serv..
kubernetes Volumes, pv, pvc, Storage class 기본적인 kubernetes resource, option 등을 설명한 블로그입니다. 추가적인 기능을 보고싶으시면 docs를 참고바랍니다. https://kubernetes.io/docs/home/ Kubernetes Documentation Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open source project is hosted by the Cloud Native Computing Foundation. kubernetes.io Volume은 kubernetes 스토리지의 추상화 개..