From 5cd0485117061624070e1758435e1816f8d022e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Thu, 31 Jan 2019 18:19:19 +0100 Subject: [PATCH] Point the backend to the local neo4j service --- README.md | 3 +-- services/backend.yml | 22 ++++++++++++++++++++++ services/neo4j.yml | 23 +++++++++++++++++++++++ services/web.yml | 21 +++++++++++++++++++++ services/webapp.yml | 21 +++++++++++++++++++++ staging/backend-deployment.yaml | 5 ----- staging/neo4j-configmap.yaml | 2 +- staging/neo4j-service.yaml | 22 ---------------------- 8 files changed, 89 insertions(+), 30 deletions(-) create mode 100644 services/backend.yml create mode 100644 services/neo4j.yml create mode 100644 services/web.yml create mode 100644 services/webapp.yml delete mode 100644 staging/neo4j-service.yaml diff --git a/README.md b/README.md index 29faf84d5..00ddea2d4 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,7 @@ Wait until all pods turn green and they don't show a warning `Waiting: Container ## Expose the services ```shell -kubectl expose deployment nitro-backend --namespace=staging --type=LoadBalancer --port=4000 -kubectl expose deployment nitro-web --namespace=staging --type=LoadBalancer --port=3000 +kubectl create -f services/ ``` ## Access the service diff --git a/services/backend.yml b/services/backend.yml new file mode 100644 index 000000000..0d4246275 --- /dev/null +++ b/services/backend.yml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: nitro-backend + namespace: staging + labels: + workload.user.cattle.io/workloadselector: deployment-staging-backend +spec: + ports: + - name: web + protocol: TCP + port: 4000 + targetPort: 4000 + nodePort: 32612 + selector: + workload.user.cattle.io/workloadselector: deployment-staging-backend + type: LoadBalancer + sessionAffinity: None + externalTrafficPolicy: Cluster +status: + loadBalancer: {} + diff --git a/services/neo4j.yml b/services/neo4j.yml new file mode 100644 index 000000000..681ba2e40 --- /dev/null +++ b/services/neo4j.yml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + name: neo4j + namespace: staging + labels: + workload.user.cattle.io/workloadselector: deployment-staging-neo4j +spec: + selector: + workload.user.cattle.io/workloadselector: deployment-staging-neo4j + ports: + - name: bolt + protocol: TCP + port: 7687 + targetPort: 7687 + - name: web + protocol: TCP + port: 7474 + targetPort: 7474 + type: LoadBalancer + sessionAffinity: None + type: ClusterIP + diff --git a/services/web.yml b/services/web.yml new file mode 100644 index 000000000..a46e27dea --- /dev/null +++ b/services/web.yml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: nitro-web + namespace: staging + labels: + workload.user.cattle.io/workloadselector: deployment-staging-web +spec: + ports: + - name: web + protocol: "TCP" + port: 3000 + targetPort: 3000 + selector: + workload.user.cattle.io/workloadselector: deployment-staging-web + type: LoadBalancer + sessionAffinity: None + externalTrafficPolicy: Cluster +status: + loadBalancer: {} + diff --git a/services/webapp.yml b/services/webapp.yml new file mode 100644 index 000000000..a46e27dea --- /dev/null +++ b/services/webapp.yml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: nitro-web + namespace: staging + labels: + workload.user.cattle.io/workloadselector: deployment-staging-web +spec: + ports: + - name: web + protocol: "TCP" + port: 3000 + targetPort: 3000 + selector: + workload.user.cattle.io/workloadselector: deployment-staging-web + type: LoadBalancer + sessionAffinity: None + externalTrafficPolicy: Cluster +status: + loadBalancer: {} + diff --git a/staging/backend-deployment.yaml b/staging/backend-deployment.yaml index b5f379ddb..f2ebffb9c 100644 --- a/staging/backend-deployment.yaml +++ b/staging/backend-deployment.yaml @@ -7,11 +7,6 @@ spec: replicas: 2 minReadySeconds: 15 progressDeadlineSeconds: 60 - # strategy: - # rollingUpdate: - # maxSurge: 1 - # maxUnavailable: 0 - # type: RollingUpdate selector: matchLabels: workload.user.cattle.io/workloadselector: deployment-staging-backend diff --git a/staging/neo4j-configmap.yaml b/staging/neo4j-configmap.yaml index 2f5ece848..78d1ba3cd 100644 --- a/staging/neo4j-configmap.yaml +++ b/staging/neo4j-configmap.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap data: - NEO4J_URI: "bolt://neo4j:7687" + NEO4J_URI: "bolt://neo4j.staging:7687" NEO4J_USER: "neo4j" NEO4J_AUTH: none metadata: diff --git a/staging/neo4j-service.yaml b/staging/neo4j-service.yaml deleted file mode 100644 index 0f66d7474..000000000 --- a/staging/neo4j-service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - annotations: - field.cattle.io/ipAddresses: "null" - field.cattle.io/targetDnsRecordIds: "null" - field.cattle.io/targetWorkloadIds: '["deployment:staging:nitro-neo4j"]' - labels: - cattle.io/creator: norman - name: neo4j - namespace: staging -spec: - clusterIP: None - ports: - - name: default - port: 42 - protocol: TCP - targetPort: 42 - selector: - workloadID_neo4j: "true" - sessionAffinity: None - type: ClusterIP