pin gitea to pi
This commit is contained in:
parent
2597abd084
commit
cb70bf91b5
23
scripts/longhorn_volume_usage.fish
Normal file
23
scripts/longhorn_volume_usage.fish
Normal file
@ -0,0 +1,23 @@
|
||||
function pvc-usage --description "Show Longhorn PVC usage (human-readable) mapped to namespace/name"
|
||||
begin
|
||||
kubectl -n longhorn-system get volumes.longhorn.io -o json \
|
||||
| jq -r '.items[] | "\(.metadata.name)\t\(.status.actualSize)\t\(.spec.size)"' \
|
||||
| sed 's/^/V\t/'
|
||||
|
||||
kubectl get pvc -A -o json \
|
||||
| jq -r '.items[] | "\(.spec.volumeName)\t\(.metadata.namespace)/\(.metadata.name)"' \
|
||||
| sed 's/^/P\t/'
|
||||
end \
|
||||
| awk 'BEGIN{FS="\t"}
|
||||
$1=="V"{vol=$2; vu[vol]=$3; vs[vol]=$4}
|
||||
$1=="P"{vol=$2; name=$3; map[vol]=name}
|
||||
END{
|
||||
for (v in vu){
|
||||
used=vu[v]+0; size=vs[v]+0; pct=(size>0?used/size*100:0);
|
||||
cmd="numfmt --to=iec --suffix=B " used; cmd|getline hu; close(cmd);
|
||||
cmd="numfmt --to=iec --suffix=B " size; cmd|getline hs; close(cmd);
|
||||
n=(v in map?map[v]:v);
|
||||
printf "%-40s %-10s / %-10s (%5.1f%%)\n", n, hu, hs, pct
|
||||
}
|
||||
}' | sort
|
||||
end
|
||||
@ -1,3 +1,4 @@
|
||||
# services/gitea/deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@ -22,6 +23,21 @@ spec:
|
||||
spec:
|
||||
nodeSelector:
|
||||
node-role.kubernetes.io/worker: "true"
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: hardware
|
||||
operator: In
|
||||
values: ["rpi4","rpi5"]
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 50
|
||||
preference:
|
||||
matchExpressions:
|
||||
- key: hardware
|
||||
operator: In
|
||||
values: ["rpi5"]
|
||||
containers:
|
||||
- name: gitea
|
||||
image: gitea/gitea:1.23
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
# services/gitea/ingress.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# services/gitea/kustomization.yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
# namespace: gitea
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- deployment.yaml
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
# services/gitea/namespace.yaml
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
# services/gitea/pvc.yaml
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
# services/gitea/service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user