diff --git a/apps/attachments/base/deployment.yaml b/apps/attachments/base/deployment.yaml new file mode 100644 index 0000000..7e517d4 --- /dev/null +++ b/apps/attachments/base/deployment.yaml @@ -0,0 +1,76 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: attachments + namespace: attachments + labels: + app: attachments +spec: + replicas: 1 + selector: + matchLabels: + app: attachments + template: + metadata: + labels: + app: attachments + spec: + containers: + - name: attachments + image: cr.yandex/crp3ccidau046kdj8g9q/att9:dev + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8000 + protocol: TCP + env: + - name: POSTGRES_POOL_SIZE + value: "10" + - name: API_ADDRESS + value: 0.0.0.0:8000 + - name: YANDEX_S3_ACCOUNT_PATH + value: /etc/sarex/yc-s3-storage/yc-s3-service-account.json + - name: BUCKET_NAME + value: attachments-storage + - name: DATABASE_SSL_MODE + value: disable + - name: YANDEX_S3_VERIFY + value: "false" + - name: YANDEX_S3_USE_SSL + value: "false" + - name: DATABASE_HOST + valueFrom: + secretKeyRef: + name: postgres-secret + key: host + - name: DATABASE_PORT + valueFrom: + secretKeyRef: + name: postgres-secret + key: port + - name: DATABASE_NAME + valueFrom: + secretKeyRef: + name: postgres-secret + key: database + - name: DATABASE_USER + valueFrom: + secretKeyRef: + name: postgres-secret + key: username + - name: DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-secret + key: password + volumeMounts: + - mountPath: /etc/sarex/yc-s3-storage + name: yc-s3 + readOnly: true + imagePullSecrets: + - name: regcred + volumes: + - name: yc-s3 + secret: + secretName: yc-s3 diff --git a/apps/attachments/base/kustomization.yaml b/apps/attachments/base/kustomization.yaml new file mode 100644 index 0000000..548fc42 --- /dev/null +++ b/apps/attachments/base/kustomization.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: attachments +resources: + - namespace.yaml + - deployment.yaml + - service.yaml + diff --git a/apps/attachments/base/namespace.yaml b/apps/attachments/base/namespace.yaml new file mode 100644 index 0000000..d0f31d5 --- /dev/null +++ b/apps/attachments/base/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: attachments + labels: + istio-injection: enabled diff --git a/apps/attachments/base/service.yaml b/apps/attachments/base/service.yaml new file mode 100644 index 0000000..90823b9 --- /dev/null +++ b/apps/attachments/base/service.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: attachments-service + namespace: attachments +spec: + type: ClusterIP + selector: + app: attachments + ports: + - port: 8000 + targetPort: 8000 + protocol: TCP diff --git a/apps/attachments/yc-k8s-test/kustomization.yaml b/apps/attachments/yc-k8s-test/kustomization.yaml new file mode 100644 index 0000000..4183b17 --- /dev/null +++ b/apps/attachments/yc-k8s-test/kustomization.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../base +patches: + - path: replicas.yaml + target: + kind: Deployment + name: attachments diff --git a/apps/attachments/yc-k8s-test/replicas.yaml b/apps/attachments/yc-k8s-test/replicas.yaml new file mode 100644 index 0000000..264fcf4 --- /dev/null +++ b/apps/attachments/yc-k8s-test/replicas.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: attachments + namespace: attachments +spec: + replicas: 1 diff --git a/clusters/yc-k8s-test/kustomization.yaml b/clusters/yc-k8s-test/kustomization.yaml index 9d0c6f3..82e5205 100644 --- a/clusters/yc-k8s-test/kustomization.yaml +++ b/clusters/yc-k8s-test/kustomization.yaml @@ -10,4 +10,5 @@ resources: - ../../apps/projects/yc-k8s-test - ../../apps/control-interface/yc-k8s-test - ../../apps/cross-section/yc-k8s-test - - ../../apps/mapper/yc-k8s-test \ No newline at end of file + - ../../apps/mapper/yc-k8s-test + - ../../apps/attachments/yc-k8s-test \ No newline at end of file