Add attachments app with base configuration and yc-k8s-test overlay

This commit is contained in:
emelinda 2026-04-13 14:44:48 +03:00
parent 82a1bdcbc6
commit 40c8ef7d24
9 changed files with 149 additions and 1 deletions

View File

@ -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

View File

@ -0,0 +1,10 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: attachments
resources:
- namespace.yaml
# - deployment.yaml
# - service.yaml
# - secret-postgres.yaml
# - secret-yc-s3.yaml

View File

@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: attachments
labels:
istio-injection: enabled

View File

@ -0,0 +1,13 @@
---
apiVersion: v1
kind: Secret
metadata:
name: postgres-secret
namespace: attachments
type: Opaque
data:
host: ""
port: ""
database: ""
username: ""
password: ""

View File

@ -0,0 +1,9 @@
---
apiVersion: v1
kind: Secret
metadata:
name: yc-s3
namespace: attachments
type: Opaque
data:
yc-s3-service-account.json: ""

View File

@ -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

View File

@ -0,0 +1,10 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
patches: []
# - path: replicas.yaml
# target:
# kind: Deployment
# name: attachments

View File

@ -0,0 +1,8 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: attachments
namespace: attachments
spec:
replicas: 1

View File

@ -11,3 +11,4 @@ resources:
- ../../apps/control-interface/yc-k8s-test
- ../../apps/cross-section/yc-k8s-test
- ../../apps/mapper/yc-k8s-test
- ../../apps/attachments/yc-k8s-test