swap을 사용하지 못하는 kubenertes를 사용해서 ghost pod/container를 구동하니 메모리가 부족하다고 종료되어 버린다.
확인해 보니 서버로 사용하고 있는 mac mini 2009에 장착된 RAM이 4G였다. 흠…
인터넷에서 mac mini 2009의 HW 사양을 찾아 보니 DDR3 1066 MHz라고. 그리고 다른 블로그를 찾아 보니 그 보다 나중에 나온 더 높은 클럭의 RAM을 실장해도 동작하는 데는 문제가 없단다. 다만 지금은 사용하지 않는 DDR3 제품이라 구하는 게 문제일 듯. 하지만 혹시나 하고 예전에 모아둔 메모리 더미를 뒤져보니 딱 맞는 메모리가 있었다.
중요한 일은
생각을 기반으로 함. 기계적으로 대응 불가 소통이 따름. 조직의 일은 혼자 할 수 없으므로 결정이 수반되야 함. 길이 하나가 아닌 까닭 실행이 따름. 결정만으로 결과가 오는 것이 아님 52시간법은 일하는 시간에 제약이 가해지는 것이다. 충분한 시간을 투자해서 결과를 얻어내던 방식에서 달라져야 한다.
직장 생활에서 반드시 익혀야 할 기술은 ‘생각을 정리하여 말이나 글로 표현하는 기술’
일 때문에 일을 하는 것이 아니라 성과를 위해 일을 하는 것이다.
WBS(Work Breakdown Structure)
부제 1. pod가 동작하지 않을때 원인 찾기 부제 2. helm upgrade 명령을 이용하여 업데이트 하기 부제 3. sqlite를 이용해서 ghost.db 직접 수정하기 values.yaml에 명시되어 있는 ghost docker image의 버전 정보를 2.31.0에서 3.0.2 최신 버전으로 업데이트 후 아래 명령어로 업데이트
$ helm upgrade --debug my-ghost ghost-with-helm [debug] Created tunnel using local port: '45263' [debug] SERVER: "127.0.0.1:45263" REVISION: 6 RELEASED: Tue Nov 5 22:25:19 2019 CHART: ghost-0.1.0 USER-SUPPLIED VALUES: {} COMPUTED VALUES: affinity: {} env: node_env: production url: http://sosa0sa.
helm 명령을 입력했는데 다음과 같은 에러 메시지를 내면서 실행을 거부한다.
$ helm ls snap-confine has elevated permissions and is not confined but should be. Refusing to continue to avoid permission escalation attacks 에러 메시지를 찾아보니 보안 관련된 내용이 이슈라고 다음과 같이 하면 해결된다.
$ sudo systemctl enable --now apparmor.service Synchronizing state of apparmor.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable apparmor 하지만 이제는 helm의 client와 server 버전이 맞지 않다는 에러
mini1 리붓 후 ghost 접속이 안됨.
docker를 직접 실행시키는 wordpress는 정상적으로 실행
그래서 kubectl get svc 명령을 치니 접속이 안된다고.
$ ps -ef |grep kube cychong 7461 2486 0 23:26 pts/0 00:00:00 grep --color=auto kube $ service kubelet status ● kubelet.service - kubelet: The Kubernetes Node Agent Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/kubelet.service.d └─10-kubeadm.conf Active: activating (auto-restart) (Result: exit-code) since Mon 2019-11-04 23:26:47 KST; 5s ago Docs: https://kubernetes.
Check if SCTP is supported by creating SCTP service https://blog.aweimeow.tw/enable-sctp-in-kubernetes-cluster/
cychong@mini1:~/work/sctp$ cat service.yaml apiVersion: v1 kind: Service metadata: name: sctp spec: selector: app: sctp ports: - protocol: SCTP port: 9999 targetPort: 30001 cychong@mini1:~/work/sctp$ kubectl create -f service.yaml The Service "sctp" is invalid: spec.ports[0].protocol: Unsupported value: "SCTP": supported values: "TCP", "UDP" Enable SCTP in running kubernetes cluster https://stackoverflow.com/questions/55909512/how-to-configure-already-running-cluster-in-kubernetes
Basically you must pass this flag to kube-apiserver. How you can do that depends on how you set up the cluster.
cychong@mini1:~/work/ghost-with-helm-x$ sudo apt update [sudo] password for cychong: Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease Hit:4 https://download.docker.com/linux/ubuntu bionic InRelease Hit:5 http://dl.google.com/linux/chrome/deb stable Release Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Hit:1 https://packages.cloud.google.com/apt kubernetes-xenial InRelease Get:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Get:9 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [295 kB] Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [73.8 kB] Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [147 kB] Get:13 http://archive.
하나의 Helm chart를 이용하여 여러 개의 pod를 설치 하는 nested chart 인 경우 각각의 pod에 대한 CPU requirement는 각 subchart의 values.yaml에 resources 항목에 기술하면 된다.
아래는 ONAP중 closed loop control에서 Data collection을 담당하는 DCAE의 SW들을 kubernets에 배포하기 위해 만들어진 차트들이다. 다음과 같이 8개의 chart들로 구성되어 있고,
$ tree -d oom/kubernetes/dcaegen2/charts/ -L 1 oom/kubernetes/dcaegen2/charts/ ├── dcae-bootstrap ├── dcae-cloudify-manager ├── dcae-config-binding-service ├── dcae-deployment-handler ├── dcae-healthcheck ├── dcae-policy-handler ├── dcae-redis └── dcae-servicechange-handler 8 directories 각각의 subchart는 각자의 values.
multipass? Multipass is a lightweight VM manager for Linux, Windows and macOS. It’s designed for developers who want a fresh Ubuntu environment with a single command. It uses KVM on Linux, Hyper-V on Windows and HyperKit on macOS to run the VM with minimal overhead. It can also use VirtualBox on Windows and macOS. Multipass will fetch images for you and keep them up to date.
Since it supports metadata for cloud-init, you can simulate a small cloud deployment on your laptop or workstation.
Replace microk8s with kubernetes in mini1
remove micro.k8s with snap command cychong@mini1:~$ sudo snap remove microk8s Save data of snap "microk8s" in automatic snapshot set microk8s removed cychong@mini1:~$ setup kubernetes Reference : https://phoenixnap.com/kb/install-kubernetes-on-ubuntu
cychong@mini1:~$ sudo kubeadm init --pod-network-cidr=10.244.0.0/16 [init] Using Kubernetes version: v1.15.3 cychong@mini1:~$ kubectl get pods --all-namespaces -o wide NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES kube-system coredns-5c98db65d4-r468f 0/1 Pending 0 2m3s <none> <none> <none> <none> kube-system coredns-5c98db65d4-wcm2n 0/1 Pending 0 2m3s <none> <none> <none> <none> kube-system etcd-mini1 1/1 Running 0 79s 192.