From f08bdc7fab30bfa1874e83ae786c2db110155879 Mon Sep 17 00:00:00 2001 From: xhrach06 <104822196+xhrach06@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:43:29 +0200 Subject: [PATCH 1/4] Update config.yaml --- pubgrade/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubgrade/config.yaml b/pubgrade/config.yaml index c28df4b..f6cb52a 100644 --- a/pubgrade/config.yaml +++ b/pubgrade/config.yaml @@ -8,7 +8,7 @@ server: use_reloader: True db: - host: mongodb.pubgrade + host: pubgrade-mongodb port: 27017 dbs: pubgradeStore: @@ -101,4 +101,4 @@ endpoints: user_access_token: 'c42a6d44e3d0' - name: 'Alvaro' uid: 'alvaro.gonzalez' - user_access_token: 'c42fhg44e3d0' \ No newline at end of file + user_access_token: 'c42fhg44e3d0' From 994446506056febe3ce420abe0f059a759c8af49 Mon Sep 17 00:00:00 2001 From: xhrach06 <104822196+xhrach06@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:44:29 +0200 Subject: [PATCH 2/4] Update config.yaml --- pubgrade/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubgrade/config.yaml b/pubgrade/config.yaml index f6cb52a..45b026e 100644 --- a/pubgrade/config.yaml +++ b/pubgrade/config.yaml @@ -8,7 +8,7 @@ server: use_reloader: True db: - host: pubgrade-mongodb + host: mongodb-pubgrade port: 27017 dbs: pubgradeStore: From 7b48c382a3b937b8367bbe5680d8cb92452e2ac1 Mon Sep 17 00:00:00 2001 From: xhrach06 <104822196+xhrach06@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:03:27 +0200 Subject: [PATCH 3/4] Delete deployment directory --- deployment/Chart.yaml | 6 --- deployment/templates/deployment.yaml | 47 ------------------ deployment/templates/ingress.yaml | 49 ------------------- .../templates/mongodb/mongodb-deployment.yaml | 30 ------------ deployment/templates/mongodb/mongodb-pvc.yaml | 28 ----------- .../templates/mongodb/mongodb-secret.yaml | 0 .../templates/mongodb/mongodb-service.yaml | 14 ------ .../notify-completion-deployment.yaml | 25 ---------- deployment/templates/pubgrade-pvc.yaml | 28 ----------- deployment/templates/role-binding.yaml | 13 ----- deployment/templates/role.yaml | 9 ---- deployment/templates/service-account.yaml | 5 -- deployment/templates/services.yaml | 12 ----- deployment/values.yaml | 28 ----------- 14 files changed, 294 deletions(-) delete mode 100644 deployment/Chart.yaml delete mode 100644 deployment/templates/deployment.yaml delete mode 100644 deployment/templates/ingress.yaml delete mode 100644 deployment/templates/mongodb/mongodb-deployment.yaml delete mode 100644 deployment/templates/mongodb/mongodb-pvc.yaml delete mode 100644 deployment/templates/mongodb/mongodb-secret.yaml delete mode 100644 deployment/templates/mongodb/mongodb-service.yaml delete mode 100644 deployment/templates/notify-completion-deployment.yaml delete mode 100644 deployment/templates/pubgrade-pvc.yaml delete mode 100644 deployment/templates/role-binding.yaml delete mode 100644 deployment/templates/role.yaml delete mode 100644 deployment/templates/service-account.yaml delete mode 100644 deployment/templates/services.yaml delete mode 100644 deployment/values.yaml diff --git a/deployment/Chart.yaml b/deployment/Chart.yaml deleted file mode 100644 index cc520da..0000000 --- a/deployment/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -name: pubgrade -description: A Helm chart for Kubernetes -type: application -version: 0.1.0 -appVersion: 0.0.1 \ No newline at end of file diff --git a/deployment/templates/deployment.yaml b/deployment/templates/deployment.yaml deleted file mode 100644 index e3b1bb0..0000000 --- a/deployment/templates/deployment.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: pubgrade -spec: - replicas: 1 - selector: - matchLabels: - app: pubgrade - template: - metadata: - labels: - app: pubgrade - spec: - serviceAccountName: pubgrade - automountServiceAccountToken: true - containers: - - name: pubgrade - imagePullPolicy: IfNotPresent - image: akash7778/pubgrade:test_build - ports: - - containerPort: 8080 - volumeMounts: - - mountPath: {{ .Values.volumes.Pubgrade.pathToMountedDir }} - name: pubgrade-storage - env: - - name: NAMESPACE - value: {{ .Release.Namespace }} - - name: PV_NAME - value: {{ .Values.volumes.Pubgrade.name }} - - name: BASE_DIR - value: {{ .Values.volumes.Pubgrade.pathToMountedDir }} - volumes: - - name: pubgrade-storage - persistentVolumeClaim: - claimName: {{ .Values.volumes.Pubgrade.name }} - initContainers: - - name: take-data-dir-ownership - image: alpine:3 - command: - - chown - - -R - - 1000:1000 - - {{ .Values.volumes.Pubgrade.pathToMountedDir }} - volumeMounts: - - name: pubgrade-storage - mountPath: {{ .Values.volumes.Pubgrade.pathToMountedDir }} diff --git a/deployment/templates/ingress.yaml b/deployment/templates/ingress.yaml deleted file mode 100644 index 9216644..0000000 --- a/deployment/templates/ingress.yaml +++ /dev/null @@ -1,49 +0,0 @@ -{{- if .Values.ingress.enabled }} -{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - annotations: - kubernetes.io/ingress.class: nginx - {{- if .Values.ingress.https.enabled }} - cert-manager.io/cluster-issuer: {{ .Values.ingress.https.issuer }} - kubernetes.io/tls-acme: {{ quote .Values.ingress.https.enabled}} - {{- end }} - name: pubgrade-ingress -spec: - rules: - - host: {{ .Values.ingress.url }} - http: - paths: - - backend: - service: - name: pubgrade-service - port: - number: 8080 - path: / - pathType: Prefix - {{- if .Values.ingress.https.enabled }} - tls: - - hosts: - - {{ .Values.ingress.url }} - secretName: pubgrade-ingress-secret - {{- end }} -{{- else if .Capabilities.APIVersions.Has "route.openshift.io/v1/Route" -}} -apiVersion: route.openshift.io/v1 -kind: Route -metadata: - name: pubgrade-ingress -spec: - host: {{ .Values.ingress.url }} - tls: - insecureEdgeTerminationPolicy: Redirect - termination: edge - to: - kind: Service - name: pubgrade-service - weight: 100 - wildcardPolicy: None -status: - ingress: [] -{{- end }} -{{- end }} \ No newline at end of file diff --git a/deployment/templates/mongodb/mongodb-deployment.yaml b/deployment/templates/mongodb/mongodb-deployment.yaml deleted file mode 100644 index 15aa07a..0000000 --- a/deployment/templates/mongodb/mongodb-deployment.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: mongodb - labels: - app: db -spec: - replicas: 1 - selector: - matchLabels: - app: db - template: - metadata: - labels: - app: db - spec: - containers: - - name: mongodb - image: mongo:3.6 - ports: - - containerPort: 27017 - name: db-container - volumeMounts: - - mountPath: /data/db - name: mongodb-storage - volumes: - - name: mongodb-storage - persistentVolumeClaim: - claimName: {{ .Values.volumes.mongodb.name }} - \ No newline at end of file diff --git a/deployment/templates/mongodb/mongodb-pvc.yaml b/deployment/templates/mongodb/mongodb-pvc.yaml deleted file mode 100644 index eb3acc3..0000000 --- a/deployment/templates/mongodb/mongodb-pvc.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{ if .Values.volumes.mongodb.deployLocalPv }} -apiVersion: v1 -kind: PersistentVolume -metadata: - name: mongo-pv - labels: - type: local -spec: - storageClassName: {{ .Values.volumes.mongodb.storageClass }} - capacity: - storage: {{ .Values.volumes.mongodb.size }} - accessModes: - - ReadWriteOnce - hostPath: - path: {{ .Values.volumes.mongodb.pathToLocalDir }} -{{ end }} ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .Values.volumes.mongodb.name }} -spec: - storageClassName: {{ .Values.volumes.mongodb.storageClass }} - accessModes: - - ReadWriteOnce - resources: - requests: - storage: {{ .Values.volumes.mongodb.size }} \ No newline at end of file diff --git a/deployment/templates/mongodb/mongodb-secret.yaml b/deployment/templates/mongodb/mongodb-secret.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/deployment/templates/mongodb/mongodb-service.yaml b/deployment/templates/mongodb/mongodb-service.yaml deleted file mode 100644 index ab3d421..0000000 --- a/deployment/templates/mongodb/mongodb-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: mongodb - labels: - app: db -spec: - ports: - - port: 27017 - protocol: TCP - name: mongodb - selector: - app: db - type: NodePort \ No newline at end of file diff --git a/deployment/templates/notify-completion-deployment.yaml b/deployment/templates/notify-completion-deployment.yaml deleted file mode 100644 index b972b90..0000000 --- a/deployment/templates/notify-completion-deployment.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: build-complete-updater -spec: - replicas: 1 - selector: - matchLabels: - app: pubgrade - template: - metadata: - labels: - app: pubgrade - spec: - serviceAccountName: pubgrade - automountServiceAccountToken: true - containers: - - image: {{ .Values.imageNotifyCompletion }} - name: notify-completion - imagePullPolicy: IfNotPresent - env: - - name: NAMESPACE - value: {{ .Release.Namespace }} - - name: BROKER_URL - value: {{ .Values.pubgrade_URL }} diff --git a/deployment/templates/pubgrade-pvc.yaml b/deployment/templates/pubgrade-pvc.yaml deleted file mode 100644 index 380603b..0000000 --- a/deployment/templates/pubgrade-pvc.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{ if .Values.volumes.Pubgrade.deployLocalPv }} -apiVersion: v1 -kind: PersistentVolume -metadata: - name: pubgrade-pv - labels: - type: local -spec: - storageClassName: {{ .Values.volumes.Pubgrade.storageClass }} - capacity: - storage: {{ .Values.volumes.Pubgrade.size }} - accessModes: - - ReadWriteOnce - hostPath: - path: {{ .Values.volumes.Pubgrade.pathToLocalDir }} -{{ end }} ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .Values.volumes.Pubgrade.name }} -spec: - storageClassName: {{ .Values.volumes.Pubgrade.storageClass }} - accessModes: - - ReadWriteOnce - resources: - requests: - storage: {{ .Values.volumes.Pubgrade.size }} diff --git a/deployment/templates/role-binding.yaml b/deployment/templates/role-binding.yaml deleted file mode 100644 index dd2d15d..0000000 --- a/deployment/templates/role-binding.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: manage-pods - namespace: {{ .Release.Namespace }} -subjects: -- kind: ServiceAccount - name: pubgrade - namespace: {{ .Release.Namespace }} -roleRef: - kind: Role - name: role-pubgrade - apiGroup: rbac.authorization.k8s.io diff --git a/deployment/templates/role.yaml b/deployment/templates/role.yaml deleted file mode 100644 index 2c2c482..0000000 --- a/deployment/templates/role.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - namespace: {{ .Release.Namespace }} - name: role-pubgrade -rules: -- apiGroups: [""] - resources: ["pods", "services"] - verbs: ["get", "list", "watch", "create", "update", "delete"] diff --git a/deployment/templates/service-account.yaml b/deployment/templates/service-account.yaml deleted file mode 100644 index bb11cbb..0000000 --- a/deployment/templates/service-account.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: pubgrade -automountServiceAccountToken: true diff --git a/deployment/templates/services.yaml b/deployment/templates/services.yaml deleted file mode 100644 index 28d7d6b..0000000 --- a/deployment/templates/services.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: pubgrade-service -spec: - type: NodePort - selector: - app: pubgrade - ports: - - port: 8080 - targetPort: 8080 - nodePort: 30008 diff --git a/deployment/values.yaml b/deployment/values.yaml deleted file mode 100644 index 5b4b17f..0000000 --- a/deployment/values.yaml +++ /dev/null @@ -1,28 +0,0 @@ -imageNotifyCompletion: 'akash7778/notify-completion' # This will be moved to elixir-cloud-aai -pubgrade_URL: 'http://pubgrade-service.pubgrade' - -ingress: - enabled: true - url: 'your.url.without.http.com' - https: - enabled: true - issuer: letsencrypt-prod - -#Persistent volumes and claims -volumes: - Pubgrade: - # In case you are working with minikube or another single-worker solution - # you can add a peristent volume from a local directory. For fully-distributed - #clusters you should use a StorageClass already existing in your cluster, so set this to false. - deployLocalPv: true - pathToMountedDir: /pubgrade_temp_files - pathToLocalDir: /tmp/pubgrade-pv - name: pubgrade-pvc - storageClass: manual - size: 2Gi - mongodb: - deployLocalPv: true - pathToLocalDir: /tmp/mongo-pv - name: mongo-pvc - storageClass: manual - size: 2Gi From 89ffac3338e2f604d0db9a2452f4f312cc7cfb72 Mon Sep 17 00:00:00 2001 From: xhrach06 <104822196+xhrach06@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:04:06 +0200 Subject: [PATCH 4/4] Add files via upload --- deployment/Chart.yaml | 6 + deployment/templates/cfg.yaml | 8 ++ deployment/templates/deployment.yaml | 59 ++++++++ deployment/templates/ingress.yaml | 49 +++++++ .../templates/mongodb/mongodb-deployment.yaml | 33 +++++ deployment/templates/mongodb/mongodb-pvc.yaml | 28 ++++ .../templates/mongodb/mongodb-secret.yaml | 0 .../templates/mongodb/mongodb-service.yaml | 14 ++ .../notify-completion-deployment.yaml | 32 +++++ deployment/templates/pubgrade-pvc.yaml | 28 ++++ deployment/templates/role-binding.yaml | 13 ++ deployment/templates/role.yaml | 9 ++ deployment/templates/service-account.yaml | 5 + deployment/templates/services.yaml | 11 ++ deployment/values.yaml | 127 ++++++++++++++++++ 15 files changed, 422 insertions(+) create mode 100644 deployment/Chart.yaml create mode 100644 deployment/templates/cfg.yaml create mode 100644 deployment/templates/deployment.yaml create mode 100644 deployment/templates/ingress.yaml create mode 100644 deployment/templates/mongodb/mongodb-deployment.yaml create mode 100644 deployment/templates/mongodb/mongodb-pvc.yaml create mode 100644 deployment/templates/mongodb/mongodb-secret.yaml create mode 100644 deployment/templates/mongodb/mongodb-service.yaml create mode 100644 deployment/templates/notify-completion-deployment.yaml create mode 100644 deployment/templates/pubgrade-pvc.yaml create mode 100644 deployment/templates/role-binding.yaml create mode 100644 deployment/templates/role.yaml create mode 100644 deployment/templates/service-account.yaml create mode 100644 deployment/templates/services.yaml create mode 100644 deployment/values.yaml diff --git a/deployment/Chart.yaml b/deployment/Chart.yaml new file mode 100644 index 0000000..cc520da --- /dev/null +++ b/deployment/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: pubgrade +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 +appVersion: 0.0.1 \ No newline at end of file diff --git a/deployment/templates/cfg.yaml b/deployment/templates/cfg.yaml new file mode 100644 index 0000000..b80d13f --- /dev/null +++ b/deployment/templates/cfg.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +data: + config.yaml: | + {{.Values.config}} + +kind: ConfigMap +metadata: + name: certconf \ No newline at end of file diff --git a/deployment/templates/deployment.yaml b/deployment/templates/deployment.yaml new file mode 100644 index 0000000..caa3657 --- /dev/null +++ b/deployment/templates/deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pubgrade +spec: + replicas: 1 + selector: + matchLabels: + app: pubgrade + template: + metadata: + labels: + app: pubgrade + spec: + serviceAccountName: pubgrade + automountServiceAccountToken: true + containers: + - name: pubgrade + imagePullPolicy: IfNotPresent + image: cerit.io/matej_hrachovec/pub_fix:debu + ports: + - containerPort: 8080 + volumeMounts: + - mountPath: {{ .Values.volumes.Pubgrade.pathToMountedDir }} + name: pubgrade-storage + - name: certconf + mountPath: /etc/ssl/certs/cert.pem + subPath: cert.pem + readOnly: false + env: + - name: NAMESPACE + value: {{ .Release.Namespace }} + - name: PV_NAME + value: {{ .Values.volumes.Pubgrade.name }} + - name: BASE_DIR + value: {{ .Values.volumes.Pubgrade.pathToMountedDir }} + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + volumes: + - name: certconf + configMap: + name: certconf + - name: pubgrade-storage + persistentVolumeClaim: + claimName: {{ .Values.volumes.Pubgrade.name }} + #{{- if .Values.volumes.Pubgrade.deployLocalPv }} + initContainers: + - name: take-data-dir-ownership + image: alpine:3 + command: + - chown + - -R + - 1000:1000 + - {{ .Values.volumes.Pubgrade.pathToMountedDir }} + volumeMounts: + - name: pubgrade-storage + mountPath: {{ .Values.volumes.Pubgrade.pathToMountedDir }} + #{{end}} diff --git a/deployment/templates/ingress.yaml b/deployment/templates/ingress.yaml new file mode 100644 index 0000000..9216644 --- /dev/null +++ b/deployment/templates/ingress.yaml @@ -0,0 +1,49 @@ +{{- if .Values.ingress.enabled }} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + {{- if .Values.ingress.https.enabled }} + cert-manager.io/cluster-issuer: {{ .Values.ingress.https.issuer }} + kubernetes.io/tls-acme: {{ quote .Values.ingress.https.enabled}} + {{- end }} + name: pubgrade-ingress +spec: + rules: + - host: {{ .Values.ingress.url }} + http: + paths: + - backend: + service: + name: pubgrade-service + port: + number: 8080 + path: / + pathType: Prefix + {{- if .Values.ingress.https.enabled }} + tls: + - hosts: + - {{ .Values.ingress.url }} + secretName: pubgrade-ingress-secret + {{- end }} +{{- else if .Capabilities.APIVersions.Has "route.openshift.io/v1/Route" -}} +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + name: pubgrade-ingress +spec: + host: {{ .Values.ingress.url }} + tls: + insecureEdgeTerminationPolicy: Redirect + termination: edge + to: + kind: Service + name: pubgrade-service + weight: 100 + wildcardPolicy: None +status: + ingress: [] +{{- end }} +{{- end }} \ No newline at end of file diff --git a/deployment/templates/mongodb/mongodb-deployment.yaml b/deployment/templates/mongodb/mongodb-deployment.yaml new file mode 100644 index 0000000..0b65038 --- /dev/null +++ b/deployment/templates/mongodb/mongodb-deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mongodb + labels: + app: db +spec: + replicas: 1 + selector: + matchLabels: + app: db + template: + metadata: + labels: + app: db + spec: + containers: + - name: mongodb + image: mongo:3.6 + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + ports: + - containerPort: 27017 + name: db-container + volumeMounts: + - mountPath: /data/db + name: mongodb-storage + volumes: + - name: mongodb-storage + persistentVolumeClaim: + claimName: {{ .Values.volumes.mongodb.name }} + diff --git a/deployment/templates/mongodb/mongodb-pvc.yaml b/deployment/templates/mongodb/mongodb-pvc.yaml new file mode 100644 index 0000000..eb3acc3 --- /dev/null +++ b/deployment/templates/mongodb/mongodb-pvc.yaml @@ -0,0 +1,28 @@ +{{ if .Values.volumes.mongodb.deployLocalPv }} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: mongo-pv + labels: + type: local +spec: + storageClassName: {{ .Values.volumes.mongodb.storageClass }} + capacity: + storage: {{ .Values.volumes.mongodb.size }} + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.volumes.mongodb.pathToLocalDir }} +{{ end }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Values.volumes.mongodb.name }} +spec: + storageClassName: {{ .Values.volumes.mongodb.storageClass }} + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.volumes.mongodb.size }} \ No newline at end of file diff --git a/deployment/templates/mongodb/mongodb-secret.yaml b/deployment/templates/mongodb/mongodb-secret.yaml new file mode 100644 index 0000000..e69de29 diff --git a/deployment/templates/mongodb/mongodb-service.yaml b/deployment/templates/mongodb/mongodb-service.yaml new file mode 100644 index 0000000..e3895fd --- /dev/null +++ b/deployment/templates/mongodb/mongodb-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: mongodb-{{ .Release.Name }} + labels: + app: db +spec: + ports: + - port: 27017 + protocol: TCP + name: mongodb + selector: + app: db + type: ClusterIP diff --git a/deployment/templates/notify-completion-deployment.yaml b/deployment/templates/notify-completion-deployment.yaml new file mode 100644 index 0000000..2bd972c --- /dev/null +++ b/deployment/templates/notify-completion-deployment.yaml @@ -0,0 +1,32 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: build-complete-updater +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + serviceAccountName: {{ .Release.Name }} + automountServiceAccountToken: true + containers: + - image: {{ .Values.imageNotifyCompletion }} + name: notify-completion + imagePullPolicy: IfNotPresent + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + resources: + limits: + cpu: 1 + memory: 512Mi + env: + - name: NAMESPACE + value: {{ .Release.Namespace }} + - name: BROKER_URL + value: {{ .Values.pubgrade_URL }} diff --git a/deployment/templates/pubgrade-pvc.yaml b/deployment/templates/pubgrade-pvc.yaml new file mode 100644 index 0000000..380603b --- /dev/null +++ b/deployment/templates/pubgrade-pvc.yaml @@ -0,0 +1,28 @@ +{{ if .Values.volumes.Pubgrade.deployLocalPv }} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: pubgrade-pv + labels: + type: local +spec: + storageClassName: {{ .Values.volumes.Pubgrade.storageClass }} + capacity: + storage: {{ .Values.volumes.Pubgrade.size }} + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.volumes.Pubgrade.pathToLocalDir }} +{{ end }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Values.volumes.Pubgrade.name }} +spec: + storageClassName: {{ .Values.volumes.Pubgrade.storageClass }} + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.volumes.Pubgrade.size }} diff --git a/deployment/templates/role-binding.yaml b/deployment/templates/role-binding.yaml new file mode 100644 index 0000000..25edd8f --- /dev/null +++ b/deployment/templates/role-binding.yaml @@ -0,0 +1,13 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ .Release.Name }}-manage-pods + namespace: {{ .Release.Namespace }} +subjects: +- kind: ServiceAccount + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: Role + name: role-{{ .Release.Name }} + apiGroup: rbac.authorization.k8s.io \ No newline at end of file diff --git a/deployment/templates/role.yaml b/deployment/templates/role.yaml new file mode 100644 index 0000000..e5095ad --- /dev/null +++ b/deployment/templates/role.yaml @@ -0,0 +1,9 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + namespace: {{ .Release.Namespace }} + name: role-{{ .Release.Name }} +rules: +- apiGroups: [""] + resources: ["pods", "services"] + verbs: ["get", "list", "watch", "create", "update", "delete"] diff --git a/deployment/templates/service-account.yaml b/deployment/templates/service-account.yaml new file mode 100644 index 0000000..b01ceb2 --- /dev/null +++ b/deployment/templates/service-account.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Release.Name }} +automountServiceAccountToken: true diff --git a/deployment/templates/services.yaml b/deployment/templates/services.yaml new file mode 100644 index 0000000..e596fd6 --- /dev/null +++ b/deployment/templates/services.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-service +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }} + ports: + - port: 8080 + targetPort: 8080 diff --git a/deployment/values.yaml b/deployment/values.yaml new file mode 100644 index 0000000..be2d4b2 --- /dev/null +++ b/deployment/values.yaml @@ -0,0 +1,127 @@ +imageNotifyCompletion: 'akash7778/notify-completion' # This will be moved to elixir-cloud-aai +pubgrade_URL: 'http://pubgrade-service.pubgrade' + +ingress: + enabled: true + url: 'pupgrade.dyn.cloud.e-infra.cz' + https: + enabled: true + issuer: letsencrypt-prod +name: mongodb +#Persistent volumes and claims +volumes: + Pubgrade: + # In case you are working with minikube or another single-worker solution + # you can add a peristent volume from a local directory. For fully-distributed + #clusters you should use a StorageClass already existing in your cluster, so set this to false. + deployLocalPv: false + pathToMountedDir: /tmp/pubgrade_temp_files + pathToLocalDir: /tmp/pubgrade-pv + name: pvc-pubgrade + storageClass: nfs-csi + size: 2Gi + mongodb: + deployLocalPv: false + pathToLocalDir: /tmp/mongo-pv + name: pvc-mongo + storageClass: nfs-csi + size: 2Gi + +config: + db: + host: mongodb-pubgrade + port: 27017 + dbs: + pubgradeStore: + collections: + repositories: + indexes: + - keys: + id: 1 + options: + 'unique': True + builds: + indexes: + - keys: + id: 1 + options: + 'unique': True + subscriptions: + indexes: + - keys: + id: 1 + options: + 'unique': True + users: + indexes: + - keys: + uid: 1 + options: + 'unique': True + admin_users: + indexes: + - keys: + uid: 1 + options: + 'unique': True + server: + host: '0.0.0.0' + port: 8080 + debug: True + environment: development + testing: True + use_reloader: True + api: + specs: + - path: + - api/pubgrade.yaml + append: null + add_operation_fields: + x-openapi-router-controller: pubgrade.modules.server + connexion: + strict_validation: True + validate_responses: True + options: + swagger_ui: True + serve_spec: True + exceptions: + required_members: [['msg'], ['status_code']] + status_member: ['status_code'] + exceptions: pubgrade.errors.exceptions.exceptions + log: + version: 1 + disable_existing_loggers: False + formatters: + standard: + class: logging.Formatter + style: "{" + format: "[{asctime}: {levelname:<8}] {message} [{name}]" + handlers: + console: + class: logging.StreamHandler + level: 20 + formatter: standard + stream: ext://sys.stderr + root: + level: 10 + handlers: [console] + endpoints: + repository: + id_charset: [string.ascii_lowercase, string.digits , '.' , '-'] + id_length: 6 + retries: 3 + user: + uid_charset: [string.ascii_lowercase, string.digits , '.' , '-'] + uid_length: 6 + retries: 3 + access_token: + charset: [ string.ascii_lowercase, string.digits , '.' , '-' ] + length: 32 + subscriptions: + admin_users: + - name: 'Akash' + uid: 'akash.saini' + user_access_token: 'c42a6d44e3d0' + - name: 'Alvaro' + uid: 'alvaro.gonzalez' + user_access_token: 'c42fhg44e3d0'