Compare commits
	
		
			2 Commits
		
	
	
		
			fc87969ad5
			...
			feature/af
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ab96719964 | |||
| 0215ecaf87 | 
							
								
								
									
										58
									
								
								apps/affine/deployment.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								apps/affine/deployment.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
				
			|||||||
 | 
					apiVersion: apps/v1
 | 
				
			||||||
 | 
					kind: Deployment
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: affine
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  selector:
 | 
				
			||||||
 | 
					    matchLabels:
 | 
				
			||||||
 | 
					      app: affine
 | 
				
			||||||
 | 
					  template:
 | 
				
			||||||
 | 
					    metadata:
 | 
				
			||||||
 | 
					      labels:
 | 
				
			||||||
 | 
					        app: affine
 | 
				
			||||||
 | 
					    spec:
 | 
				
			||||||
 | 
					      containers:
 | 
				
			||||||
 | 
					      - name: affine
 | 
				
			||||||
 | 
					        image: affine
 | 
				
			||||||
 | 
					        resources:
 | 
				
			||||||
 | 
					          limits:
 | 
				
			||||||
 | 
					            memory: "512Mi"
 | 
				
			||||||
 | 
					            cpu: "1"
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					        - name: AFFINE_SERVER_HOST
 | 
				
			||||||
 | 
					          value: "affine.kluster.moll.re"
 | 
				
			||||||
 | 
					        - name: AFFINE_SERVER_PORT
 | 
				
			||||||
 | 
					          value: "443"
 | 
				
			||||||
 | 
					        - name: AFFINE_SERVER_HTTPS
 | 
				
			||||||
 | 
					          value: "true"
 | 
				
			||||||
 | 
					        - name: AFFINE_CONFIG_PATH
 | 
				
			||||||
 | 
					          value: "/root/.affine/config"
 | 
				
			||||||
 | 
					        - name: AFFINE_ADMIN_EMAIL
 | 
				
			||||||
 | 
					          value: "me@moll.re"
 | 
				
			||||||
 | 
					        - name: AFFINE_ADMIN_PASSWORD
 | 
				
			||||||
 | 
					          value: "password"
 | 
				
			||||||
 | 
					        - name: TELEMETRY_ENABLE
 | 
				
			||||||
 | 
					          value: "false"
 | 
				
			||||||
 | 
					        - name: DATABASE_URL
 | 
				
			||||||
 | 
					          valueFrom:
 | 
				
			||||||
 | 
					            secretKeyRef:
 | 
				
			||||||
 | 
					              name: postgres-credentials
 | 
				
			||||||
 | 
					              key: url
 | 
				
			||||||
 | 
					        - name: NODE_OPTIONS
 | 
				
			||||||
 | 
					          value: "--import=./scripts/register.js"
 | 
				
			||||||
 | 
					        - name: NODE_ENV
 | 
				
			||||||
 | 
					          value: "production"
 | 
				
			||||||
 | 
					        ports:
 | 
				
			||||||
 | 
					        - containerPort: 3010
 | 
				
			||||||
 | 
					        volumeMounts:
 | 
				
			||||||
 | 
					        - name: affine-data
 | 
				
			||||||
 | 
					          mountPath: /root/.affine/storage
 | 
				
			||||||
 | 
					        - name: affine-config
 | 
				
			||||||
 | 
					          mountPath: /root/.affine/config
 | 
				
			||||||
 | 
					      volumes:
 | 
				
			||||||
 | 
					      - name: affine-data
 | 
				
			||||||
 | 
					        persistentVolumeClaim:
 | 
				
			||||||
 | 
					          claimName: affine-data
 | 
				
			||||||
 | 
					      - name: affine-config
 | 
				
			||||||
 | 
					        persistentVolumeClaim:
 | 
				
			||||||
 | 
					          claimName: affine-config
 | 
				
			||||||
							
								
								
									
										15
									
								
								apps/affine/ingress.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								apps/affine/ingress.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					apiVersion: traefik.io/v1alpha1
 | 
				
			||||||
 | 
					kind: IngressRoute
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: affine-ingress
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  entryPoints:
 | 
				
			||||||
 | 
					    - websecure
 | 
				
			||||||
 | 
					  routes:
 | 
				
			||||||
 | 
					    - match: Host(`affine.kluster.moll.re`)
 | 
				
			||||||
 | 
					      kind: Rule
 | 
				
			||||||
 | 
					      services:
 | 
				
			||||||
 | 
					        - name: affine-web
 | 
				
			||||||
 | 
					          port: 3010
 | 
				
			||||||
 | 
					  tls:
 | 
				
			||||||
 | 
					    certResolver: default-tls
 | 
				
			||||||
							
								
								
									
										20
									
								
								apps/affine/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								apps/affine/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					apiVersion: kustomize.config.k8s.io/v1beta1
 | 
				
			||||||
 | 
					kind: Kustomization
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace: affine
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					resources:
 | 
				
			||||||
 | 
					  - namespace.yaml
 | 
				
			||||||
 | 
					  - deployment.yaml
 | 
				
			||||||
 | 
					  - service.yaml
 | 
				
			||||||
 | 
					  - ingress.yaml
 | 
				
			||||||
 | 
					  - postgres.yaml
 | 
				
			||||||
 | 
					  - pvc.yaml
 | 
				
			||||||
 | 
					  - postgres-credentials.secret.yaml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					images:
 | 
				
			||||||
 | 
					  - name: affine
 | 
				
			||||||
 | 
					    newName: ghcr.io/toeverything/affine-graphql
 | 
				
			||||||
 | 
					    newTag: stable
 | 
				
			||||||
							
								
								
									
										4
									
								
								apps/affine/namespace.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								apps/affine/namespace.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					apiVersion: v1
 | 
				
			||||||
 | 
					kind: Namespace
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: placeholder
 | 
				
			||||||
							
								
								
									
										20
									
								
								apps/affine/postgres.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								apps/affine/postgres.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					apiVersion: postgresql.cnpg.io/v1
 | 
				
			||||||
 | 
					kind: Cluster
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: affine-postgres
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  instances: 1
 | 
				
			||||||
 | 
					  bootstrap:
 | 
				
			||||||
 | 
					    initdb:
 | 
				
			||||||
 | 
					      owner: affine
 | 
				
			||||||
 | 
					      database: affine
 | 
				
			||||||
 | 
					      secret:
 | 
				
			||||||
 | 
					        name: postgres-credentials
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  storage:
 | 
				
			||||||
 | 
					    size: 1Gi
 | 
				
			||||||
 | 
					    pvcTemplate:
 | 
				
			||||||
 | 
					      storageClassName: "nfs-client"
 | 
				
			||||||
 | 
					      resources:
 | 
				
			||||||
 | 
					        requests:
 | 
				
			||||||
 | 
					          storage: "1Gi"
 | 
				
			||||||
							
								
								
									
										23
									
								
								apps/affine/pvc.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								apps/affine/pvc.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
				
			|||||||
 | 
					kind: PersistentVolumeClaim
 | 
				
			||||||
 | 
					apiVersion: v1
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: affine-data
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  storageClassName: "nfs-client"
 | 
				
			||||||
 | 
					  accessModes:
 | 
				
			||||||
 | 
					    - ReadWriteOnce
 | 
				
			||||||
 | 
					  resources:
 | 
				
			||||||
 | 
					    requests:
 | 
				
			||||||
 | 
					      storage: 15Gi
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					kind: PersistentVolumeClaim
 | 
				
			||||||
 | 
					apiVersion: v1
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: affine-config
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  storageClassName: "nfs-client"
 | 
				
			||||||
 | 
					  accessModes:
 | 
				
			||||||
 | 
					    - ReadWriteOnce
 | 
				
			||||||
 | 
					  resources:
 | 
				
			||||||
 | 
					    requests:
 | 
				
			||||||
 | 
					      storage: 1Gi
 | 
				
			||||||
							
								
								
									
										10
									
								
								apps/affine/service.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								apps/affine/service.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					apiVersion: v1
 | 
				
			||||||
 | 
					kind: Service
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: affine-web
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  selector:
 | 
				
			||||||
 | 
					    app: affine
 | 
				
			||||||
 | 
					  ports:
 | 
				
			||||||
 | 
					  - port: 3010
 | 
				
			||||||
 | 
					    targetPort: 3010
 | 
				
			||||||
		Reference in New Issue
	
	Block a user