I'm using k3d for local development. I have 3 agent nodes, each with their own specific locally mounted folders for specialized tasks.
I'm deploying gitea to agent-0 as a local repo mirror, which has mounted local-storage at /git, and it works great. But, when I first start the cluster, there is a delay and I'm not sure what's causing it or why, so I'm looking for some guidance.
Warning FailedScheduling 68s default-scheduler 0/4 nodes are available: pod has unbound immediate PersistentVolum
eClaims. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling.
Warning FailedScheduling 60s (x2 over 62s) default-scheduler 0/4 nodes are available: pod has unbound immediate PersistentVolum
eClaims. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling.
Normal Scheduled 47s default-scheduler Successfully assigned git/git-856c84589-c54ql to k3d-robot.ent-age
nt-0
I'm not doing anything weird here. I have a volume mounted by the k3d agent 'node' at a specific directory on my host. I have told gitea what the folder is, and it's doing its thing. I have a pv and PVC bound to this folder, and I think it's all working ok - gitea has persistent storage that I can locate on the filesystem of my local drive, which is exactly what I want right now. But, there is this painful delay at the start, sometimes for up to a minute, while 'something' gets its act together. Or, I've done something weird.
Here's my gitea deployment:
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: git-pv
spec:
storageClassName: local-storage
persistentVolumeReclaimPolicy: Retain
capacity:
storage: 1Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
local:
path: /git
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: ent.robot.ops
operator: Exists
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: git-pvc
namespace: git
spec:
volumeName: git-pv
storageClassName: local-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
apiVersion: apps/v1
kind: Deployment
metadata:
name: git
namespace: git
labels:
app: git
spec:
replicas: 1
selector:
matchLabels:
app: git
template:
metadata:
labels:
app: git
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: ent.robot.ops
operator: Exists
containers:
- name: git
image: gitea/gitea:1.23.1
resources:
limits:
cpu: "500m"
memory: "512Mi"
env:
- name: GITEA_CUSTOM
value: /data/
- name: GITEA_WORK_DIR
value: /data/
# Override the default app.ini
- name: GITEA__APP_NAME
value: "Robot.ent: Welcome, my son"
- name: GITEA__RUN_USER
value: git
- name: GITEA__RUN_MODE
value: dev
- name: GITEA__WORK_PATH
value: /data/git
- name: GITEA__actions__ENABLED
value: "false"
- name: GITEA__packages__ENABLED
value: "false"
- name: GITEA__repository__ROOT
value: /data/git/repositories
- name: GITEA__repository_0X2E_local__LOCAL_COPY_PATH
value: /tmp/gitea/local-repo
- name: GITEA__repository_0X2E_upload__TEMP_PATH
value: /tmp/gitea/uploads
- name: GITEA__server__APP_DATA_PATH
value: /data/git/data/
- name: GITEA__server__SSH_DOMAIN
value: git.git
- name: GITEA__server__PROTOCOL
value: "http"
- name: GITEA__server__HTTP_PORT
value: "80"
- name: GITEA__server__SSH_PORT
value: "22"
- name: GITEA__server__ROOT_URL
value: http://git.git/
- name: GITEA__server__DISABLE_SSH
value: "false"
- name: GITEA__server__START_SSH_SERVER
value: "false"
- name: GITEA__server__LFS_START_SERVER
value: "false"
- name: GITEA__server__DOMAIN
value: "git.git"
- name: GITEA__server__OFFLINE_MODE
value: "true"
- name: GITEA__service__DISABLE_REGISTRATION
value: "false"
- name: GITEA__service__REQUIRE_SIGNIN_VIEW
value: "false"
- name: GITEA__service__REGISTER_EMAIL_CONFIRM
value: "false"
- name: GITEA__service__ENABLE_NOTIFY_MAIL
value: "false"
- name: GITEA__service__ALLOW_ONLY_EXTERNAL_REGISTRATION
value: "false"
- name: GITEA__service__ENABLE_CAPTCHA
value: "false"
- name: GITEA__service__DEFAULT_KEEP_EMAIL_PRIVATE
value: "false"
- name: GITEA__service__DEFAULT_ALLOW_CREATE_ORGANIZATION
value: "false"
- name: GITEA__service__DEFAULT_ENABLE_TIMETRACKING
value: "false"
- name: GITEA__service__NO_REPLY_ADDRESS
value: "noreply.localhost"
- name: GITEA__security__INSTALL_LOCK
value: "true"
- name: GITEA__mailer__ENABLED
value: "false"
- name: GITEA__openid__ENABLE_OPENID_SIGNIN
value: "false"
- name: GITEA__openid__ENABLE_OPENID_SIGNUP
value: "false"
- name: GITEA__oauth2__ENABLED
value: "false"
- name: GITEA__repository_0X2E_pull_0X2D_request__DEFAULT_MERGE_STYLE
value: rebase
- name: GITEA__cors__ENABLED
value: "false"
- name: GITEA__cors__ALLOW_DOMAIN
value: "git.robot.ent"
- name: GITEA__other__ENABLE_FEED
value: "false"
- name: GITEA__other__ENABLE_SITEMAP
value: "false"
- name: GITEA__other__SHOW_FOOTER_POWERED_BY
value: "false"
- name: GITEA__other__SHOW_FOOTER_TEMPLATE_LOAD_TIME
value: "false"
volumeMounts:
- name: git
mountPath: /data
volumes:
- name: git
persistentVolumeClaim:
claimName: git-pvc
apiVersion: v1
kind: Service
metadata:
name: git
namespace: git
spec:
type: ClusterIP
selector:
app: git
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
- name: ssh
protocol: TCP
port: 22
targetPort: 22