initialize py-kms

This commit is contained in:
2025-08-31 00:13:52 +02:00
commit 8dad64654c
9 changed files with 252 additions and 0 deletions

94
README.md Normal file
View File

@@ -0,0 +1,94 @@
# py-kms
## Basic stuff
### Install
```shell
helm install py-kms ./helm --namespace py-kms --create-namespace
```
### Update
```shell
helm -n py-kms upgrade py-kms ./helm/
```
### Check
```shell
kubectl -n py-kms get cm,pvc,pod,svc
```
### Tail Log
```shell
kubectl -n py-kms logs -f pykms-0
```
### Delete
```shell
kubectl delete ns py-kms
```
## Immigration
We need to find the location for the files
### Step 1
```shell
kubectl -n py-kms get pvc data-py-kms-0 -o wide
```
Output:
```
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE VOLUMEMODE
data-py-kms-0 Bound pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040 1Gi RWO microk8s-hostpath <unset> 1m Filesystem
```
we need the volume name in this case `pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040`
### Step 2
```shell
kubectl get pv pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040 -o yaml
```
Output:
```
apiVersion: v1
kind: PersistentVolume
metadata:
...
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
claimRef:
...
hostPath:
path: /var/snap/microk8s/common/default-storage/py-kms-data-py-kms-0-pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040
type: DirectoryOrCreate
nodeAffinity:
...
persistentVolumeReclaimPolicy: Delete
storageClassName: microk8s-hostpath
volumeMode: Filesystem
status:
...
```
We need `spec -> hostPath -> path` in this case `/var/snap/microk8s/common/default-storage/py-kms-data-py-kms-0-pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040`
### Step 2
Login to the old server. and use rsync, don't forget stuff like puid, pgid, file access and stuff.
```shell
rsync -avz -e ssh ./ username@0.0.0.0:/var/snap/microk8s/common/default-storage/py-kms-data-py-kms-0-pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040
```