Skip to content

Commit 604a15b

Browse files
committed
phase 1 complete: dockerized app, k8s deploy, service, ci
1 parent 28d13f2 commit 604a15b

3 files changed

Lines changed: 25 additions & 15 deletions

File tree

β€Ž.gitignoreβ€Ž

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# local binaries
1+
# binaries
22
minikube-linux-amd64
33

4-
# python cache
4+
# python
55
__pycache__/
66
*.pyc
77

8-
# editor
9-
.vim/
8+
# env
9+
.env
10+
11+
# docker
12+
*.log
1013

β€Žapp/app.pyβ€Ž

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import time
12
import os
23

3-
def main():
4-
app_name = os.getenv("APP_NAME", "OMNIOPS")
4+
APP_NAME = os.getenv("APP_NAME", "OMNIOPS")
5+
ENV = os.getenv("ENV", "dev")
56

6-
print("Ganpati Bappa Morya πŸ™")
7-
print(f"{app_name} is running.")
8-
print("This app is a base for Docker, CI/CD and Kubernetes learning.")
7+
print(f"πŸš€ {APP_NAME} started")
8+
print(f"🌍 Environment: {ENV}")
99

10-
if __name__ == "__main__":
11-
main()
10+
while True:
11+
print(f"πŸ™ Ganpati Bappa Morya | {APP_NAME} alive in {ENV}")
12+
time.sleep(10)
1213

β€Žk8s/deployment.yamlβ€Ž

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ spec:
1313
app: omniops
1414
spec:
1515
containers:
16-
- name: omniops
17-
image: omniops-app:latest
18-
imagePullPolicy: IfNotPresent
19-
command: ["python3", "app.py"]
16+
- name: omniops-app
17+
image: karandeven/omniops-app:latest
18+
imagePullPolicy: Always
19+
env:
20+
- name: APP_NAME
21+
value: "OMNIOPS"
22+
- name: ENV
23+
value: "production"
24+
ports:
25+
- containerPort: 80
2026

0 commit comments

Comments
Β (0)