diff --git a/src/main/cljc/dda/c4k_gitea/core.cljc b/src/main/cljc/dda/c4k_gitea/core.cljc index cddc554..96427c4 100644 --- a/src/main/cljc/dda/c4k_gitea/core.cljc +++ b/src/main/cljc/dda/c4k_gitea/core.cljc @@ -7,11 +7,7 @@ (defn k8s-objects [config] (let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)] - (cm/concat-vec - (yaml/load-resource "gitea/deployment.yaml") - (yaml/load-resource "gitea/services.yaml") - (yaml/load-resource "gitea/traefik-middleware.yaml") - + (cm/concat-vec (map yaml/to-string [(postgres/generate-config {:postgres-size :2gb :db-name "gitea"}) (postgres/generate-secret config) @@ -22,6 +18,10 @@ (postgres/generate-deployment {:postgres-image "postgres:14" :postgres-size :2gb}) (postgres/generate-service) + (gitea/generate-deployment) + (gitea/generate-service) + (gitea/generate-service-ssh) + (gitea/generate-traefik-middleware) (gitea/generate-root-volume config) (gitea/generate-data-volume config) (gitea/generate-appini-env config) diff --git a/src/main/cljc/dda/c4k_gitea/gitea.cljc b/src/main/cljc/dda/c4k_gitea/gitea.cljc index 6626e85..8384db7 100644 --- a/src/main/cljc/dda/c4k_gitea/gitea.cljc +++ b/src/main/cljc/dda/c4k_gitea/gitea.cljc @@ -137,4 +137,20 @@ data-storage-size (data-storage-by-volume-size volume-total-storage-size root-storage-size)] (-> (yaml/load-as-edn "gitea/datavolume.yaml") - (cm/replace-all-matching-values-by-new-value "DATASTORAGESIZE" (str (str data-storage-size) "Gi"))))) \ No newline at end of file + (cm/replace-all-matching-values-by-new-value "DATASTORAGESIZE" (str (str data-storage-size) "Gi"))))) + +(defn-spec generate-deployment pred/map-or-seq? + [] + (yaml/load-as-edn "gitea/deployment.yaml")) + +(defn-spec generate-service pred/map-or-seq? + [] + (yaml/load-as-edn "gitea/service.yaml")) + +(defn-spec generate-service-ssh pred/map-or-seq? + [] + (yaml/load-as-edn "gitea/service-ssh.yaml")) + +(defn-spec generate-traefik-middleware pred/map-or-seq? + [] + (yaml/load-as-edn "gitea/traefik-middleware.yaml")) \ No newline at end of file diff --git a/src/main/resources/gitea/services.yaml b/src/main/resources/gitea/service-ssh.yaml similarity index 63% rename from src/main/resources/gitea/services.yaml rename to src/main/resources/gitea/service-ssh.yaml index ea6c1e6..940f7be 100644 --- a/src/main/resources/gitea/services.yaml +++ b/src/main/resources/gitea/service-ssh.yaml @@ -1,17 +1,5 @@ kind: Service apiVersion: v1 -metadata: - name: gitea-service - namespace: default -spec: - selector: - app: gitea - ports: - - name: gitea-http - port: 3000 ---- -kind: Service -apiVersion: v1 metadata: name: gitea-ssh-service namespace: default diff --git a/src/main/resources/gitea/service.yaml b/src/main/resources/gitea/service.yaml new file mode 100644 index 0000000..fdac6c3 --- /dev/null +++ b/src/main/resources/gitea/service.yaml @@ -0,0 +1,12 @@ +kind: Service +apiVersion: v1 +metadata: + name: gitea-service + namespace: default +spec: + selector: + app: gitea + ports: + - name: gitea-http + port: 3000 +