This repository was archived by the owner on Dec 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathdeployment_django.yaml
61 lines (61 loc) · 1.8 KB
/
deployment_django.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
apiVersion: apps/v1
kind: Deployment
metadata:
name: django-deployment
labels:
app: django
spec:
# Number of pods in the deployment's replica set
replicas: 2
selector:
matchLabels:
app: django
template:
metadata:
labels:
app: django
spec:
containers:
- name: django
# Notice the tag is also included in the image
image: kubetotorial101/pollproject:de14993
ports:
- containerPort: 8000
# Minimum and maximum resources allocated to the container.
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "400m"
# Add envconfigmap configmap variables to the environment
envFrom:
- configMapRef:
name: postgres-config
env:
# POSTGRES_PASSWORD are defined in a secret called "db-password".
# These hold the database access information that is injected as environment variables
# into the django pod
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: db-password
key: db-password
# The AWS credentials are needed for Django to put static files into an S3 bucket for the
# production deployment. Used by django-storages
- name: AWS_STORAGE_BUCKET_NAME
valueFrom:
secretKeyRef:
name: s3-secrets
key: s3bucket
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: s3-secrets
key: s3accesskey
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: s3-secrets
key: s3secretkey