Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes to use ClusterIP internals service instead of headless service #332

Merged
merged 5 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ jobs:
export KUBECONFIG="${CURRENT_DIRECTORY}/.kube/config"
echo "printing kubeconfig path $KUBECONFIG"
export IPS_PASS=$(gcloud auth print-access-token)
if [[ ${{ inputs.RELEASE }} ]]; then
#inputs.RELEASE does not hold value when workflow_dispatch is not called
ISRELEASE=${{ inputs.RELEASE }}
if [[ ${#ISRELEASE} != 0 ]]; then
export NEO4J_DOCKER_IMG="neo4j:${{ inputs.NEO4J_VERSION }}-enterprise"
fi
echo "NEO4J_DOCKER_IMG=${NEO4J_DOCKER_IMG}"
Expand Down Expand Up @@ -223,7 +225,9 @@ jobs:
export KUBECONFIG="${CURRENT_DIRECTORY}/.kube/config"
echo "printing kubeconfig path $KUBECONFIG"
export IPS_PASS=$(gcloud auth print-access-token)
if [[ ${{ inputs.RELEASE }} ]]; then
#inputs.RELEASE does not hold value when workflow_dispatch is not called
ISRELEASE=${{ inputs.RELEASE }}
if [[ ${#ISRELEASE} != 0 ]]; then
export NEO4J_DOCKER_IMG="neo4j:${{ inputs.NEO4J_VERSION }}"
fi
echo "NEO4J_DOCKER_IMG=${NEO4J_DOCKER_IMG}"
Expand Down
4 changes: 2 additions & 2 deletions internal/model/helm_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ var DefaultNeo4jBackupValues = Neo4jBackupValues{
},
Resources: Neo4jBackupResources{
Requests: Neo4jBackupRequests{
EphemeralStorage: "4Gi",
EphemeralStorage: "1Gi",
},
Limits: Neo4jBackupLimits{
EphemeralStorage: "4Gi",
EphemeralStorage: "2Gi",
},
},
SecurityContext: SecurityContext{
Expand Down
1 change: 1 addition & 0 deletions internal/unit_tests/helm_template_cluster_core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func TestClusterCoreInternalPorts(t *testing.T) {
}

internalService := readReplicaManifest.OfTypeWithName(&v1.Service{}, core.InternalServiceName()).(*v1.Service)
assert.Equal(t, internalService.Spec.Type, v1.ServiceTypeClusterIP)

checkPortsMatchExpected(t, expectedPorts, internalService)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func TestReadReplicaInternalPorts(t *testing.T) {
7474: 7474,
7688: 7688,
6000: 6000,
5000: 5000,
7000: 7000,
}

readReplica := model.NewReleaseName("foo")
Expand All @@ -64,7 +66,7 @@ func TestReadReplicaInternalPorts(t *testing.T) {
}

internalService := readReplicaManifest.OfTypeWithName(&v1.Service{}, readReplica.InternalServiceName()).(*v1.Service)

assert.Equal(t, internalService.Spec.Type, v1.ServiceTypeClusterIP)
checkPortsMatchExpected(t, expectedPorts, internalService)
}

Expand Down
4 changes: 3 additions & 1 deletion neo4j-cluster-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,14 @@ services:
type: ClusterIP
# n.b. there is no ports object for this service. Ports are autogenerated based on the neo4j configuration

# A "headless" service for admin/ops and Neo4j cluster-internal communications
# A service for admin/ops and Neo4j cluster-internal communications
# This service is available even if the deployment is not "ready"
internals:
enabled: false
# Annotations for the internals service
annotations: { }
spec:
type: ClusterIP
# n.b. there is no ports object for this service. Ports are autogenerated based on the neo4j configuration

# Neo4j Configuration (yaml format)
Expand Down
4 changes: 3 additions & 1 deletion neo4j-cluster-read-replica/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,14 @@ services:
type: ClusterIP
# n.b. there is no ports object for this service. Ports are autogenerated based on the neo4j configuration

# A "headless" service for admin/ops and Neo4j cluster-internal communications
# A service for admin/ops and Neo4j cluster-internal communications
# This service is available even if the deployment is not "ready"
internals:
enabled: false
# Annotations for the internals service
annotations: { }
spec:
type: ClusterIP
# n.b. there is no ports object for this service. Ports are autogenerated based on the neo4j configuration

# Neo4j Configuration (yaml format)
Expand Down
17 changes: 3 additions & 14 deletions neo4j-standalone/templates/neo4j-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ metadata:
{{- end }}
spec:
publishNotReadyAddresses: true
clusterIP: None
{{- with .spec }}{{ include "neo4j.services.extraSpec" . | nindent 2 }}{{ end }}
type: "{{ .spec.type | required "The 'type' field is required in service.internals.spec" }}"
{{- with omit .spec "type" }}{{ include "neo4j.services.extraSpec" . | nindent 2 }}{{ end }}
selector:
app: "{{ template "neo4j.appName" $ }}"
helm.neo4j.com/instance: "{{ include "neo4j.fullname" $ }}"
Expand All @@ -170,18 +170,7 @@ spec:
targetPort: 7473
name: tcp-https
{{- end }}
{{- if $replicaEnabled }}
#enable the ports 7688 , 6000 only for Read Replicas
- protocol: TCP
port: 7688
targetPort: 7688
name: tcp-boltrouting
- protocol: TCP
port: 6000
targetPort: 6000
name: tcp-tx
{{- end }}
{{- if and (not $replicaEnabled ) $clusterEnabled }}
{{- if $clusterEnabled }}
#enable the ports for non Read Replicas
- protocol: TCP
port: 7688
Expand Down
4 changes: 3 additions & 1 deletion neo4j-standalone/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,14 @@ services:
type: ClusterIP
# n.b. there is no ports object for this service. Ports are autogenerated based on the neo4j configuration

# A "headless" service for admin/ops and Neo4j cluster-internal communications
# A service for admin/ops and Neo4j cluster-internal communications
# This service is available even if the deployment is not "ready"
internals:
enabled: false
# Annotations for the internals service
annotations: { }
spec:
type: ClusterIP
# n.b. there is no ports object for this service. Ports are autogenerated based on the neo4j configuration


Expand Down