added jira yamls
This commit is contained in:
parent
9f9ff31739
commit
1c55bed971
7 changed files with 113 additions and 0 deletions
|
@ -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))))
|
||||
|
|
13
src/main/resources/jira/certificate.yaml
Normal file
13
src/main/resources/jira/certificate.yaml
Normal 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
|
26
src/main/resources/jira/ingress.yaml
Normal file
26
src/main/resources/jira/ingress.yaml
Normal 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
|
14
src/main/resources/jira/persistent-volume.yml
Normal file
14
src/main/resources/jira/persistent-volume.yml
Normal 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"
|
20
src/main/resources/jira/pod.yaml
Normal file
20
src/main/resources/jira/pod.yaml
Normal 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
|
13
src/main/resources/jira/pvc.yaml
Normal file
13
src/main/resources/jira/pvc.yaml
Normal 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
|
9
src/main/resources/jira/service.yaml
Normal file
9
src/main/resources/jira/service.yaml
Normal file
|
@ -0,0 +1,9 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: jira-service
|
||||
spec:
|
||||
selector:
|
||||
app: jira
|
||||
ports:
|
||||
- port: 8080
|
Reference in a new issue