From d0c9c91ff3b12aaef0d2a965e6166e53bef36291 Mon Sep 17 00:00:00 2001 From: sido Date: Thu, 20 Sep 2018 16:50:46 +0200 Subject: [PATCH] updated nexus to connect to nfs provisioning --- .../deployments/httpd-deployment.yaml | 34 ------------ .../deployments/nexus-deployment.yaml | 54 +++++++++++------- .../deployments/nexusProxy-deployment.yaml | 55 +++++++++++++++++++ molgenis-nexus/templates/ingress.yaml | 4 +- .../templates/persistence/nexusPVC.yaml | 15 +++++ .../templates/services/httpd-service.yaml | 13 ----- .../services/nexusProxy-service.yaml | 13 +++++ .../templates/volumes/nexus-pv.yaml | 16 ------ .../templates/volumes/nexus-pvc.yaml | 11 ---- molgenis-nexus/values.yaml | 39 ++++--------- 10 files changed, 130 insertions(+), 124 deletions(-) delete mode 100644 molgenis-nexus/templates/deployments/httpd-deployment.yaml create mode 100644 molgenis-nexus/templates/deployments/nexusProxy-deployment.yaml create mode 100644 molgenis-nexus/templates/persistence/nexusPVC.yaml delete mode 100644 molgenis-nexus/templates/services/httpd-service.yaml create mode 100644 molgenis-nexus/templates/services/nexusProxy-service.yaml delete mode 100644 molgenis-nexus/templates/volumes/nexus-pv.yaml delete mode 100644 molgenis-nexus/templates/volumes/nexus-pvc.yaml diff --git a/molgenis-nexus/templates/deployments/httpd-deployment.yaml b/molgenis-nexus/templates/deployments/httpd-deployment.yaml deleted file mode 100644 index cbf1c0f..0000000 --- a/molgenis-nexus/templates/deployments/httpd-deployment.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - creationTimestamp: null - name: {{ .Values.httpd.name }} - labels: - app: {{ .Values.httpd.name }} - environment: {{ .Values.environment }} -spec: - replicas: {{ .Values.replicaCount }} - strategy: - type: {{ .Values.httpd.strategy.type }} - selector: - matchLabels: - app: {{ .Values.httpd.selector }} - template: - metadata: - labels: - app: {{ .Values.httpd.name }} - creationTimestamp: null - spec: - restartPolicy: {{ .Values.httpd.restartPolicy }} - containers: - - name: {{ .Values.httpd.name }} - image: "{{ .Values.httpd.image.repository }}:{{ .Values.httpd.image.tag }}" - imagePullPolicy: {{ .Values.httpd.image.pullPolicy }} - env: - - name: PROXY_SERVICE - value: "{{ .Values.nexus.name }}:{{ .Values.nexus.port.ui }},{{ .Values.nexus.name }}:{{ .Values.nexus.port.docker }}:{{ .Values.nexus.path.dockerV2 }}" - - name: SERVER_NAME - value: {{ .Values.httpd.hostname }} - ports: - - containerPort: {{ .Values.httpd.port }} - resources: {} \ No newline at end of file diff --git a/molgenis-nexus/templates/deployments/nexus-deployment.yaml b/molgenis-nexus/templates/deployments/nexus-deployment.yaml index 96d04f4..72056eb 100644 --- a/molgenis-nexus/templates/deployments/nexus-deployment.yaml +++ b/molgenis-nexus/templates/deployments/nexus-deployment.yaml @@ -19,26 +19,40 @@ spec: app: {{ .Values.nexus.name }} creationTimestamp: null spec: - volumes: - - name: {{ .Values.persistence.name }} - persistentVolumeClaim: - claimName: {{ .Values.persistence.name }} restartPolicy: {{ .Values.nexus.restartPolicy }} - initContainers: - - name: volume-mount-nexus - image: busybox - command: ["sh", "-c", "chown -R 200:200 {{ .Values.persistence.mountPath }}"] - volumeMounts: - - name: {{ .Values.persistence.name }} - mountPath: "{{ .Values.persistence.mountPath }}" containers: - - name: {{ .Values.nexus.name }} - image: "{{ .Values.nexus.image.repository }}:{{ .Values.nexus.image.tag }}" - imagePullPolicy: {{ .Values.nexus.image.pullPolicy }} - ports: - - containerPort: {{ .Values.nexus.port.ui }} - - containerPort: {{ .Values.nexus.port.docker }} - volumeMounts: - - name: {{ .Values.persistence.name }} - mountPath: "/nexus-data" + - name: {{ .Values.nexus.name }} + image: "{{ .Values.nexus.image.repository }}:{{ .Values.nexus.image.tag }}" + imagePullPolicy: {{ .Values.nexus.image.pullPolicy }} + ports: + - containerPort: {{ .Values.nexus.port.ui }} + - containerPort: {{ .Values.nexus.port.docker }} + volumeMounts: + - name: molgenis-nexus-nfs + mountPath: "/nexus-data" + livenessProbe: + httpGet: + path: / + port: {{ .Values.nexus.port.ui }} + initialDelaySeconds: 90 + periodSeconds: 20 + failureThreshold: 5 + successThreshold: 1 + readinessProbe: + httpGet: + path: / + port: {{ .Values.nexus.port.ui }} + initialDelaySeconds: 90 + periodSeconds: 5 + failureThreshold: 5 + successThreshold: 1 + volumes: + - name: molgenis-nexus-nfs + persistentVolumeClaim: + claimName: {{ .Values.persistence.claim }} + + {{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} \ No newline at end of file diff --git a/molgenis-nexus/templates/deployments/nexusProxy-deployment.yaml b/molgenis-nexus/templates/deployments/nexusProxy-deployment.yaml new file mode 100644 index 0000000..2be16c8 --- /dev/null +++ b/molgenis-nexus/templates/deployments/nexusProxy-deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + creationTimestamp: null + name: {{ .Values.nexusProxy.name }} + labels: + app: {{ .Values.nexusProxy.name }} + environment: {{ .Values.environment }} +spec: + replicas: {{ .Values.replicaCount }} + strategy: + type: {{ .Values.nexusProxy.strategy.type }} + selector: + matchLabels: + app: {{ .Values.nexusProxy.selector }} + template: + metadata: + labels: + app: {{ .Values.nexusProxy.name }} + creationTimestamp: null + spec: + restartPolicy: {{ .Values.nexusProxy.restartPolicy }} + containers: + - name: {{ .Values.nexusProxy.name }} + image: "{{ .Values.nexusProxy.image.repository }}:{{ .Values.nexusProxy.image.tag }}" + imagePullPolicy: {{ .Values.nexusProxy.image.pullPolicy }} + env: + - name: PROXY_SERVICE + value: "{{ .Values.nexus.name }}:{{ .Values.nexus.port.ui }},{{ .Values.nexus.name }}:{{ .Values.nexus.port.docker }}:{{ .Values.nexus.path.dockerV2 }}" + - name: SERVER_NAME + value: {{ .Values.nexusProxy.hostname }} + ports: + - containerPort: {{ .Values.nexusProxy.port }} + resources: {} + livenessProbe: + httpGet: + path: / + port: {{ .Values.nexusProxy.port }} + initialDelaySeconds: 90 + periodSeconds: 5 + failureThreshold: 5 + successThreshold: 1 + readinessProbe: + httpGet: + path: / + port: {{ .Values.nexusProxy.port }} + initialDelaySeconds: 90 + periodSeconds: 5 + failureThreshold: 5 + successThreshold: 1 + + {{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} \ No newline at end of file diff --git a/molgenis-nexus/templates/ingress.yaml b/molgenis-nexus/templates/ingress.yaml index 9df4d02..3cae610 100644 --- a/molgenis-nexus/templates/ingress.yaml +++ b/molgenis-nexus/templates/ingress.yaml @@ -25,8 +25,8 @@ spec: paths: - path: {{ default "/" .path }} backend: - serviceName: httpd - servicePort: 80 + serviceName: {{ $.Values.nexusProxy.name }} + servicePort: {{ $.Values.nexusProxy.port }} {{- if .tls }} tls: - hosts: diff --git a/molgenis-nexus/templates/persistence/nexusPVC.yaml b/molgenis-nexus/templates/persistence/nexusPVC.yaml new file mode 100644 index 0000000..2e2466f --- /dev/null +++ b/molgenis-nexus/templates/persistence/nexusPVC.yaml @@ -0,0 +1,15 @@ +{{- if .Values.persistence.enabled -}} +apiVersion: extensions/v1beta1 +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ .Values.persistence.claim }} + annotations: + volume.beta.kubernetes.io/storage-class: "nfs-provisioner-retain" +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- end }} \ No newline at end of file diff --git a/molgenis-nexus/templates/services/httpd-service.yaml b/molgenis-nexus/templates/services/httpd-service.yaml deleted file mode 100644 index 7067ecb..0000000 --- a/molgenis-nexus/templates/services/httpd-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.httpd.name }} - labels: - app: {{ .Values.httpd.name }} -spec: - type: {{ .Values.httpd.service.type }} - ports: - - name: {{ .Values.httpd.name }} - port: {{ .Values.httpd.port }} - selector: - app: {{ .Values.httpd.selector }} diff --git a/molgenis-nexus/templates/services/nexusProxy-service.yaml b/molgenis-nexus/templates/services/nexusProxy-service.yaml new file mode 100644 index 0000000..281ee81 --- /dev/null +++ b/molgenis-nexus/templates/services/nexusProxy-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.nexusProxy.name }} + labels: + app: {{ .Values.nexusProxy.name }} +spec: + type: {{ .Values.nexusProxy.service.type }} + ports: + - name: {{ .Values.nexusProxy.name }} + port: {{ .Values.nexusProxy.port }} + selector: + app: {{ .Values.nexusProxy.selector }} diff --git a/molgenis-nexus/templates/volumes/nexus-pv.yaml b/molgenis-nexus/templates/volumes/nexus-pv.yaml deleted file mode 100644 index 95c6f71..0000000 --- a/molgenis-nexus/templates/volumes/nexus-pv.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: {{ .Values.persistence.name }} - labels: - name: nfs2 -spec: - storageClassName: {{ .Values.persistence.storageClass }} - capacity: - storage: {{ .Values.persistence.size }} - accessModes: - - {{ .Values.persistence.accessMode }} - persistentVolumeReclaimPolicy: {{ .Values.persistence.reclaimPolicy }} - nfs: - server: {{ .Values.persistence.server }} - path: {{ .Values.persistence.mountPath }} diff --git a/molgenis-nexus/templates/volumes/nexus-pvc.yaml b/molgenis-nexus/templates/volumes/nexus-pvc.yaml deleted file mode 100644 index 3b2d4bb..0000000 --- a/molgenis-nexus/templates/volumes/nexus-pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ .Values.persistence.name }} -spec: - storageClassName: {{ .Values.persistence.storageClass }} - accessModes: - - {{ .Values.persistence.accessMode }} - resources: - requests: - storage: {{ .Values.persistence.size }} \ No newline at end of file diff --git a/molgenis-nexus/values.yaml b/molgenis-nexus/values.yaml index 23b2454..825dd10 100644 --- a/molgenis-nexus/values.yaml +++ b/molgenis-nexus/values.yaml @@ -24,12 +24,12 @@ nexus: service: type: ClusterIP -httpd: - name: httpd - hostname: registry.molgenis.org +nexusProxy: + name: nexus-proxy + hostname: sido.molgenis.org strategy: type: Recreate - selector: httpd + selector: nexus-proxy restartPolicy: Always image: repository: registry.webhosting.rug.nl/molgenis/httpd @@ -43,39 +43,22 @@ httpd: ingress: enabled: true annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" path: / hosts: - - name: registry.molgenis.org + - name: sido.molgenis.org tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local persistence: - name: molgenis-nexus-data - storageClass: nfs-class - size: 30G - reclaimPolicy: Retain - server: 192.168.64.12 - accessMode: ReadWriteMany - mountPath: /gcc/molgenis/nexus + enabled: true + claim: molgenis-nexus + size: 500Gi resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi -nodeSelector: {} +nodeSelector: { + deployPod: "true" +} tolerations: []