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

helm charts upgrade #102

Merged
merged 3 commits into from
Jan 28, 2022
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
11 changes: 3 additions & 8 deletions deployment/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

30 changes: 5 additions & 25 deletions deployment/helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -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
78 changes: 21 additions & 57 deletions deployment/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion deployment/helm/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions deployment/helm/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
11 changes: 2 additions & 9 deletions deployment/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []

Expand All @@ -20,11 +14,10 @@ fullnameOverride: ""
service:
type: ClusterIP
port: 7001
nodePort: 32701

resources:
httpGateway:
nebulaStudio:
nginx:

persistent:
storageClassName: ""
Expand Down