diff --git a/.gitignore b/.gitignore index 53fbd4f44369..79995c836684 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,8 @@ yarn-error.log* /tests/cypress/fixtures /tests/cypress/screenshots .idea/ + +#Ignore helm-related files +/helm-chart/Chart.lock +/helm-chart/values.override.yaml +/helm-chart/charts/* diff --git a/kubernetes-templates/cvat/.helmignore b/helm-chart/.helmignore similarity index 100% rename from kubernetes-templates/cvat/.helmignore rename to helm-chart/.helmignore diff --git a/kubernetes-templates/cvat/Chart.yaml b/helm-chart/Chart.yaml similarity index 80% rename from kubernetes-templates/cvat/Chart.yaml rename to helm-chart/Chart.yaml index 97b3d5621d70..74665f581150 100644 --- a/kubernetes-templates/cvat/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -22,3 +22,13 @@ version: 0.1.0 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +dependencies: + - name: redis + version: "12.9.*" + repository: https://charts.bitnami.com/bitnami + condition: redis.enabled + - name: postgresql + version: "10.3.*" + repository: https://charts.bitnami.com/bitnami + condition: postgresql.enabled diff --git a/kubernetes-templates/cvat/templates/_helpers.tpl b/helm-chart/templates/_helpers.tpl similarity index 100% rename from kubernetes-templates/cvat/templates/_helpers.tpl rename to helm-chart/templates/_helpers.tpl diff --git a/helm-chart/templates/cvat-postgres-secret.yml b/helm-chart/templates/cvat-postgres-secret.yml new file mode 100644 index 000000000000..4e8e12746793 --- /dev/null +++ b/helm-chart/templates/cvat-postgres-secret.yml @@ -0,0 +1,17 @@ +{{- if .Values.postgresql.secret.create }} +apiVersion: v1 +kind: Secret +metadata: + name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}" + namespace: {{ .Release.Namespace }} + labels: + {{- include "cvat.labels" . | nindent 4 }} +type: generic +stringData: + postgresql-hostname: "{{ .Release.Name }}-postgresql" + postgresql-database: {{ .Values.postgresql.postgresqlDatabase }} + postgresql-username: {{ .Values.postgresql.postgresqlUsername }} + postgresql-password: {{ .Values.postgresql.secret.password }} + postgresql-postgres-password: {{ .Values.postgresql.secret.postgres_password }} + postgresql-replication-password: {{ .Values.postgresql.secret.replication_password }} +{{- end }} diff --git a/kubernetes-templates/cvat/templates/cvat_backend/deployment.yml b/helm-chart/templates/cvat_backend/deployment.yml similarity index 53% rename from kubernetes-templates/cvat/templates/cvat_backend/deployment.yml rename to helm-chart/templates/cvat_backend/deployment.yml index 29f5a8e7468c..0c3fb3a74bfd 100644 --- a/kubernetes-templates/cvat/templates/cvat_backend/deployment.yml +++ b/helm-chart/templates/cvat_backend/deployment.yml @@ -4,14 +4,16 @@ metadata: name: {{ .Release.Name }}-backend namespace: {{ .Release.Namespace }} labels: + {{- include "cvat.labels" . | nindent 4 }} app: cvat-app tier: backend spec: - replicas: 1 + replicas: {{ .Values.cvat.backend.replicas }} strategy: type: Recreate selector: matchLabels: + {{- include "cvat.labels" . | nindent 6 }} app: cvat-app tier: backend template: @@ -19,46 +21,57 @@ spec: labels: app: cvat-app tier: backend + {{- include "cvat.labels" . | nindent 8 }} + {{- with .Values.cvat.backend.labels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.cvat.backend.annotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: containers: - name: cvat-backend-app-container - image: openvino/cvat_server:v1.2.0 - imagePullPolicy: Always + image: {{ .Values.cvat.backend.image }}:{{ .Values.cvat.backend.tag }} + {{- with .Values.cvat.backend.resources }} resources: - requests: - cpu: 10m - memory: 100Mi + {{- toYaml . | nindent 12 }} + {{- end }} env: - name: DJANGO_MODWSGI_EXTRA_ARGS value: "" - name: UI_PORT value: "80" - name: UI_HOST - value: "cvat-frontend-service" + value: "{{ .Release.Name }}-frontend-service" - name: ALLOWED_HOSTS value: "*" {{- if .Values.redis.enabled }} - name: CVAT_REDIS_HOST - value: "cvat-redis-service" + value: "{{ .Release.Name }}-redis-master" {{- end }} - {{- if .Values.redis.enabled }} - name: CVAT_POSTGRES_HOST - value: "cvat-postgres-service" + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}" + key: postgresql-hostname - name: CVAT_POSTGRES_USER valueFrom: secretKeyRef: - name: cvat-postgres-secret - key: POSTGRES_USER + name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}" + key: postgresql-username - name: CVAT_POSTGRES_DBNAME valueFrom: secretKeyRef: - name: cvat-postgres-secret - key: POSTGRES_DB + name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}" + key: postgresql-database - name: CVAT_POSTGRES_PASSWORD valueFrom: secretKeyRef: - name: cvat-postgres-secret - key: POSTGRES_PASSWORD + name: "{{ .Release.Name }}-{{ .Values.postgresql.secret.name }}" + key: postgresql-password + {{- with .Values.cvat.backend.additionalEnv }} + {{- toYaml . | nindent 10 }} {{- end }} ports: - containerPort: 8080 @@ -75,10 +88,17 @@ spec: - mountPath: /home/django/models name: cvat-backend-data subPath: models + {{- with .Values.cvat.backend.additionalVolumeMounts }} + {{- toYaml . | nindent 10 }} + {{- end }} initContainers: - name: user-data-permission-fix image: busybox command: ["/bin/chmod", "-R", "777", "/home/django"] + {{- with .Values.cvat.backend.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /home/django/data name: cvat-backend-data @@ -92,10 +112,20 @@ spec: - mountPath: /home/django/models name: cvat-backend-data subPath: models + {{- with .Values.cvat.backend.additionalVolumeMounts }} + {{- toYaml . | nindent 10 }} + {{- end }} + {{- with .Values.cvat.frontend.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: cvat-backend-data persistentVolumeClaim: - claimName: cvat-backend-data + claimName: "{{ .Release.Name }}-backend-data" + {{- with .Values.cvat.backend.additionalVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/kubernetes-templates/cvat/templates/cvat_backend/service.yml b/helm-chart/templates/cvat_backend/service.yml similarity index 62% rename from kubernetes-templates/cvat/templates/cvat_backend/service.yml rename to helm-chart/templates/cvat_backend/service.yml index db78044c76e8..e5e7c038facb 100644 --- a/kubernetes-templates/cvat/templates/cvat_backend/service.yml +++ b/helm-chart/templates/cvat_backend/service.yml @@ -1,15 +1,17 @@ -{{- if .Values.database.enabled -}} +{{- if .Values.postgresql.enabled -}} apiVersion: v1 kind: Service metadata: - name: cvat-backend-service + name: {{ .Release.Name }}-backend-service namespace: {{ .Release.Namespace }} labels: + {{- include "cvat.labels" . | nindent 4 }} app: cvat-app tier: backend spec: type: ClusterIP selector: + {{- include "cvat.labels" . | nindent 6 }} app: cvat-app tier: backend ports: diff --git a/kubernetes-templates/cvat/templates/cvat_backend/storage.yml b/helm-chart/templates/cvat_backend/storage.yml similarity index 60% rename from kubernetes-templates/cvat/templates/cvat_backend/storage.yml rename to helm-chart/templates/cvat_backend/storage.yml index 1ccb77c5a830..ae03be4359d8 100644 --- a/kubernetes-templates/cvat/templates/cvat_backend/storage.yml +++ b/helm-chart/templates/cvat_backend/storage.yml @@ -1,8 +1,12 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: cvat-backend-data + name: {{ .Release.Name }}-backend-data namespace: {{ .Release.Namespace }} + labels: + {{- include "cvat.labels" . | nindent 4 }} + app: cvat-app + tier: backend spec: accessModes: - ReadWriteOnce diff --git a/helm-chart/templates/cvat_frontend/deployment.yml b/helm-chart/templates/cvat_frontend/deployment.yml new file mode 100644 index 000000000000..dc01c17f51dd --- /dev/null +++ b/helm-chart/templates/cvat_frontend/deployment.yml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-frontend + namespace: {{ .Release.Namespace }} + labels: + {{- include "cvat.labels" . | nindent 4 }} + app: cvat-app + tier: frontend +spec: + replicas: {{ .Values.cvat.frontend.replicas }} + strategy: + type: Recreate + selector: + matchLabels: + {{- include "cvat.labels" . | nindent 6 }} + app: cvat-app + tier: frontend + template: + metadata: + labels: + {{- include "cvat.labels" . | nindent 8 }} + app: cvat-app + tier: frontend + {{- with .Values.cvat.backend.labels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.cvat.backend.annotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + containers: + - name: cvat-frontend-app-container + image: {{ .Values.cvat.frontend.image }}:{{ .Values.cvat.frontend.tag }} + {{- with .Values.cvat.frontend.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + ports: + - containerPort: 80 + {{- with .Values.cvat.frontend.additionalEnv }} + env: + {{- toYaml . | nindent 10 }} + {{- end }} + {{- with .Values.cvat.frontend.additionalVolumeMounts }} + volumeMounts: + {{- toYaml . | nindent 10 }} + {{- end }} + {{- with .Values.cvat.frontend.additionalVolumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.cvat.frontend.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/kubernetes-templates/cvat/templates/cvat_frontend/service.yml b/helm-chart/templates/cvat_frontend/service.yml similarity index 66% rename from kubernetes-templates/cvat/templates/cvat_frontend/service.yml rename to helm-chart/templates/cvat_frontend/service.yml index 88e45a0b9a94..46dfc85199d6 100644 --- a/kubernetes-templates/cvat/templates/cvat_frontend/service.yml +++ b/helm-chart/templates/cvat_frontend/service.yml @@ -1,14 +1,16 @@ apiVersion: v1 kind: Service metadata: - name: cvat-frontend-service + name: {{ .Release.Name }}-frontend-service namespace: {{ .Release.Namespace }} labels: + {{- include "cvat.labels" . | nindent 4 }} app: cvat-app tier: frontend spec: type: ClusterIP selector: + {{- include "cvat.labels" . | nindent 6 }} app: cvat-app tier: frontend ports: diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml new file mode 100644 index 000000000000..1e1f77dc0c84 --- /dev/null +++ b/helm-chart/templates/ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "cvat.fullname" . -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "cvat.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .match }} + backend: + serviceName: {{ .service.name }} + servicePort: {{ .service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml new file mode 100644 index 000000000000..7c13a3ce51b6 --- /dev/null +++ b/helm-chart/values.yaml @@ -0,0 +1,134 @@ +# Default values for cvat. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +cvat: + backend: + replicas: 1 + image: openvino/cvat_server + tag: latest + labels: {} + # test: test + annotations: {} + # test.io/test: test + resources: {} + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: kubernetes.io/e2e-az-name + # operator: In + # values: + # - e2e-az1 + # - e2e-az2 + additionalEnv: [] + # Example: + # - name: volume-from-secret + # - name: TEST + # value: "test" + additionalVolumes: [] + # Example(assumes that pvc was already created): + # - name: tmp + # persistentVolumeClaim: + # claimName: tmp + additionalVolumeMounts: [] + # Example: + # - mountPath: /tmp + # name: tmp + # subPath: test + service: {} + frontend: + replicas: 1 + image: openvino/cvat_ui + tag: latest + labels: {} + # test: test + annotations: {} + # test.io/test: test + resources: {} + affinity: {} + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: kubernetes.io/e2e-az-name + # operator: In + # values: + # - e2e-az1 + # - e2e-az2 + additionalEnv: [] + # Example: + # - name: volume-from-secret + # - name: TEST + # value: "test" + additionalVolumes: [] + # Example(assumes that pvc was already created): + # - name: tmp + # persistentVolumeClaim: + # claimName: tmp + additionalVolumeMounts: [] + # Example: + # - mountPath: /tmp + # name: tmp + # subPath: test + service: {} + +postgresql: + #See https://github.com/bitnami/charts/blob/master/bitnami/postgresql/ for more info + enabled: true # false for external db + external: + host: 127.0.0.1 + port: 5432 + user: postgres + password: postgres + dbname: cvat + + # If not external follwoing config will apply by default + global: + postgresql: + existingSecret: cvt-test-postgres-secret + secret: + create: true + name: postgres-secret + password: cvat_postgresql + postgres_password: cvat_postgresql_postgres + replication_password: cvat_postgresql_replica + postgresqlDatabase: cvat + postgresqlUsername: cvat + service: + port: 5432 + +redis: + #See https://github.com/bitnami/charts/blob/master/bitnami/redis/ for more info + enabled: true + usePassword: false + cluster: + enabled: false + +ingress: + enabled: false +# annotations: +# kubernetes.io/ingress.class: nginx +# # cert-manager.io/cluster-issuer:"your-issuer-name" +# ingress.kubernetes.io/ssl-redirect: "true" +# hosts: +# - host: cvat.example.com +# paths: +# - match: "/api/.*|git/.*|tensorflow/.*|auto_annotation/.*|analytics/.*|static/.*|admin|admin/.*|documentation/.*|dextr/.*|reid/.*" +# service: +# name: cvat-backend-service +# port: 8080 +# - match : "/" +# service: +# name: cvat-frontend-service +# port: 80 +# tls: +# - hosts: +# - cvat.example.com +# secretName: ingress-tls-cvat diff --git a/kubernetes-templates/cvat/templates/cvat_frontend/deployment.yml b/kubernetes-templates/cvat/templates/cvat_frontend/deployment.yml deleted file mode 100644 index 6a91630f67e2..000000000000 --- a/kubernetes-templates/cvat/templates/cvat_frontend/deployment.yml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: cvat-frontend - namespace: {{ .Release.Namespace }} - labels: - app: cvat-app - tier: frontend -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: cvat-app - tier: frontend - template: - metadata: - labels: - app: cvat-app - tier: frontend - spec: - containers: - - name: cvat-frontend-app-container - image: openvino/cvat_ui:v1.2.0 - imagePullPolicy: Always - ports: - - containerPort: 80 - resources: {} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/kubernetes-templates/cvat/templates/cvat_proxy/configmap.yml b/kubernetes-templates/cvat/templates/cvat_proxy/configmap.yml deleted file mode 100644 index 61f1eed9a40d..000000000000 --- a/kubernetes-templates/cvat/templates/cvat_proxy/configmap.yml +++ /dev/null @@ -1,153 +0,0 @@ -{{- if .Values.cvat_proxy.enabled -}} -apiVersion: v1 -kind: ConfigMap -metadata: - name: cvat-nginx-conf - namespace: {{ .Release.Namespace }} -data: - nginx.conf: | - worker_processes 2; - - error_log /dev/stdout info; - - events { - worker_connections 1024; - } - - http { - include mime.types; - default_type application/octet-stream; - sendfile on; - keepalive_timeout 65; - # For long domain names (e.g. AWS hosts) - server_names_hash_bucket_size 128; - - include /etc/nginx/cvat.d/*.conf; - client_max_body_size 0; - } - cvat.conf: | - server { - listen 80; - server_name _ default; - return 404; - } - - server { - listen 80; - server_name {MY_SERVER_URL_COM}; - - proxy_pass_header X-CSRFToken; - proxy_set_header Host $http_host; - proxy_pass_header Set-Cookie; - - location ~* /api/.*|git/.*|tensorflow/.*|auto_annotation/.*|analytics/.*|static/.*|admin|admin/.*|documentation/.*|dextr/.*|reid/.* { - proxy_pass http://cvat-backend-service:8080; - } - - # workaround for match location by arguments - location = / { - error_page 418 = @annotation_ui; - - if ( $query_string ~ "^id=\d+.*" ) { return 418; } - proxy_pass http://cvat-frontend-service:80; - } - - location / { - proxy_pass http://cvat-frontend-service:80; - } - - # old annotation ui, will be removed in the future. - location @annotation_ui { - proxy_pass http://cvat-backend-service:8080; - } - } - mime.types: | - types { - text/html html htm shtml; - text/css css; - text/xml xml; - image/gif gif; - image/jpeg jpeg jpg; - application/javascript js; - application/atom+xml atom; - application/rss+xml rss; - - text/mathml mml; - text/plain txt; - text/vnd.sun.j2me.app-descriptor jad; - text/vnd.wap.wml wml; - text/x-component htc; - - image/png png; - image/tiff tif tiff; - image/vnd.wap.wbmp wbmp; - image/x-icon ico; - image/x-jng jng; - image/x-ms-bmp bmp; - image/svg+xml svg svgz; - image/webp webp; - - application/font-woff woff; - application/java-archive jar war ear; - application/json json; - application/mac-binhex40 hqx; - application/msword doc; - application/pdf pdf; - application/postscript ps eps ai; - application/rtf rtf; - application/vnd.apple.mpegurl m3u8; - application/vnd.ms-excel xls; - application/vnd.ms-fontobject eot; - application/vnd.ms-powerpoint ppt; - application/vnd.wap.wmlc wmlc; - application/vnd.google-earth.kml+xml kml; - application/vnd.google-earth.kmz kmz; - application/x-7z-compressed 7z; - application/x-cocoa cco; - application/x-java-archive-diff jardiff; - application/x-java-jnlp-file jnlp; - application/x-makeself run; - application/x-perl pl pm; - application/x-pilot prc pdb; - application/x-rar-compressed rar; - application/x-redhat-package-manager rpm; - application/x-sea sea; - application/x-shockwave-flash swf; - application/x-stuffit sit; - application/x-tcl tcl tk; - application/x-x509-ca-cert der pem crt; - application/x-xpinstall xpi; - application/xhtml+xml xhtml; - application/xspf+xml xspf; - application/zip zip; - - application/octet-stream bin exe dll; - application/octet-stream deb; - application/octet-stream dmg; - application/octet-stream iso img; - application/octet-stream msi msp msm; - - application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; - application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; - - audio/midi mid midi kar; - audio/mpeg mp3; - audio/ogg ogg; - audio/x-m4a m4a; - audio/x-realaudio ra; - - video/3gpp 3gpp 3gp; - video/mp2t ts; - video/mp4 mp4; - video/mpeg mpeg mpg; - video/quicktime mov; - video/webm webm; - video/x-flv flv; - video/x-m4v m4v; - video/x-mng mng; - video/x-ms-asf asx asf; - video/x-ms-wmv wmv; - video/x-msvideo avi; - } -{{- end}} diff --git a/kubernetes-templates/cvat/templates/cvat_proxy/deployment.yml b/kubernetes-templates/cvat/templates/cvat_proxy/deployment.yml deleted file mode 100644 index 9fd51f7f5095..000000000000 --- a/kubernetes-templates/cvat/templates/cvat_proxy/deployment.yml +++ /dev/null @@ -1,52 +0,0 @@ -{{- if .Values.cvat_proxy.enabled -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: cvat-nginx - namespace: {{ .Release.Namespace }} - labels: - app: cvat-app - tier: proxy -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: cvat-app - tier: proxy - template: - metadata: - labels: - app: cvat-app - tier: proxy - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: nginx - image: nginx - ports: - - containerPort: 80 - volumeMounts: - - mountPath: /etc/nginx - readOnly: true - name: cvat-nginx-conf - - mountPath: /var/log/nginx - name: log - volumes: - - name: cvat-nginx-conf - configMap: - name: cvat-nginx-conf - items: - - key: nginx.conf - path: nginx.conf - - key: mime.types - path: mime.types - - key: cvat.conf - path: cvat.d/cvat.conf - - name: log - emptyDir: {} -{{- end }} diff --git a/kubernetes-templates/cvat/templates/cvat_proxy/service.yml b/kubernetes-templates/cvat/templates/cvat_proxy/service.yml deleted file mode 100644 index 6ce5b97eacf4..000000000000 --- a/kubernetes-templates/cvat/templates/cvat_proxy/service.yml +++ /dev/null @@ -1,20 +0,0 @@ -{{- if .Values.cvat_proxy.enabled -}} -apiVersion: v1 -kind: Service -metadata: - name: cvat-proxy-service - namespace: {{ .Release.Namespace }} - labels: - app: cvat-app - tier: proxy -spec: - type: NodePort - selector: - app: cvat-app - tier: proxy - ports: - - port: 80 - targetPort: 80 - protocol: TCP - name: http -{{- end}} diff --git a/kubernetes-templates/cvat/templates/database/deployment.yml b/kubernetes-templates/cvat/templates/database/deployment.yml deleted file mode 100644 index e84a3d7b7216..000000000000 --- a/kubernetes-templates/cvat/templates/database/deployment.yml +++ /dev/null @@ -1,67 +0,0 @@ -{{- if .Values.database.enabled -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: cvat-postgres - namespace: {{ .Release.Namespace }} - labels: - app: cvat-app - tier: db -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: cvat-app - tier: db - template: - metadata: - labels: - app: cvat-app - tier: db - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: cvat-postgres - image: postgres:10.3-alpine - imagePullPolicy: "IfNotPresent" - env: - - name: POSTGRES_DB - valueFrom: - secretKeyRef: - name: cvat-postgres-secret - key: POSTGRES_DB - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: cvat-postgres-secret - key: POSTGRES_USER - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: cvat-postgres-secret - key: POSTGRES_PASSWORD - ports: - - containerPort: 5432 - readinessProbe: - exec: - command: - - sh - - -c - - su - postgres -c "pg_isready --host=$POD_IP" - initialDelaySeconds: 15 - timeoutSeconds: 2 - resources: {} - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: postgredb - subPath: postgres - volumes: - - name: postgredb - persistentVolumeClaim: - claimName: cvat-postgres-data -{{- end }} diff --git a/kubernetes-templates/cvat/templates/database/secrets.yml b/kubernetes-templates/cvat/templates/database/secrets.yml deleted file mode 100644 index e3ad16c49f55..000000000000 --- a/kubernetes-templates/cvat/templates/database/secrets.yml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if .Values.database.enabled -}} -apiVersion: v1 -kind: Secret -type: Opaque -metadata: - name: cvat-postgres-secret - namespace: {{ .Release.Namespace }} - labels: - app: cvat-app - tier: db -stringData: - POSTGRES_DB: cvat - POSTGRES_USER: root - POSTGRES_PASSWORD: POSTGRES_ADMIN_PW -{{- end}} diff --git a/kubernetes-templates/cvat/templates/database/service.yml b/kubernetes-templates/cvat/templates/database/service.yml deleted file mode 100644 index fec43922788b..000000000000 --- a/kubernetes-templates/cvat/templates/database/service.yml +++ /dev/null @@ -1,20 +0,0 @@ -{{- if .Values.database.enabled -}} -apiVersion: v1 -kind: Service -metadata: - name: cvat-postgres-service - namespace: {{ .Release.Namespace }} - labels: - app: cvat-app - tier: db -spec: - type: ClusterIP - selector: - app: cvat-app - tier: db - ports: - - port: 5432 - targetPort: 5432 - protocol: TCP - name: http -{{- end }} diff --git a/kubernetes-templates/cvat/templates/database/storage.yml b/kubernetes-templates/cvat/templates/database/storage.yml deleted file mode 100644 index d028ca3b3240..000000000000 --- a/kubernetes-templates/cvat/templates/database/storage.yml +++ /dev/null @@ -1,14 +0,0 @@ -{{- if .Values.database.enabled -}} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: cvat-postgres-data - namespace: {{ .Release.Namespace }} -spec: - accessModes: - - ReadWriteOnce - storageClassName: standard - resources: - requests: - storage: 20Gi -{{- end }} diff --git a/kubernetes-templates/cvat/templates/redis/deployment.yml b/kubernetes-templates/cvat/templates/redis/deployment.yml deleted file mode 100644 index 524b9f438347..000000000000 --- a/kubernetes-templates/cvat/templates/redis/deployment.yml +++ /dev/null @@ -1,35 +0,0 @@ -{{- if .Values.redis.enabled -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: cvat-redis - namespace: {{ .Release.Namespace }} - labels: - app: cvat-app - tier: redis-app -spec: - replicas: 1 - selector: - matchLabels: - app: cvat-app - tier: redis-app - template: - metadata: - labels: - app: cvat-app - tier: redis-app - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - image: redis:4.0.5-alpine - name: cvat-redis - imagePullPolicy: Always - ports: - - containerPort: 6379 - resources: - limits: - cpu: "0.1" -{{- end }} diff --git a/kubernetes-templates/cvat/templates/redis/service.yml b/kubernetes-templates/cvat/templates/redis/service.yml deleted file mode 100644 index 8605c316338e..000000000000 --- a/kubernetes-templates/cvat/templates/redis/service.yml +++ /dev/null @@ -1,20 +0,0 @@ -{{- if .Values.redis.enabled -}} -apiVersion: v1 -kind: Service -metadata: - name: cvat-redis-service - namespace: {{ .Release.Namespace }} - labels: - app: cvat-app - tier: redis-app -spec: - type: ClusterIP - selector: - app: cvat-app - tier: redis-app - ports: - - port: 6379 - targetPort: 6379 - protocol: TCP - name: http -{{- end}} diff --git a/kubernetes-templates/cvat/values.yaml b/kubernetes-templates/cvat/values.yaml deleted file mode 100644 index b738038d7372..000000000000 --- a/kubernetes-templates/cvat/values.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Default values for cvat. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: nginx - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -service: - type: ClusterIP - port: 80 - -database: - enabled: true - image: "" - tag: "" - service: {} - -redis: - enabled: true - image: "" - tag: "" - service: {} - -cvat: - proxy: - image: "" - tag: "" - enabled: true - service: {} - backend: - image: "" - tag: "" - service: {} - frontend: - image: "" - tag: "" - service: {}