Production files created
This commit is contained in:
26
k8s/prod/deployment.yaml
Normal file
26
k8s/prod/deployment.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: flask-app
|
||||
namespace: production
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: flask-app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: flask-app
|
||||
spec:
|
||||
containers:
|
||||
- name: flask-app
|
||||
image: registry.gitlab.com/YOUR-GROUP/YOUR-PROJECT:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
env:
|
||||
- name: FLASK_ENV
|
||||
value: production
|
||||
- name: DATABASE_URL
|
||||
value: postgresql://postgres:password@postgres-service:5432/appdb
|
||||
4
k8s/prod/namespace.yaml
Normal file
4
k8s/prod/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: production
|
||||
13
k8s/prod/service.yaml
Normal file
13
k8s/prod/service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: flask-service
|
||||
namespace: production
|
||||
spec:
|
||||
selector:
|
||||
app: flask-app
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 5000
|
||||
type: ClusterIP
|
||||
Reference in New Issue
Block a user