diff --git a/deployment/helm/README.md b/deployment/helm/README.md index 88586d2b..38964d45 100644 --- a/deployment/helm/README.md +++ b/deployment/helm/README.md @@ -47,17 +47,12 @@ $ helm uninstall my-studio | Parameter | Description | Default | |-----------|-------------|---------| | replicaCount | Replicas for Deployment | 0 | -| image.httpGateway.name | The image name of nebula-http-gateway | vesoft/nebula-http-gateway | | image.nebulaStudio.name | The image name of nebula-graph-studio | vesoft/nebula-graph-studio | -| image.nginx.name | The image name of nginx | nginx | -| image.httpGateway.version | The image version nebula-http-gateway | v2.1.1 | -| image.nebulaStudio.version | The image version nebula-graph-studio | v3.1.0 | -| image.nginx.version | The image version of nginx | alpine | +| image.nebulaStudio.version | The image version nebula-graph-studio | v3.2.0 | | service.type | The service type, should be one of ['NodePort', 'ClusterIP', 'LoadBalancer'] | ClusterIP | -| service.port | The expose port for nebula-graph-studio's web | 7001 | -| resources.httpGateway | The resource limits/requests for nebula-http-gateway | {} | +| service.port | The expose port for nebula-studio server | 7001 | +| service.nodePort | The proxy port for accessing nebula-studio outside k8s cluster | 32701 | | resources.nebulaStudio | The resource limits/requests for nebula-studio | {} | -| resources.nginx | The resource limits/requests for nginx | {} | | persistent.storageClassName | The storageClassName for PVC if not using default | "" | | persistent.size | The persistent volume size | 5Gi | diff --git a/deployment/helm/templates/configmap.yaml b/deployment/helm/templates/configmap.yaml index d094349e..240a0945 100644 --- a/deployment/helm/templates/configmap.yaml +++ b/deployment/helm/templates/configmap.yaml @@ -1,29 +1,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "nebula-studio.fullname" . }}-nginx-config + name: {{ include "nebula-studio.name" . }}-config data: - nginx.conf: | - server { - listen 7000; - server_name 127.0.0.1; - - location / { - proxy_pass http://127.0.0.1:7001; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $server_name; - client_max_body_size 1024M; - } - - location /upload-dir/ { - root /; - autoindex on; - } - - location ~ ^/api-nebula/([A-Za-z0-9\/]+) { - proxy_pass http://127.0.0.1:8080/api/$1; - } - } + config.yaml: | + web: + upload_dir: /upload + port: 7001 \ No newline at end of file diff --git a/deployment/helm/templates/deployment.yaml b/deployment/helm/templates/deployment.yaml index 59107cbf..310c9284 100644 --- a/deployment/helm/templates/deployment.yaml +++ b/deployment/helm/templates/deployment.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "nebula-studio.fullname" . }} + name: {{ include "nebula-studio.name" . }} labels: {{- include "nebula-studio.labels" . | nindent 4 }} spec: @@ -23,29 +23,11 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} containers: - - name: http-gateway - image: "{{ .Values.image.httpGateway.name }}:{{ .Values.image.httpGateway.version }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: USER - value: root - ports: - - containerPort: 8080 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: 8080 - readinessProbe: - httpGet: - path: / - port: 8080 - resources: - {{- toYaml .Values.resources.httpGateway | nindent 12 }} - volumeMounts: - - name: upload-data - mountPath: /upload - name: nebula-studio + command: + - ./server + args: + - --studio-config=config/config.yaml image: "{{ .Values.image.nebulaStudio.name }}:{{ .Values.image.nebulaStudio.version }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: @@ -55,57 +37,39 @@ spec: - containerPort: 7001 protocol: TCP livenessProbe: + failureThreshold: 3 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 httpGet: path: / port: 7001 readinessProbe: + failureThreshold: 3 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 1 httpGet: path: / port: 7001 - # Patch due to https://github.com/vesoft-inc/nebula-studio/issues/22 - command: - - sh - - -c - - | - sed 's/\(.*docker-start.*studio\)",/\1 --workers=3",/' -i package.json - npm run docker-start resources: {{- toYaml .Values.resources.nebulaStudio | nindent 12 }} volumeMounts: - name: upload-data mountPath: /upload - - name: nginx - image: "{{ .Values.image.nginx.name }}:{{ .Values.image.nginx.version }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - containerPort: 7000 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: 7000 - readinessProbe: - httpGet: - path: / - port: 7000 - resources: - {{- toYaml .Values.resources.nginx | nindent 12 }} - volumeMounts: - - name: upload-data - mountPath: /upload - - name: nginx-config - mountPath: /etc/nginx/conf.d/nebula.conf - subPath: nginx.conf + - name: studio-config + mountPath: /app/config + readOnly: true volumes: - - name: nginx-config + - name: studio-config configMap: - name: {{ include "nebula-studio.fullname" . }}-nginx-config + name: {{ include "nebula-studio.name" . }}-config items: - - key: nginx.conf - path: nginx.conf + - key: config.yaml + path: config.yaml - name: upload-data persistentVolumeClaim: - claimName: {{ include "nebula-studio.fullname" . }}-upload-data + claimName: {{ include "nebula-studio.name" . }}-upload-data {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/deployment/helm/templates/pvc.yaml b/deployment/helm/templates/pvc.yaml index 29cb0e5a..18375954 100644 --- a/deployment/helm/templates/pvc.yaml +++ b/deployment/helm/templates/pvc.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ include "nebula-studio.fullname" . }}-upload-data + name: {{ include "nebula-studio.name" . }}-upload-data spec: accessModes: ["ReadWriteOnce"] {{- if .Values.persistent.storageClassName }} diff --git a/deployment/helm/templates/service.yaml b/deployment/helm/templates/service.yaml index 4f5480f4..01506e9c 100644 --- a/deployment/helm/templates/service.yaml +++ b/deployment/helm/templates/service.yaml @@ -1,16 +1,16 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "nebula-studio.fullname" . }}-web + name: {{ include "nebula-studio.name" . }}-service labels: {{- include "nebula-studio.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: 7000 + targetPort: 7001 {{- if eq .Values.service.type "NodePort" }} - nodePort: {{ .Values.service.port }} + nodePort: {{ .Values.service.nodePort }} {{- end }} protocol: TCP selector: diff --git a/deployment/helm/values.yaml b/deployment/helm/values.yaml index 5a4f1c29..4443f327 100644 --- a/deployment/helm/values.yaml +++ b/deployment/helm/values.yaml @@ -2,15 +2,9 @@ replicaCount: 1 image: pullPolicy: IfNotPresent - httpGateway: - name: vesoft/nebula-http-gateway - version: v2.1.1 nebulaStudio: name: vesoft/nebula-graph-studio - version: v3.1.0 - nginx: - name: nginx - version: alpine + version: v3.2.0 imagePullSecrets: [] @@ -20,11 +14,10 @@ fullnameOverride: "" service: type: ClusterIP port: 7001 + nodePort: 32701 resources: - httpGateway: nebulaStudio: - nginx: persistent: storageClassName: ""