diff --git a/stable/neo4j/Chart.yaml b/stable/neo4j/Chart.yaml index b3a0c6a956..1cedd18fb4 100644 --- a/stable/neo4j/Chart.yaml +++ b/stable/neo4j/Chart.yaml @@ -1,6 +1,6 @@ name: neo4j home: https://www.neo4j.com -version: 0.4.0 +version: 0.5.0 appVersion: 3.2.3 description: Neo4j is the world's leading graph database icon: http://info.neo4j.com/rs/773-GON-065/images/neo4j_logo.png diff --git a/stable/neo4j/README.md b/stable/neo4j/README.md index 08cb9852b5..7adfd670da 100644 --- a/stable/neo4j/README.md +++ b/stable/neo4j/README.md @@ -60,11 +60,13 @@ their default values. | `authEnabled` | Is login/password required? | `true` | | `core.numberOfServers` | Number of machines in CORE mode | `3` | | `core.sideCarContainers` | Sidecar containers to add to the core pod. Example use case is a sidecar which identifies and labels the leader when using the http API | `{}` | +| `core.initContainers` | Init containers to add to the core pod. Example use case is a script that installs the APOC library | `{}` | | `core.persistentVolume.storageClass` | Storage class of backing PVC | `standard` (uses beta storage class annotation) | | `core.persistentVolume.size` | Size of data volume | `10Gi` | | `core.persistentVolume.mountPath` | Persistent Volume mount root path | `/data` | | `core.persistentVolume.annotations` | Persistent Volume Claim annotations | `{}` | | `readReplica.numberOfServers` | Number of machines in READ_REPLICA mode | `0` | +| `readReplica.initContainers` | Init containers to add to the replica pod. Example use case is a script that installs the APOC library | `{}` | | `resources` | Resources required (e.g. CPU, memory) | `{}` | The above parameters map to the env variables defined in the diff --git a/stable/neo4j/templates/core-dns.yaml b/stable/neo4j/templates/core-dns.yaml index 1c9a5b9a4e..3759457a0d 100644 --- a/stable/neo4j/templates/core-dns.yaml +++ b/stable/neo4j/templates/core-dns.yaml @@ -15,5 +15,5 @@ spec: targetPort: 7474 selector: app: {{ template "neo4j.name" . }} - release: {{ .Release.Name }} + release: {{ .Release.Name | quote }} component: core diff --git a/stable/neo4j/templates/core-statefulset.yaml b/stable/neo4j/templates/core-statefulset.yaml index 978495b832..8b679bf515 100644 --- a/stable/neo4j/templates/core-statefulset.yaml +++ b/stable/neo4j/templates/core-statefulset.yaml @@ -5,6 +5,11 @@ metadata: spec: serviceName: {{ template "neo4j.fullname" . }} replicas: {{ .Values.core.numberOfServers }} + selector: + matchLabels: + release: {{ .Release.Name | quote }} + app: {{ template "neo4j.name" . }} + component: core template: metadata: labels: @@ -28,7 +33,7 @@ spec: - name: NEO4J_causal__clustering_discovery__type value: DNS - name: NEO4J_causal__clustering_initial__discovery__members - value: "{{ template "neo4j.fullname" . }}.default.svc.cluster.local:5000" + value: "{{ template "neo4j.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:5000" {{- if .Values.authEnabled }} - name: NEO4J_SECRETS_PASSWORD valueFrom: @@ -72,12 +77,21 @@ spec: - name: datadir mountPath: "{{ .Values.core.persistentVolume.mountPath }}" subPath: "{{ .Values.core.persistentVolume.subPath }}" + volumeMounts: + - name: plugins + mountPath: /plugins resources: {{ toYaml .Values.resources | indent 10 }} {{- if .Values.core.sidecarContainers }} {{ toYaml .Values.core.sidecarContainers | indent 6}} {{- end }} - +{{- if .Values.core.initContainers }} + initContainers: +{{ toYaml .Values.core.initContainers | indent 6}} +{{- end }} + volumes: + - name: plugins + emptyDir: {} volumeClaimTemplates: - metadata: name: datadir diff --git a/stable/neo4j/templates/readreplicas-deployment.yaml b/stable/neo4j/templates/readreplicas-deployment.yaml index f1d9edf618..2c745e3add 100644 --- a/stable/neo4j/templates/readreplicas-deployment.yaml +++ b/stable/neo4j/templates/readreplicas-deployment.yaml @@ -29,7 +29,7 @@ spec: - name: NEO4J_causal__clustering_discovery__type value: DNS - name: NEO4J_causal__clustering_initial__discovery__members - value: "{{ template "neo4j.fullname" . }}.default.svc.cluster.local:5000" + value: "{{ template "neo4j.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:5000" {{- if .Values.authEnabled }} - name: NEO4J_SECRETS_PASSWORD valueFrom: @@ -61,5 +61,15 @@ spec: name: bolt - containerPort: 6000 name: tx + volumeMounts: + - name: plugins + mountPath: /plugins securityContext: privileged: true +{{- if .Values.readReplica.initContainers }} + initContainers: +{{ toYaml .Values.readReplica.initContainers | indent 6}} +{{- end }} + volumes: + - name: plugins + emptyDir: {} diff --git a/stable/neo4j/templates/tests/test-config.yaml b/stable/neo4j/templates/tests/test-config.yaml index 216514af28..1f33917b4f 100644 --- a/stable/neo4j/templates/tests/test-config.yaml +++ b/stable/neo4j/templates/tests/test-config.yaml @@ -28,7 +28,7 @@ data: } for id in {0..2}; do - name="${STATEFULSET_NAME}-core-$id.${STATEFULSET_NAME}.default.svc.cluster.local" + name="${STATEFULSET_NAME}-core-$id.${STATEFULSET_NAME}.${NAMESPACE}.svc.cluster.local" echo "checking $name" run check_machine $name echo $status diff --git a/stable/neo4j/templates/tests/test-neo4j-cluster.yaml b/stable/neo4j/templates/tests/test-neo4j-cluster.yaml index 180cc4551f..c2156b11cb 100644 --- a/stable/neo4j/templates/tests/test-neo4j-cluster.yaml +++ b/stable/neo4j/templates/tests/test-neo4j-cluster.yaml @@ -16,6 +16,8 @@ spec: env: - name: "STATEFULSET_NAME" value: "{{ template "neo4j.fullname" . }}" + - name: "NAMESPACE" + value: {{ .Release.Namespace }} - name: NEO4J_SECRETS_PASSWORD valueFrom: secretKeyRef: diff --git a/stable/neo4j/values.yaml b/stable/neo4j/values.yaml index d6af26ca02..9854a40ed8 100644 --- a/stable/neo4j/values.yaml +++ b/stable/neo4j/values.yaml @@ -47,18 +47,34 @@ core: ## subPath: "" - ## Pass extra environment variables to the Neo4j container. - ## - # extraVars: - # - name: EXTRA_VAR_1 - # value: extra-var-value-1 - # - name: EXTRA_VAR_2 - # value: extra-var-value-2 + ## Pass extra environment variables to the Neo4j container. + ## + # extraVars: + # - name: EXTRA_VAR_1 + # value: extra-var-value-1 + # - name: EXTRA_VAR_2 + # value: extra-var-value-2 - sidecarContainers: {} - ## Additional containers to be added to the Neo4j core pod. - # - name: my-sidecar - # image: nginx:latest + sidecarContainers: {} + ## Additional containers to be added to the Neo4j core pod. + # - name: my-sidecar + # image: nginx:latest + + initContainers: {} + ## init containers to run before the Neo4j core pod e.g. to install plugins + + # - name: init-plugins + # image: "octoberstorm/ubuntu-with-curl:latest" + # imagePullPolicy: "IfNotPresent" + # volumeMounts: + # - name: plugins + # mountPath: /plugins + # command: + # - "/bin/bash" + # - "-c" + # - | + # curl -L https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.2.0.3/apoc-3.2.0.3-all.jar -O + # sudo cp apoc-3.2.0.3-all.jar /plugins/ # Read Replicas readReplica: @@ -71,6 +87,22 @@ readReplica: # - name: EXTRA_VAR_2 # value: extra-var-value-2 + initContainers: {} + ## init containers to run before the Neo4j replica pod e.g. to install plugins + + # - name: init-plugins + # image: "octoberstorm/ubuntu-with-curl:latest" + # imagePullPolicy: "IfNotPresent" + # volumeMounts: + # - name: plugins + # mountPath: /plugins + # command: + # - "/bin/bash" + # - "-c" + # - | + # curl -L https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.2.0.3/apoc-3.2.0.3-all.jar -O + # sudo cp apoc-3.2.0.3-all.jar /plugins/ + resources: {} # limits: # cpu: 100m