Swap to using s3 w/ pvc and juicefs
This commit is contained in:
@@ -1,25 +1,54 @@
|
|||||||
(ns k8s.services.gitea.service)
|
(ns k8s.services.gitea.service)
|
||||||
|
|
||||||
(def config
|
(def config
|
||||||
{:stack [:vault:prepare :k8s:deployment :k8s:service :k8s:httproute]
|
{:stack [:vault:prepare :k8s:pvc :k8s:deployment :k8s:service :k8s:httproute]
|
||||||
:image-port 3000
|
:image-port 3000
|
||||||
:app-namespace "generic"
|
:app-namespace "generic"
|
||||||
:app-name "gitea"
|
:app-name "gitea"
|
||||||
:k8s:deployment-opts {:spec {:template {:spec {:initContainers [
|
|
||||||
{:name "init-permissions"
|
:k8s:pvc-opts
|
||||||
:image "busybox:latest"
|
{"gitea-data" {:storageClass "juicefs-sc" :accessModes ["ReadWriteMany"] :storage "1Ti"}
|
||||||
:command ["sh" "-c" "chown -R 1000:1000 /var/lib/gitea && chown -R 1000:1000 /etc/gitea"]
|
"gitea-config" {:storageClass "juicefs-sc" :accessModes ["ReadWriteMany"] :storage "1Gi"}}
|
||||||
:volumeMounts [{:name "gitea-data" :mountPath "/var/lib/gitea"}
|
|
||||||
{:name "gitea-config" :mountPath "/etc/gitea"}]
|
:k8s:deployment-opts
|
||||||
:securityContext {:runAsUser 0 :runAsGroup 0}}
|
{:spec
|
||||||
]
|
{:template
|
||||||
:containers [{:name 'app-name :image '(str repo "/" app-name ":latest-rootless")
|
{:spec
|
||||||
:volumeMounts [{:name "gitea-data" :mountPath "/var/lib/gitea"}
|
{:initContainers
|
||||||
{:name "gitea-config" :mountPath "/etc/gitea"}
|
[{:name "init-permissions"
|
||||||
{:name "timezone" :mountPath "/etc/timezone" :readOnly true}
|
:image "busybox:latest"
|
||||||
{:name "localtime" :mountPath "/etc/localtime" :readOnly true}]}]
|
:command ["sh" "-c" "chown -R 1000:1000 /var/lib/gitea && chown -R 1000:1000 /etc/gitea"]
|
||||||
:volumes [{:name "gitea-data" :hostPath {:path "/opt/gitea/data" :type "DirectoryOrCreate"}}
|
:volumeMounts [{:name "gitea-data" :mountPath "/var/lib/gitea"}
|
||||||
{:name "gitea-config" :hostPath {:path "/opt/gitea/config" :type "DirectoryOrCreate"}}
|
{:name "gitea-config" :mountPath "/etc/gitea"}]
|
||||||
{:name "timezone" :hostPath {:path "/etc/timezone" :type "File"}}
|
:securityContext {:runAsUser 0 :runAsGroup 0}}]
|
||||||
{:name "localtime" :hostPath {:path "/etc/localtime" :type "File"}}]}}}}
|
|
||||||
:k8s:httproute-opts {:spec {::hostnames ['host]}}})
|
:containers
|
||||||
|
[{:name 'app-name
|
||||||
|
:image '(str repo "/" app-name ":latest-rootless")
|
||||||
|
|
||||||
|
:env [{:name "TZ" :value "America/Chicago"}]
|
||||||
|
:envFrom [{:secretRef {:name "gitea-secrets"}}]
|
||||||
|
:ports [{:name "http" :containerPort 3000}
|
||||||
|
{:name "ssh" :containerPort 2222}]
|
||||||
|
|
||||||
|
:volumeMounts [{:name "gitea-data" :mountPath "/var/lib/gitea"}
|
||||||
|
{:name "gitea-config" :mountPath "/etc/gitea"}]}]
|
||||||
|
|
||||||
|
:volumes
|
||||||
|
[{:name "gitea-data" :persistentVolumeClaim {:claimName "gitea-data"}}
|
||||||
|
{:name "gitea-config" :persistentVolumeClaim {:claimName "gitea-config"}}]}}}}
|
||||||
|
|
||||||
|
:k8s:service-opts
|
||||||
|
{:spec
|
||||||
|
{:type "NodePort"
|
||||||
|
:selector {:app "gitea"}
|
||||||
|
:ports [
|
||||||
|
{:name 'app-name :port 3000 :targetPort 3000}
|
||||||
|
|
||||||
|
{:name "ssh"
|
||||||
|
:port 22
|
||||||
|
:targetPort 2222
|
||||||
|
:nodePort 30022
|
||||||
|
}]}}
|
||||||
|
|
||||||
|
:k8s:httproute-opts {:spec {::hostnames ['host]}}})
|
||||||
Reference in New Issue
Block a user