From 6fc7c3b093eb093a858baec5cb58e50b536c8ec3 Mon Sep 17 00:00:00 2001 From: SeoJimin1234 <113419021+SeoJimin1234@users.noreply.github.com> Date: Sat, 3 Aug 2024 10:05:39 +0900 Subject: [PATCH] feat: seojimin make container image (#63) Signed-off-by: SeoJimin --- SeoJimin1234/Dockerfile | 10 ++++++++++ SeoJimin1234/app.py | 14 ++++++++++++++ SeoJimin1234/charts/Chart.yaml | 4 ++++ SeoJimin1234/charts/templates/deployment.yaml | 19 +++++++++++++++++++ SeoJimin1234/charts/templates/service.yaml | 12 ++++++++++++ SeoJimin1234/charts/values.yaml | 2 ++ SeoJimin1234/requirements.txt | 2 ++ 7 files changed, 63 insertions(+) create mode 100644 SeoJimin1234/Dockerfile create mode 100644 SeoJimin1234/app.py create mode 100644 SeoJimin1234/charts/Chart.yaml create mode 100644 SeoJimin1234/charts/templates/deployment.yaml create mode 100644 SeoJimin1234/charts/templates/service.yaml create mode 100644 SeoJimin1234/charts/values.yaml create mode 100644 SeoJimin1234/requirements.txt diff --git a/SeoJimin1234/Dockerfile b/SeoJimin1234/Dockerfile new file mode 100644 index 0000000..94305a1 --- /dev/null +++ b/SeoJimin1234/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.9-slim + +WORKDIR /app + +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt + +COPY . . + +CMD ["python", "app.py"] diff --git a/SeoJimin1234/app.py b/SeoJimin1234/app.py new file mode 100644 index 0000000..c1a359f --- /dev/null +++ b/SeoJimin1234/app.py @@ -0,0 +1,14 @@ +from flask import Flask + +app = Flask(__name__) + +@app.route('/api/v1/SeoJimin1234') +def my_github_account(): + return {"message": "This is SeoJimin1234"} + +@app.route('/healthcheck') +def health_check(): + return {"status": "Jimin is very healthy"} + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=8080) \ No newline at end of file diff --git a/SeoJimin1234/charts/Chart.yaml b/SeoJimin1234/charts/Chart.yaml new file mode 100644 index 0000000..3b8cd6c --- /dev/null +++ b/SeoJimin1234/charts/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v2 +name: seojimin-week-two +description: A Helm chart for week two assignment +version: 0.1.0 diff --git a/SeoJimin1234/charts/templates/deployment.yaml b/SeoJimin1234/charts/templates/deployment.yaml new file mode 100644 index 0000000..654b609 --- /dev/null +++ b/SeoJimin1234/charts/templates/deployment.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: seojimin-week-two +spec: + replicas: 1 + selector: + matchLabels: + app: seojimin-week-two + template: + metadata: + labels: + app: seojimin-week-two + spec: + containers: + - name: seojimin-week-two + image: "{{ .Values.image.name }}" + ports: + - containerPort: 8080 diff --git a/SeoJimin1234/charts/templates/service.yaml b/SeoJimin1234/charts/templates/service.yaml new file mode 100644 index 0000000..e9e2f68 --- /dev/null +++ b/SeoJimin1234/charts/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: seojimin-week-two +spec: + type: NodePort + ports: + - port: 8080 + targetPort: 8080 + nodePort: 30080 + selector: + app: seojimin-week-two diff --git a/SeoJimin1234/charts/values.yaml b/SeoJimin1234/charts/values.yaml new file mode 100644 index 0000000..3fa7445 --- /dev/null +++ b/SeoJimin1234/charts/values.yaml @@ -0,0 +1,2 @@ +image: + name: SeoJimin1234/seojimin-week-two:latest diff --git a/SeoJimin1234/requirements.txt b/SeoJimin1234/requirements.txt new file mode 100644 index 0000000..11f8c2a --- /dev/null +++ b/SeoJimin1234/requirements.txt @@ -0,0 +1,2 @@ +Flask==2.2.5 +Werkzeug==2.2.3 \ No newline at end of file