diff --git a/apps/download/.DS_Store b/apps/download/.DS_Store new file mode 100644 index 00000000..39dea8eb Binary files /dev/null and b/apps/download/.DS_Store differ diff --git a/apps/download/README.md b/apps/download/README.md new file mode 100644 index 00000000..6145bd40 --- /dev/null +++ b/apps/download/README.md @@ -0,0 +1,3 @@ +# vault + +https://github.com/beclab/analytic \ No newline at end of file diff --git a/apps/download/config/user/helm-charts/.DS_Store b/apps/download/config/user/helm-charts/.DS_Store new file mode 100644 index 00000000..dd21fc96 Binary files /dev/null and b/apps/download/config/user/helm-charts/.DS_Store differ diff --git a/apps/download/config/user/helm-charts/download/.DS_Store b/apps/download/config/user/helm-charts/download/.DS_Store new file mode 100644 index 00000000..0447bee1 Binary files /dev/null and b/apps/download/config/user/helm-charts/download/.DS_Store differ diff --git a/apps/download/config/user/helm-charts/download/.helmignore b/apps/download/config/user/helm-charts/download/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/apps/download/config/user/helm-charts/download/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/apps/download/config/user/helm-charts/download/Chart.yaml b/apps/download/config/user/helm-charts/download/Chart.yaml new file mode 100644 index 00000000..1bb16eb9 --- /dev/null +++ b/apps/download/config/user/helm-charts/download/Chart.yaml @@ -0,0 +1,26 @@ +apiVersion: v2 +name: download +description: A Helm chart for Kubernetes +maintainers: +- name: bytetrade + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.0.1 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/apps/download/config/user/helm-charts/download/templates/download_deploy.yaml b/apps/download/config/user/helm-charts/download/templates/download_deploy.yaml new file mode 100644 index 00000000..750cf411 --- /dev/null +++ b/apps/download/config/user/helm-charts/download/templates/download_deploy.yaml @@ -0,0 +1,191 @@ +{{- $namespace := printf "%s%s" "user-system-" .Values.bfl.username -}} +{{- $download_secret := (lookup "v1" "Secret" $namespace "rss-secrets") -}} + +{{- $pg_password := "" -}} +{{ if $download_secret -}} +{{ $pg_password = (index $download_secret "data" "pg_password") }} +{{ else -}} +{{ $pg_password = randAlphaNum 16 | b64enc }} +{{- end -}} + +--- +apiVersion: v1 +kind: Secret +metadata: + name: download-secrets + namespace: user-system-{{ .Values.bfl.username }} +type: Opaque +data: + pg_password: {{ $pg_password }} +--- +apiVersion: apr.bytetrade.io/v1alpha1 +kind: MiddlewareRequest +metadata: + name: download-pg + namespace: user-system-{{ .Values.bfl.username }} +spec: + app: download + appNamespace: {{ .Release.Namespace }} + middleware: postgres + postgreSQL: + user: knowledge_{{ .Values.bfl.username }} + password: + valueFrom: + secretKeyRef: + key: pg_password + name: download-secrets + databases: + - name: knowledge + + +--- + + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: download + namespace: {{ .Release.Namespace }} + labels: + app: download + applications.app.bytetrade.io/author: bytetrade.io +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: download + template: + metadata: + labels: + app: download + spec: + containers: + - name: aria2 + image: "cesign/aria2-pro" + imagePullPolicy: IfNotPresent + ports: + - containerPort: 6800 + - containerPort: 6888 + env: + - name: RPC_SECRET + value: kubespider + - name: PUID + value: "0" + - name: PGID + value: "0" + volumeMounts: + - name: config-dir + mountPath: /config + - name: download-dir + mountPath: /downloads + resources: + requests: + cpu: 20m + memory: 50Mi + limits: + cpu: "1" + memory: 300Mi + - name: yt-dlp + image: "beclab/yt-dlp:v0.0.1" + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3082 + env: + - name: PG_USERNAME + value: knowledge_{{ .Values.bfl.username }} + - name: PG_PASSWORD + value: {{ $pg_password | b64dec }} + - name: PG_HOST + value: citus-master-svc.user-system-{{ .Values.bfl.username }} + - name: PG_PORT + value: "5432" + - name: PG_DATABASE + value: user_space_{{ .Values.bfl.username }}_knowledge + volumeMounts: + - name: config-dir + mountPath: /app/config + - name: download-dir + mountPath: /app/downloads + resources: + requests: + cpu: 20m + memory: 50Mi + limits: + cpu: "1" + memory: 300Mi + + - name: download-spider + image: "beclab/download-spider:v0.0.1" + imagePullPolicy: IfNotPresent + env: + - name: PG_USERNAME + value: knowledge_{{ .Values.bfl.username }} + - name: PG_PASSWORD + value: {{ $pg_password | b64dec }} + - name: PG_HOST + value: citus-master-svc.user-system-{{ .Values.bfl.username }} + - name: PG_PORT + value: "5432" + - name: PG_DATABASE + value: user_space_{{ .Values.bfl.username }}_knowledge + + ports: + - containerPort: 3080 + resources: + requests: + cpu: 20m + memory: 50Mi + limits: + cpu: "1" + memory: 300Mi + + volumes: + - name: config-dir + hostPath: + type: DirectoryOrCreate + path: {{ .Values.userspace.userData }}/Download/config + - name: download-dir + hostPath: + type: DirectoryOrCreate + path: {{ .Values.userspace.userData }}/Download + + +--- +apiVersion: v1 +kind: Service +metadata: + name: download-svc + namespace: {{ .Release.Namespace }} +spec: + type: ClusterIP + selector: + app: download + ports: + - name: "download-spider" + protocol: TCP + port: 3080 + targetPort: 3080 + - name: "aria2-server" + protocol: TCP + port: 6800 + targetPort: 6800 + +--- +apiVersion: v1 +kind: Service +metadata: + name: download-api + namespace: user-system-{{ .Values.bfl.username }} +spec: + type: ClusterIP + selector: + app: systemserver + ports: + - protocol: TCP + name: download-api + port: 3080 + targetPort: 3080 + + diff --git a/apps/download/config/user/helm-charts/download/values.yaml b/apps/download/config/user/helm-charts/download/values.yaml new file mode 100644 index 00000000..0851f0ea --- /dev/null +++ b/apps/download/config/user/helm-charts/download/values.yaml @@ -0,0 +1,43 @@ + +bfl: + nodeport: 30883 + nodeport_ingress_http: 30083 + nodeport_ingress_https: 30082 + username: 'test' + url: 'test' + nodeName: test +pvc: + userspace: test +userspace: + userData: test/Home + appData: test/Data + appCache: test + dbdata: test +docs: + nodeport: 30881 +desktop: + nodeport: 30180 +os: + portfolio: + appKey: '${ks[0]}' + appSecret: test + vault: + appKey: '${ks[0]}' + appSecret: test + desktop: + appKey: '${ks[0]}' + appSecret: test + message: + appKey: '${ks[0]}' + appSecret: test + wise: + appKey: '${ks[0]}' + appSecret: test + search: + appKey: '${ks[0]}' + appSecret: test + search2: + appKey: '${ks[0]}' + appSecret: test +kubesphere: + redis_password: "" \ No newline at end of file diff --git a/apps/knowledge/config/user/helm-charts/knowledge/templates/knowledge_deployment.yaml b/apps/knowledge/config/user/helm-charts/knowledge/templates/knowledge_deployment.yaml index 2fbf80b7..61aaa2c3 100644 --- a/apps/knowledge/config/user/helm-charts/knowledge/templates/knowledge_deployment.yaml +++ b/apps/knowledge/config/user/helm-charts/knowledge/templates/knowledge_deployment.yaml @@ -105,7 +105,7 @@ spec: spec: containers: - name: knowledge - image: "beclab/knowledge-base-api:v0.1.31" + image: "beclab/knowledge-base-api:v0.1.32" imagePullPolicy: IfNotPresent ports: - containerPort: 3010 @@ -136,6 +136,8 @@ spec: value: "5432" - name: PG_DATABASE value: user_space_{{ .Values.bfl.username }}_knowledge + - name: DOWNLOAD_URL + value: http://download-svc.user-system-{{ .Values.bfl.username }}:3080 volumeMounts: - name: watch-dir mountPath: /data/Home/Documents @@ -149,7 +151,7 @@ spec: memory: 1Gi - name: backend-server - image: "beclab/recommend-backend:v0.0.5" + image: "beclab/recommend-backend:v0.0.6" imagePullPolicy: IfNotPresent env: - name: LISTEN_ADDR @@ -188,8 +190,9 @@ spec: value: "5432" - name: PG_DATABASE value: user_space_{{ .Values.bfl.username }}_knowledge + - name: DOWNLOAD_API_URL + value: http://download-svc.user-system-{{ .Values.bfl.username }}:3080/api/termius/download - ports: - containerPort: 8080 resources: