diff --git a/deploy/download/configmap.yaml b/deploy/download/configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cee86a6db3fa3663a5de71a1acfbf9a8b5ea08a2 --- /dev/null +++ b/deploy/download/configmap.yaml @@ -0,0 +1,65 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: repo-configmap + namespace: download +data: + default.conf: | + server { + listen 80; + + if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") { + set $year $1; + set $month $2; + set $day $3; + } + access_log /dev/stdout main; + + server_name download.opengauss.org; + location / { + root /repo/opengauss; + fancyindex on; + fancyindex_exact_size off; + fancyindex_localtime on; + autoindex on; + } + location = /favicon.ico { + log_not_found off; + access_log off; + } + } + nginx.conf: |- + user root; + worker_processes auto; + + error_log /dev/stdout warn; + pid /var/run/nginx.pid; + + load_module "/etc/nginx/modules/ngx_http_fancyindex_module.so"; + + events { + worker_connections 1024; + } + + http { + + # the cidr used for elb cluster + set_real_ip_from 100.125.0.0/16; + real_ip_recursive on; + real_ip_header X-Forwarded-For; + + log_format main '$remote_addr' + '[$time_local] "$request" $status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" $request_filename'; + + sendfile on; + tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + server_tokens off; + include /etc/nginx/conf.d/*.conf; + } diff --git a/deploy/download/deployment.yaml b/deploy/download/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9a624b3aac88bdbf746de95fb647f3aaaefdad6f --- /dev/null +++ b/deploy/download/deployment.yaml @@ -0,0 +1,69 @@ +# Deployment for repo service +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: repo-server + namespace: download +spec: + strategy: + type: Recreate + selector: + matchLabels: + app: repo + template: + metadata: + labels: + app: repo + spec: + containers: + - name: repo-nginx + image: swr.cn-north-4.myhuaweicloud.com/opensourceway/opengauss/nginx-fancyindex:v1.0.1 + volumeMounts: + - mountPath: /repo/opengauss + name: data-volume + - mountPath: /etc/nginx/nginx.conf + name: repo-configmap + subPath: nginx.conf + - mountPath: /etc/nginx/conf/default.conf + name: repo-configmap + subPath: default.conf + resources: + requests: + cpu: 1000m + memory: 1000Mi + limits: + cpu: 2000m + memory: 2000Mi + env: + - name: TZ + value: Asia/Shanghai + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 5 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: 80 + timeoutSeconds: 5 + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 5 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: 80 + timeoutSeconds: 5 + command: + - /bin/sh + - -c + - | + mkdir -p /repo/opengauss + exec nginx -g "daemon off;" + volumes: + - name: repo-configmap + configMap: + name: repo-configmap + - name: data-volume + persistentVolumeClaim: + claimName: opengauss-data-volume diff --git a/deploy/download/ingress.yaml b/deploy/download/ingress.yaml new file mode 100644 index 0000000000000000000000000000000000000000..98471b5bbb7c3b8d260914d7c80192b664187ae7 --- /dev/null +++ b/deploy/download/ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + cert-manager.io/cluster-issuer: letsencrypt-prod + name: repo-ingress + namespace: download +spec: + tls: + - hosts: + - download.opengauss.org + secretName: download-tls + rules: + - host: download.opengauss.org + http: + paths: + - backend: + serviceName: repo-service + servicePort: 80 + path: / \ No newline at end of file diff --git a/deploy/download/kustomization.yaml b/deploy/download/kustomization.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eaef82568d80d4aee8d28721b2992d2daddeb428 --- /dev/null +++ b/deploy/download/kustomization.yaml @@ -0,0 +1,16 @@ +resources: +- configmap.yaml +- pvc.yaml +- namespace.yaml +- deployment.yaml +- ingress.yaml +- service.yaml +commonAnnotations: + kubernetes.ops.cluster: opengauss-hk-cluster + kubernetes.ops.email: 747802914@qq.com + kubernetes.ops.os.base: openeuler + kubernetes.ops.owner: liuyang + kubernetes.ops.region: hk +namespace: download + + diff --git a/deploy/download/namespace.yaml b/deploy/download/namespace.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9a58d4415ee25dcd65939a37fda7c053c778a714 --- /dev/null +++ b/deploy/download/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + labels: + name: download + name: download diff --git a/deploy/download/pvc.yaml b/deploy/download/pvc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c9c7073dd140ddc9b898d51e9f71c12a7ce56dce --- /dev/null +++ b/deploy/download/pvc.yaml @@ -0,0 +1,19 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + annotations: + csi.storage.k8s.io/fstype: obsfs + everest.io/obs-volume-type: STANDARD + volume.beta.kubernetes.io/storage-provisioner: everest-csi-provisioner + name: opengauss-data-volume + namespace: download +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Gi + storageClassName: csi-obs + volumeMode: Filesystem + volumeName: pv-obs-opengauss-test-user-access diff --git a/deploy/download/service.yaml b/deploy/download/service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bc78d58667059c116a26054df5926cbf274a64e3 --- /dev/null +++ b/deploy/download/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: repo-service + namespace: download +spec: + ports: + - name: http-port + protocol: TCP + port: 80 + targetPort: 80 + selector: + app: repo + type: ClusterIP