Deploy neo4j with kubernetes

11/23/2020

I want to deploy neo4j database on server by Kubernetes. After applying manifest files and click route, connection on neo4j browser raise error. I use 'neo4j' for both username and password and With bolt and 7687 port returns:

ServiceUnavailable: Failed to establish connection in 5000ms

and with http and 7474 returns:

ServiceUnavailable: NetworkError when attempting to fetch resource.

I do'nt know where is incorrect?

Manifest files containes the following:

deployment:

apiVersion: apps/v1 
kind: Deployment 
metadata:
  labels:
    app: neo4j-db 
  name: neo4j-db 
spec:
  replicas: 1
  Strategy:
    type: Recreate
  selector:
    matchLabels:
      app: neo4j-db
  template:
    metadata:
      labels: 
        app: neo4j-db 
    spec:
      containers:
      - image: neo4j:3.5.12 
        name: neo4j 
        env: 
          - name: NEO4J_dbms_security_procedures_unrestricted
            value: "algo.*"
        ports: ## Ports to map
            - containerPort: 7474
              name: http
            - containerPort: 7687
              name: bolt
            - containerPort: 7473
              name: https
        resources:
              limits:
                cpu: 500m
                ephemeral-storage: 500M
                memory: 500M
              requests:
                cpu: 500m
                ephemeral-storage: 500M
                memory: 500M
        volumeMounts: ## Volumes to mount
            - name: neo4j-data
              mountPath: "/var/lib/neo4j/data"
      volumes:
          - name: neo4j-data
            persistentVolumeClaim:
              claimName: neo4j-data-claim

service:

apiVersion: v1
kind: Service
metadata:
    name: neo4j-service
spec:
    ports:
      - protocol: TCP
        port: 7474
        targetPort: 7474
        name: http
      - protocol: TCP
        port: 7473
        targetPort: 7473
        name: https
      - protocol: TCP
        port: 7687
        targetPort: 7687
        name: bolt
    selector:
      app: neo4j-db

route:

apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: neo4j
  labels:
    app: neo4j
spec:
  host: neo4j-db-noyantech.apps.ir-thr-at1.arvan.run
  to:
    kind: Service
    name: neo4j-service
    weight: 100
  tls:
    termination: edge
    insecureEdgeTerminationPolicy: Allow
  port:
    targetPort: http
  wildcardPolicy: None

pvc:

kind: "PersistentVolumeClaim"
apiVersion: "v1"
metadata:
  name: neo4j-data-claim
  labels:
    app: neo4j-db
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
-- Nice91
kubernetes
neo4j

0 Answers