Fixed concat-vec error

This commit is contained in:
Clemens Geibel 2022-07-29 09:54:54 +02:00
parent 20e809fdbe
commit 5af737505b
4 changed files with 34 additions and 18 deletions

View file

@ -7,11 +7,7 @@
(defn k8s-objects [config] (defn k8s-objects [config]
(let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)] (let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)]
(cm/concat-vec (cm/concat-vec
(yaml/load-resource "gitea/deployment.yaml")
(yaml/load-resource "gitea/services.yaml")
(yaml/load-resource "gitea/traefik-middleware.yaml")
(map yaml/to-string (map yaml/to-string
[(postgres/generate-config {:postgres-size :2gb :db-name "gitea"}) [(postgres/generate-config {:postgres-size :2gb :db-name "gitea"})
(postgres/generate-secret config) (postgres/generate-secret config)
@ -22,6 +18,10 @@
(postgres/generate-deployment {:postgres-image "postgres:14" (postgres/generate-deployment {:postgres-image "postgres:14"
:postgres-size :2gb}) :postgres-size :2gb})
(postgres/generate-service) (postgres/generate-service)
(gitea/generate-deployment)
(gitea/generate-service)
(gitea/generate-service-ssh)
(gitea/generate-traefik-middleware)
(gitea/generate-root-volume config) (gitea/generate-root-volume config)
(gitea/generate-data-volume config) (gitea/generate-data-volume config)
(gitea/generate-appini-env config) (gitea/generate-appini-env config)

View file

@ -137,4 +137,20 @@
data-storage-size (data-storage-by-volume-size volume-total-storage-size root-storage-size)] data-storage-size (data-storage-by-volume-size volume-total-storage-size root-storage-size)]
(-> (->
(yaml/load-as-edn "gitea/datavolume.yaml") (yaml/load-as-edn "gitea/datavolume.yaml")
(cm/replace-all-matching-values-by-new-value "DATASTORAGESIZE" (str (str data-storage-size) "Gi"))))) (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"))

View file

@ -1,17 +1,5 @@
kind: Service kind: Service
apiVersion: v1 apiVersion: v1
metadata:
name: gitea-service
namespace: default
spec:
selector:
app: gitea
ports:
- name: gitea-http
port: 3000
---
kind: Service
apiVersion: v1
metadata: metadata:
name: gitea-ssh-service name: gitea-ssh-service
namespace: default namespace: default

View file

@ -0,0 +1,12 @@
kind: Service
apiVersion: v1
metadata:
name: gitea-service
namespace: default
spec:
selector:
app: gitea
ports:
- name: gitea-http
port: 3000