Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution #37

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .infrastructure/configMap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
namespace: todoapp
data:
PYTHONUNBUFFERED: 1
5 changes: 4 additions & 1 deletion .infrastructure/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ spec:
cpu: "150m"
env:
- name: PYTHONUNBUFFERED
value: "1"
valueFrom:
configMapKeyRef:
name: app-config
key: PYTHONUNBUFFERED
ports:
- containerPort: 8080
livenessProbe:
Expand Down
8 changes: 8 additions & 0 deletions .infrastructure/secret.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: app-secrets
namespace: todoapp
type: Opaque
data:
SECRET_KEY: NS4y
17 changes: 17 additions & 0 deletions INSTRUCTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## How to apply all the changes

``

kubectl apply -f configMap.yml
kubectl apply -f app-secret.yml
kubectl apply -f deployment.yml

``

## How to validate the changes

``

kubectl get secret app-secrets -o jsonpath='{.data.kubectl get secret app-secrets -o jsonpath='{.data.SECRET_KEY}'}'

``
2 changes: 1 addition & 1 deletion src/todolist/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "@e2(yx)v&tgh3_s=0yja-i!dpebxsz^dg47x)-k&kq_3zf*9e*"
SECRET_KEY = os.environ['SECRET_KEY']

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DEBUG setting is currently set to True. This should be set to False in production to avoid exposing sensitive information.

Expand Down