enfoflifeのページ見たら昨日にkubernetesが1.31になってた。
よー見たら、「N-2 support policy (meaning that the 3 most recent minor versions receive security and bug fixes) 」って書いてある。
最新と2つ前の世代のマイナーバージョンをサポートするようになったんや。
前は1つ前やったよな。
それに、更新サイクルが15週間ってある。
前は3ヶ月ぐらいやったはずなんやけど、15週間に伸びてるやん。
年に4回やのうて、3回に減ったんやな。
一般企業のバージョンアップ担当してる人が「この前計画作業終わったのに、もう次のやらなアカンのか」って声が反映されたんかもしれん。
履歴メモ
自分のk8sクラスタ更新の実施履歴。
minikubeのときもそうやったけど、「バージョンアップ」はクラスタのノード作り替えやから、厳密にはバージョンアップするわけやなくて、永続化領域はいったん全部吹っ飛ぶ。
minikubeの実施履歴はこのへんでやってる。
時期 | macのk8s環境 | クラスタ |
---|---|---|
2024年8月 | microk8s v1.31.0 (containerd v1.6.28) | Kubernetes v1.31/stable |
2024年7月 | microk8s v1.30.3 (containerd v1.6.28) | Kubernetes v1.30/stable |
2024年5月中 | minikube v1.33.1 (Docker 26.0.2) | Kubernetes v1.30.0 |
2024年4月末 | minikube v1.33.0 (Docker 26.0.1) | Kubernetes v1.30.0 |
2023年11月 | minikube v1.32.0 (Docker 24.0.7) | Kubernetes v1.28.3 |
2023年8月 | minikube v1.31.2 (Docker 24.0.4) | Kubernetes v1.28.0-rc.1 |
microk8sで使えるkubernetesクラスタのバージョン確認
microk8sでもときどきクラスタのバージョン上がる。
macから見たら、multipassの中で動くubuntuに向けてコマンド投げる。
今使ってるクラスタは1.30.3/stableやけど、1.31.0/stableが見えるから、クラスタ作り直すスクリプトに必要な指定を確認する。
nari@gvis-mac script % multipass exec microk8s-vm -- sudo snap info microk8s | egrep -v 'beta|edge|candidate' | grep classic | sort -r | head -10
installed: v1.30.3 (7040) 168MB classic
latest/stable: v1.30.3 2024-07-29 (7040) 168MB classic
1.31/stable: v1.31.0 2024-08-14 (7120) 168MB classic ⭐️新しいのあるやん
1.30/stable: v1.30.3 2024-07-29 (7040) 168MB classic
1.29/stable: v1.29.7 2024-07-29 (7018) 170MB classic
1.28/stable: v1.28.12 2024-07-29 (7039) 186MB classic
1.27/stable: v1.27.16 2024-07-29 (7016) 179MB classic
1.26/stable: v1.26.15 2024-04-19 (6673) 173MB classic
1.25/stable: v1.25.16 2024-02-21 (6571) 171MB classic
1.25-eksd/stable: v1.25-18 2023-07-31 (5630) 176MB classic
nari@gvis-mac script %
microk8sで使えるノードのOSバージョン確認
ノードのバージョンもときどき上がるし公開日付が新しくなる。
こないだバージョン上げたから指定変えへんけど、noble numbatは8月9日版ってのが見えるから、これもクラスタ作り直すスクリプトに反映させる。
nari@gvis-mac script % multipass find | grep LTS
20.04 focal 20240809 Ubuntu 20.04 LTS
22.04 jammy 20240808 Ubuntu 22.04 LTS
24.04 noble,lts 20240809 Ubuntu 24.04 LTS
nari@gvis-mac script %
クラスタ作り直すスクリプトを書き換え
nari@gvis-mac script % cat 300_kubeClusterRecreate.sh
## -------------------------------------------------------------------------
## Script Name : 300_kubeClusterRecreate.sh
## Created by : T.Naritomi
## on : 2023.08.26
## Updated by : 2024.08.15
## on :
## Parameters :
## Return Code : 0=Normal End
## Comments : change driver hyperkit -> qemu2 , minikube -> microk8s
## -------------------------------------------------------------------------
## ---define----------------------------------------------------------------
EXEC_HOME=/Users/nari/Documents/personal/script # Execute Home directory
KUBE_HOME=/Users/nari/Documents/personal/microk8s # kubernetes Home directory
LOG_FILE=/Users/nari/Documents/personal/log/300_kube.log # Log file
GVIS_CPU=4 ⭐️そのまま
GVIS_MEM=8 ⭐️10GBにしてたけど、ちょっと減らす
GVIS_DSK=50 ⭐️そのまま
GVIS_VER=1.31/stable ⭐️書き換え
GVIS_IMG=lts ⭐️そのまま
:(中略)
microk8s uninstall
multipass delete microk8s-vm
multipass purge
echo -------- `date +%F_%T` -------- >> ${LOG_FILE}
microk8s install --cpu ${GVIS_CPU} --mem ${GVIS_MEM} --disk ${GVIS_DSK} --channel ${GVIS_VER} --image ${GVIS_IMG} >> ${LOG_FILE}
:(中略)
永続化領域の保全
永続化領域をtar.gz化してxrdpコンテナからmacにコピーしとく。
ubuntu@microk8s-vm:~$ cd /data
ubuntu@microk8s-vm:/data$ ls
gvis-pv-django-sslcerts gvis-pv-mariadbconf save-django.tar
gvis-pv-django-uwsgi-nginx gvis-pv-ubun save-xrdpubu.tar
gvis-pv-mariadb gvis-pv-ubun.tar.gz sv_django-uwsgi-nginx.tar.gz
ubuntu@microk8s-vm:/data$ rm gvis-pv-ubun.tar.gz
ubuntu@microk8s-vm:/data$ tar czf gvis-pv-ubun.tar.gz gvis-pv-ubun/
ubuntu@microk8s-vm:/data$ ls -lh gvis-pv-ubun*
-rw-rw-r-- 1 ubuntu ubuntu 463M Aug 15 09:09 gvis-pv-ubun.tar.gz
gvis-pv-ubun:
total 12K
drwx------ 2 ubuntu ubuntu 4.0K May 14 2021 _old
drwx------ 3 ubuntu ubuntu 4.0K Aug 15 06:15 download
drwx------ 2 ubuntu ubuntu 4.0K Dec 21 2022 script
ubuntu@microk8s-vm:/data$ mv gvis-pv-ubun.tar.gz ./gvis-pv-ubun
ubuntu@microk8s-vm:/data$
tar.gzファイルをmacの保管置き場にコピーしとく。
クラスタ作り直す
クラスタ停止しとく。
nari@gvis-mac script % sh ./301_kubeStop.sh
/Users/nari/Documents/personal/log/300_kube.log
deployment.apps "sv-https-portal" deleted
deployment.apps "sv-django" deleted
deployment.apps "cl-ubun" deleted
deployment.apps "sv-mariadb" deleted
Infer repository core for addon dashboard
Disabling Dashboard
serviceaccount "kubernetes-dashboard" deleted
service "kubernetes-dashboard" deleted
secret "kubernetes-dashboard-certs" deleted
secret "kubernetes-dashboard-csrf" deleted
secret "kubernetes-dashboard-key-holder" deleted
configmap "kubernetes-dashboard-settings" deleted
role.rbac.authorization.k8s.io "kubernetes-dashboard" deleted
clusterrole.rbac.authorization.k8s.io "kubernetes-dashboard" deleted
rolebinding.rbac.authorization.k8s.io "kubernetes-dashboard" deleted
clusterrolebinding.rbac.authorization.k8s.io "kubernetes-dashboard" deleted
deployment.apps "kubernetes-dashboard" deleted
service "dashboard-metrics-scraper" deleted
deployment.apps "dashboard-metrics-scraper" deleted
Dashboard is disabled
nari@gvis-mac script %
クラスタ停止したのを確認してからログも念の為退避しとく。
nari@gvis-mac log % pwd
/Users/nari/Documents/personal/log
nari@gvis-mac log % ls
20230929_300_minikube.log 20240421_300_minikube.log 300_kube.log
20231110_300_minikube.log 20240514_300_minikube.log
nari@gvis-mac log % tail -f 300_kube.log
NAME CAPACITY ACCESS RECLAIM
gvis-pv-django-sslcerts 1Gi RWO Bound
gvis-pv-django-uwsgi-nginx 1Gi RWO Bound
gvis-pv-mariadb 20Gi RWO Bound
gvis-pv-mariadbconf 5Gi RWO Bound
gvis-pv-ubun 10Gi RWO Bound
pvc-85988deb-e6e2-4dd5-a644-7661f25f686f 30Gi RWX Bound
-------kubectl forward -------
-------- 2024-08-15_07:20:25 --------
-------- 2024-08-15_09:21:58 --------
Stopped.
-------- 2024-08-15_09:22:42 --------
^C
nari@gvis-mac log % mv 300_kube.log 20240815_300_minikube.log
nari@gvis-mac log %
作り直しスクリプトを一発流すと作り直しが始まる。
nari@gvis-mac script % sh ./300_kubeClusterRecreate.sh
--- kube Data save ready ? ---(y/N):y
--- kube Recreate cluster ready ? ---(y/N):y
---Recreate start---
/Users/nari/Documents/personal/log/300_kube.log
Thank you for using MicroK8s!
Warning: the "--mem" long option is deprecated in favour of "--memory". Please update any scripts, etc.
qemuのイメージが作り直しされてく。
最初は650MBぐらいに見えるけど、5分ぐらい待つと2.7GB程度のイメージの中にクラスタが入ったubuntuのノードができる。
nari@gvis-mac script % sudo ls -lha /var/root/Library/Application\ Support/multipassd/qemu/vault/instances/microk8s-vm
Password:
total 1373032
drwxr-xr-x 4 root wheel 128B 8 15 09:26 .
drwxr-xr-x 3 root wheel 96B 8 15 09:26 ..
-rw-r--r-- 1 root wheel 52K 8 15 09:26 cloud-init-config.iso
-rw-r--r-- 1 root wheel 652M 8 15 09:27 ubuntu-24.04-server-cloudimg-amd64.img
nari@gvis-mac script %
クラスタ動いてるのが見える。
---Recreate start---
/Users/nari/Documents/personal/log/300_kube.log
Thank you for using MicroK8s!
Warning: the "--mem" long option is deprecated in favour of "--memory". Please update any scripts, etc.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
nmon
0 upgraded, 1 newly installed, 0 to remove and 33 not upgraded.
Need to get 71.4 kB of archives.
After this operation, 184 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 nmon amd64 16p+debian-1 [71.4 kB]
Fetched 71.4 kB in 1s (93.3 kB/s)
Selecting previously unselected package nmon.
(Reading database ... 71864 files and directories currently installed.)
Preparing to unpack .../nmon_16p+debian-1_amd64.deb ...
Unpacking nmon (16p+debian-1) ...
Setting up nmon (16p+debian-1) ...
Processing triggers for man-db (2.12.0-4build2) ...
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
Infer repository core for addon registry
Infer repository core for addon hostpath-storage
Enabling default storage class.
WARNING: Hostpath storage is not suitable for production environments.
A hostpath volume can grow beyond the size limit set in the volume claim manifest.
deployment.apps/hostpath-provisioner created
storageclass.storage.k8s.io/microk8s-hostpath created
serviceaccount/microk8s-hostpath created
clusterrole.rbac.authorization.k8s.io/microk8s-hostpath created
clusterrolebinding.rbac.authorization.k8s.io/microk8s-hostpath created
Storage will be available soon.
The registry will be created with the size of 30Gi.
Default storage class will be used.
namespace/container-registry created
persistentvolumeclaim/registry-claim created
deployment.apps/registry created
service/registry created
configmap/local-registry-hosting configured
persistentvolume/gvis-pv-mariadb created
persistentvolumeclaim/gvis-pv-mariadb-claim created
persistentvolume/gvis-pv-mariadbconf created
persistentvolumeclaim/gvis-pv-mariadbconf-claim created
persistentvolume/gvis-pv-django-sslcerts created
persistentvolumeclaim/gvis-pv-django-sslcerts-claim created
persistentvolume/gvis-pv-django-uwsgi-nginx created
persistentvolumeclaim/gvis-pv-django-uwsgi-nginx-claim created
persistentvolume/gvis-pv-ubun created
persistentvolumeclaim/gvis-pv-ubun-claim created
configmap/sv-mariadb-txt created
service/sv-django created
service/sv-https-portal created
service/sv-mariadb created
nari@gvis-mac script % Checking if Dashboard is running.
Infer repository core for addon dashboard
Infer repository core for addon metrics-server
Waiting for Dashboard to come up.
Dashboard will be available at https://192.168.105.97:10443
Use the following token to login:
:(中略)
Forwarding from 0.0.0.0:10443 -> 8443
あとは前にやった方法でPod起動用のイメージと永続化領域を流し込んで、起動確認してく。
microk8sの中のmultipassで動くubuntu
OSはubuntuね。
ubuntu@microk8s-vm:~$ cat /etc/os-release | grep PRETTY
PRETTY_NAME="Ubuntu 24.04 LTS"
ubuntu@microk8s-vm:~$
dockerやなくてcontainerdが動いてる。
ubuntu@microk8s-vm:~$ pstree
systemd─┬─ModemManager───3*[{ModemManager}]
├─2*[agetty]
├─bash───cluster-agent───5*[{cluster-agent}]
├─bash
├─containerd───16*[{containerd}]
├─containerd-shim─┬─pause
│ ├─runsvdir─┬─2*[runsv───calico-node───7*[{calico-node}]]
│ │ ├─runsv───calico-node───6*[{calico-node}]
│ │ ├─runsv───calico-node───12*[{calico-node}]
│ │ └─runsv───calico-node───8*[{calico-node}]
│ └─12*[{containerd-shim}]
├─containerd-shim─┬─dashboard───6*[{dashboard}]
│ ├─pause
│ └─11*[{containerd-shim}]
├─containerd-shim─┬─metrics-sidecar───6*[{metrics-sidecar}]
│ ├─pause
│ └─11*[{containerd-shim}]
├─containerd-shim─┬─hostpath-provis───6*[{hostpath-provis}]
│ ├─pause
│ └─11*[{containerd-shim}]
├─containerd-shim─┬─coredns───8*[{coredns}]
│ ├─pause
│ └─12*[{containerd-shim}]
├─containerd-shim─┬─metrics-server───9*[{metrics-server}]
│ ├─pause
│ └─11*[{containerd-shim}]
├─containerd-shim─┬─kube-controller───6*[{kube-controller}]
│ ├─pause
│ └─12*[{containerd-shim}]
├─containerd-shim─┬─pause
│ ├─registry───6*[{registry}]
│ └─12*[{containerd-shim}]
├─cron
├─dbus-daemon
├─k8s-dqlite───15*[{k8s-dqlite}]
├─kubelite───12*[{kubelite}]
├─multipathd───6*[{multipathd}]
├─polkitd───3*[{polkitd}]
├─rsyslogd───3*[{rsyslogd}]
├─snapd───11*[{snapd}]
├─sshd─┬─sshd───sshd
│ ├─sshd───sshd───sudo───bash───kubectl───8*[{kubectl}]
│ ├─sshd───sshd───sftp-server
│ └─sshd───sshd───bash───pstree
├─systemd───(sd-pam)
├─systemd-journal
├─systemd-logind
├─systemd-network
├─systemd-resolve
├─systemd-timesyn───{systemd-timesyn}
├─systemd-udevd
├─udisksd───5*[{udisksd}]
└─unattended-upgr───{unattended-upgr}
ubuntu@microk8s-vm:~$
kubernetesのダッシュボード見たらこんな感じ。
teratermのマクロがやってくれるけど、永続化領域を流し込んで、イメージも入れとく。
ubuntu@microk8s-vm:~$ cd /data
ubuntu@microk8s-vm:/data$ tar xzf gvis-pv-ubun.tar.gz
ubuntu@microk8s-vm:/data$ sudo microk8s.ctr images rm docker.io/library/save-django:gvis-saved
WARN[0000] docker.io/library/save-django:gvis-saved: image not found
ubuntu@microk8s-vm:/data$ sudo microk8s.ctr images rm docker.io/library/save-xrdpubu:gvis-saved
WARN[0000] docker.io/library/save-xrdpubu:gvis-saved: image not found
ubuntu@microk8s-vm:/data$ sudo microk8s.ctr images import save-django.tar
unpacking docker.io/library/save-django:gvis-saved (sha256:7f634de1f8efe5cad20c2ec872123d6270ce8843cb8747c6cca0ab641c8354f6)...done
ubuntu@microk8s-vm:/data$ sudo microk8s.ctr images import save-xrdpubu.tar
unpacking docker.io/library/save-xrdpubu:gvis-saved (sha256:c6f2d7ef7822bc269a0e653df03cd97d5c6e817a4852b5d2afd85862b2ddb812)...done
ubuntu@microk8s-vm:/data$ sudo microk8s.ctr images ls | grep save
docker.io/library/save-django:gvis-saved application/vnd.oci.image.manifest.v1+json sha256:7f634de1f8efe5cad20c2ec872123d6270ce8843cb8747c6cca0ab641c8354f6 1.1 GiB linux/amd64 io.cri-containerd.image=managed
docker.io/library/save-xrdpubu:gvis-saved application/vnd.oci.image.manifest.v1+json sha256:c6f2d7ef7822bc269a0e653df03cd97d5c6e817a4852b5d2afd85862b2ddb812 4.6 GiB linux/amd64 io.cri-containerd.image=managed
ubuntu@microk8s-vm:/data$
mariadbのデータも流し込む。
ubuntu@microk8s-vm:~$ sudo su -
root@microk8s-vm:~# cd /data
root@microk8s-vm:/data# rm -fR ./gvis-pv-mariadb ; rm -fR ./gvis-pv-mariadbconf ; sync ; sync
root@microk8s-vm:/data# mkdir gvis-pv-mariadbconf ; mkdir gvis-pv-mariadbconf/nari ; mkdir gvis-pv-mariadbconf/nari/fullback ; mkdir gvis-pv-mariadb
root@microk8s-vm:/data# chmod -R 777 gvis-pv-mariadb*
root@microk8s-vm:/data# exit
logout
ubuntu@microk8s-vm:~$ exit
logout
nari@gvis-mac microk8s % multipass transfer /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_mariadb11conf/gvis.cnf microk8s-vm:/data/gvis-pv-mariadbconf/
nari@gvis-mac microk8s % multipass transfer /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_mariadb11conf/nari/fullback/2_fullRecover.sh microk8s-vm:/data/gvis-pv-mariadbconf/nari/fullback/
nari@gvis-mac microk8s % multipass transfer /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_mariadb11conf/nari/fullback/4_nariDB_DjangoRecover.sh microk8s-vm:/data/gvis-pv-mariadbconf/nari/fullback/
nari@gvis-mac microk8s % multipass transfer /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_mariadb11conf/nari/FullBackup_nariDB_1st.sql microk8s-vm:/data/gvis-pv-mariadbconf/nari/
nari@gvis-mac microk8s % multipass transfer /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_mariadb11conf/nari/FullBackup_nariDB_Django.sql microk8s-vm:/data/gvis-pv-mariadbconf/nari/
nari@gvis-mac microk8s % kubectl create -f gvis-PersistentVol-mariadbconf.yaml
persistentvolume/gvis-pv-mariadbconf created
persistentvolumeclaim/gvis-pv-mariadbconf-claim created
nari@gvis-mac microk8s % kubectl create -f gvis-PersistentVol-mariadb.yaml
persistentvolume/gvis-pv-mariadb created
persistentvolumeclaim/gvis-pv-mariadb-claim created
nari@gvis-mac microk8s % kubectl create -f sv-mariadb-deployment.yaml
deployment.apps/sv-mariadb created
nari@gvis-mac microk8s % sync ; sync ; sleep 30
nari@gvis-mac microk8s % kubectl exec -it `kubectl get pod | grep mariadb | awk '{print $1}'` -- bash
root@svmariadb:/# sync ; sleep 30 ; sync
root@svmariadb:/# /bin/sh /etc/mysql/conf.d/nari/fullback/2_fullRecover.sh
sync ; sleep 20 ; sync
root@svmariadb:/# sync ; sleep 20 ; sync
/bin/sh /etc/mysql/conf.d/nari/fullback/4_nariDB_DjangoRecover.sh
root@svmariadb:/# /bin/sh /etc/mysql/conf.d/nari/fullback/4_nariDB_DjangoRecover.sh
mariadb -unari -pXXXXXXXXX
root@svmariadb:/# mariadb -unari -pXXXXXXXXX
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 11.4.3-MariaDB-ubu2404-log mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show variables like 'max_allowed_packet' ;
select count(*) from GVIS_keihi ;
exit
+--------------------+------------+
| Variable_name | Value |
+--------------------+------------+
| max_allowed_packet | 1073741824 |
+--------------------+------------+
1 row in set (0.018 sec)
MariaDB [(none)]> show databases ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| nariDB_1st |
| nariDB_Django |
+--------------------+
3 rows in set (0.002 sec)
MariaDB [(none)]> use nariDB_1st ;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [nariDB_1st]> select count(*) from GVIS_keihi ;
+----------+
| count(*) |
+----------+
| 11372 |
+----------+
1 row in set (0.010 sec)
MariaDB [nariDB_1st]> exit
Bye
root@svmariadb:/# exit
exit
nari@gvis-mac microk8s % sc
nari@gvis-mac script % sh ./411_ReCreateDBpod.sh
NAME READY STATUS RESTARTS AGE
sv-mariadb-5fcf877554-srtf7 1/1 Running 0 4m40s
deployment.apps "sv-mariadb" deleted
deployment.apps/sv-mariadb created
NAME READY STATUS RESTARTS AGE
sv-mariadb-5fcf877554-45m5n 1/1 Running 0 10s
nari@gvis-mac script % rm -f /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_mariadb11conf/nari/FullBackup_nariDB_1st.sql
nari@gvis-mac script % rm -f /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_mariadb11conf/nari/FullBackup_nariDB_Django.sql
nari@gvis-mac script % Forwarding from 0.0.0.0:13306 -> 3306
nari@gvis-mac script %
djangoの永続化領域も流し込む。pip3で更新対象見えるけど、また来月の定期更新でなんとかしとこ。
nari@gvis-mac ~ % cd /Users/nari/Documents/personal/microk8s/nariDockerDat
nari@gvis-mac nariDockerDat % rm -fR ./sv_django-uwsgi-nginx
tar xzf sv_django-uwsgi-nginx.tar.gz
nari@gvis-mac nariDockerDat % tar xzf sv_django-uwsgi-nginx.tar.gz
m8
nari@gvis-mac nariDockerDat % m8
nari@gvis-mac microk8s % kubectl delete -f sv-django-deployment.yaml
kubectl delete -f gvis-PersistentVol-sv_django-uwsgi-nginx.yaml
Error from server (NotFound): error when deleting "sv-django-deployment.yaml": deployments.apps "sv-django" not found
nari@gvis-mac microk8s % kubectl delete -f gvis-PersistentVol-sv_django-uwsgi-nginx.yaml
multipass transfer /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_django-uwsgi-nginx.tar.gz microk8s-vm:/data ; sync
persistentvolume "gvis-pv-django-uwsgi-nginx" deleted
persistentvolumeclaim "gvis-pv-django-uwsgi-nginx-claim" deleted
nari@gvis-mac microk8s % multipass transfer /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_django-uwsgi-nginx.tar.gz microk8s-vm:/data ; sync
multipass shell microk8s-vm
nari@gvis-mac microk8s % multipass shell microk8s-vm
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-39-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Thu Aug 15 10:08:10 JST 2024
System load: 0.55
Usage of /: 60.7% of 47.39GB
Memory usage: 32%
Swap usage: 0%
Processes: 301
Users logged in: 1
IPv4 address for ens3: 192.168.105.97
IPv6 address for ens3: fd5a:9174:7161:d2cb:5054:ff:fede:c189
Expanded Security Maintenance for Applications is not enabled.
39 updates can be applied immediately.
30 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable
Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status
Last login: Thu Aug 15 10:02:27 2024 from 192.168.105.1
ubuntu@microk8s-vm:~$ sudo su -
root@microk8s-vm:~# cd /data
root@microk8s-vm:/data# rm -fR ./gvis-pv-django-uwsgi-nginx ; sync ; sync
root@microk8s-vm:/data# tar xzf sv_django-uwsgi-nginx.tar.gz
root@microk8s-vm:/data# mv ./sv_django-uwsgi-nginx/app ./gvis-pv-django-uwsgi-nginx
root@microk8s-vm:/data# /bin/sh /data/sv_django-uwsgi-nginx/kubeCopy.sh
root@microk8s-vm:/data# rm -fR ./sv_django-uwsgi-nginx
root@microk8s-vm:/data# exit
logout
ubuntu@microk8s-vm:~$ exit
logout
nari@gvis-mac microk8s % m8
nari@gvis-mac microk8s % kubectl create -f gvis-PersistentVol-sv_django-uwsgi-nginx.yaml
persistentvolume/gvis-pv-django-uwsgi-nginx created
persistentvolumeclaim/gvis-pv-django-uwsgi-nginx-claim created
nari@gvis-mac microk8s % kubectl create -f sv-django-deployment.yaml
deployment.apps/sv-django created
nari@gvis-mac microk8s % sleep 10
nari@gvis-mac microk8s % kubectl exec -it `kubectl get pod | grep sv-django | awk '{print $1}'` -- bash
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
root@sv-django:/# pip3 list -o
Package Version Latest Type
---------- ----------- ------ -----
matplotlib 3.9.1.post1 3.9.2 wheel
setuptools 72.1.0 72.2.0 wheel
zipp 3.19.2 3.20.0 wheel
root@sv-django:/# exit
exit
nari@gvis-mac microk8s % rm -f /Users/nari/Documents/personal/microk8s/nariDockerDat/sv_django-uwsgi-nginx.tar.gz
nari@gvis-mac microk8s % sc
nari@gvis-mac script % sh ./415_ReCreateHTTPSpod.sh
NAME READY STATUS RESTARTS AGE
sv-django-5cffdb6958-ggv2r 1/1 Running 0 16s
sv-mariadb-5fcf877554-45m5n 1/1 Running 0 4m43s
Error from server (NotFound): error when deleting "/Users/nari/Documents/personal/microk8s/sv-https-portal-deployment.yaml": deployments.apps "sv-https-portal" not found
deployment.apps/sv-https-portal created
NAME READY STATUS RESTARTS AGE
sv-django-5cffdb6958-ggv2r 1/1 Running 0 47s
sv-https-portal-5c7d6b6fd9-npcdj 1/1 Running 0 30s
sv-mariadb-5fcf877554-45m5n 1/1 Running 0 5m14s
nari@gvis-mac script %
nari@gvis-mac script % Forwarding from 0.0.0.0:30443 -> 443
nari@gvis-mac script %
軽く動作確認
dockerイメージの流し込みと反映した後、軽く動作確認。
Pod再起動して状態確認してみる。
動いてそうやから、xrdpのPodから見てみる。
djangoのmatplotlibで円グラフ書けてるし、データベース読めて扱えてるし、うまいこと行ってるっぽい。
speedtestはやっぱりdockerのコンテナで動かす分に比べたら、半分しか速度出えへん。しゃぁないか。
もうすぐsonomaも終わりやなぁ。
次はsequoiaってのが出るらしいし、macminiがm4で出てくれる頃に引越しやなぁ。
m4がプロセッサで出てくれて、メモリが16GB以上入ったのが10万円以下で出てくれたらええんやけどなぁ。
microk8sのまま使うか、UTMにするか、無償になったvmware fusionにするか考えとかなアカンな。