added jira yamls

This commit is contained in:
leo 2021-07-02 16:02:38 +02:00
parent 9f9ff31739
commit 1c55bed971
7 changed files with 113 additions and 0 deletions

View file

@ -8,3 +8,21 @@
(s/def ::fqdn cm/fqdn-string?)
(s/def ::issuer cm/letsencrypt-issuer?)
(defn generate-certificate [config]
(let [{:keys [fqdn issuer]
:or {issuer :staging}} config
letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")]
(->
(yaml/from-string (yaml/load-resource "jira/certificate.yaml"))
(assoc-in [:spec :commonName] fqdn)
(assoc-in [:spec :dnsNames] [fqdn])
(assoc-in [:spec :issuerRef :name] letsencrypt-issuer))))
(defn generate-ingress [config]
(let [{:keys [fqdn issuer]
:or {issuer :staging}} config
letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")]
(->
(yaml/from-string (yaml/load-resource "jira/ingress.yaml"))
(assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer)
(cm/replace-all-matching-values-by-new-value "fqdn" fqdn))))

View file

@ -0,0 +1,13 @@
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: jira-cert
namespace: default
spec:
secretName: jira-secret
commonName: fqdn
dnsNames:
- fqdn
issuerRef:
name: letsencrypt-staging-issuer
kind: ClusterIssuer

View file

@ -0,0 +1,26 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-jira
annotations:
cert-manager.io/cluster-issuer: letsencrypt-staging-issuer
nginx.ingress.kubernetes.io/proxy-body-size: "256m"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/proxy-connect-timeout: "300"
nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
namespace: default
spec:
tls:
- hosts:
- fqdn
secretName: jira-secret
rules:
- host: fqdn
http:
paths:
- path: /
backend:
serviceName: jira-service
servicePort: 8080

View file

@ -0,0 +1,14 @@
kind: PersistentVolume
apiVersion: v1
metadata:
name: jira-pv-volume
labels:
type: local
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
capacity:
storage: 30Gi
hostPath:
path: "/var/jira"

View file

@ -0,0 +1,20 @@
kind: Pod
apiVersion: v1
metadata:
name: jira-app
labels:
app: jira
spec:
containers:
- name: jira-app
image: domaindrivenarchitecture/meissa-jira-crate
imagePullPolicy: IfNotPresent
command: ["/app/entrypoint.sh"]
args: ["{{fqdn}}", "{{db-user-name}}", "{{db-user-password}}"]
volumeMounts:
- mountPath: /var/jira
name: jira-data-volume
volumes:
- name: jira-data-volume
persistentVolumeClaim:
claimName: jira-pvc

View file

@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jira-pvc
labels:
app: jira
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 30Gi

View file

@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: jira-service
spec:
selector:
app: jira
ports:
- port: 8080