Skip to content

Commit 7d50f22

Browse files
committed
Update readme with an example build and deploy
1 parent e1d8664 commit 7d50f22

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

README.md

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,80 @@ Note that the below requirements are only required to run the examples defined i
1818

1919
All examples will use `docker` for containerization. Most application templating will be done using `helm` and deployments will use `krane` for easy to understand live results.
2020

21-
## Examples
21+
## Example build and deploy
2222

2323
```
24+
❯ make build python-echo-server
25+
build with subcommand: python-echo-server
26+
/Library/Developer/CommandLineTools/usr/bin/make build-python-echo-server
27+
Running build for python-echo-server...
2428
29+
./scripts/build_image.sh applications/python-echo-server
30+
[+] Building 0.9s (13/13) FINISHED docker:desktop-linux
31+
=> [internal] load build definition from Dockerfile 0.0s
32+
=> => transferring dockerfile: 1.39kB 0.0s
33+
=> resolve image config for docker-image://docker.io/docker/dockerfile:1 0.5s
34+
=> CACHED docker-image://docker.io/docker/dockerfile:1@sha256:a57df69d0ea827fb7266491f2813635de6f17269be881f696fbfdf2d83dda33e 0.0s
35+
=> [internal] load metadata for docker.io/library/python:3.12.4-slim 0.3s
36+
=> [internal] load .dockerignore 0.0s
37+
=> => transferring context: 671B 0.0s
38+
=> [base 1/6] FROM docker.io/library/python:3.12.4-slim@sha256:2fba8e70a87bcc9f6edd20dda0a1d4adb32046d2acbca7361bc61da5a106a914 0.0s
39+
=> [internal] load build context 0.0s
40+
=> => transferring context: 218B 0.0s
41+
=> CACHED [base 2/6] WORKDIR /app 0.0s
42+
=> CACHED [base 3/6] RUN adduser --disabled-password --gecos "" --home "/nonexistent" --shell "/sbin/nologin" --no-create-home --uid "10 0.0s
43+
=> CACHED [base 4/6] RUN --mount=type=cache,target=/root/.cache/pip --mount=type=bind,source=requirements.txt,target=requirements.txt python -m pip inst 0.0s
44+
=> CACHED [base 5/6] COPY . . 0.0s
45+
=> CACHED [base 6/6] RUN chmod +x /app/main.py 0.0s
46+
=> exporting to image 0.0s
47+
=> => exporting layers 0.0s
48+
=> => writing image sha256:4d8a5727c4a92772802c8f52bb8e9df052fd81e5dc790545c223894fb0a46b48 0.0s
49+
=> => naming to docker.io/library/python-echo-server:v1.0 0.0s
50+
=> => naming to docker.io/library/python-echo-server:latest 0.0s
51+
52+
What's next:
53+
View a summary of image vulnerabilities and recommendations → docker scout quickview
54+
55+
❯ make deploy python-echo-server
56+
deploy with subcommand: python-echo-server
57+
/Library/Developer/CommandLineTools/usr/bin/make deploy-python-echo-server
58+
Running deploy for python-echo-server...
59+
60+
./scripts/deploy.sh -n python-echo-server -d applications/python-echo-server/deploy
61+
[INFO][2024-06-19 21:57:04 -0400]
62+
[INFO][2024-06-19 21:57:04 -0400] ------------------------------------Phase 1: Initializing deploy------------------------------------
63+
[INFO][2024-06-19 21:57:05 -0400] All required parameters and files are present
64+
[INFO][2024-06-19 21:57:05 -0400] Discovering resources:
65+
[INFO][2024-06-19 21:57:05 -0400] - Deployment/python-echo-server
66+
[INFO][2024-06-19 21:57:05 -0400] - Service/python-echo-server-svc
67+
[INFO][2024-06-19 21:57:05 -0400]
68+
[INFO][2024-06-19 21:57:05 -0400] ----------------------------Phase 2: Checking initial resource statuses-----------------------------
69+
[INFO][2024-06-19 21:57:06 -0400] Deployment/python-echo-server 1 replica, 1 updatedReplica, 1 availableReplica
70+
[INFO][2024-06-19 21:57:06 -0400] Service/python-echo-server-svc Selects at least 1 pod
71+
[INFO][2024-06-19 21:57:06 -0400]
72+
[INFO][2024-06-19 21:57:06 -0400] ----------------------------------Phase 3: Deploying all resources----------------------------------
73+
[INFO][2024-06-19 21:57:06 -0400] Deploying resources:
74+
[INFO][2024-06-19 21:57:06 -0400] - Deployment/python-echo-server (progress deadline: 600s)
75+
[INFO][2024-06-19 21:57:06 -0400] - Service/python-echo-server-svc (timeout: 420s)
76+
[INFO][2024-06-19 21:57:10 -0400] Successfully deployed in 3.6s: Deployment/python-echo-server, Service/python-echo-server-svc
77+
[INFO][2024-06-19 21:57:10 -0400]
78+
[INFO][2024-06-19 21:57:10 -0400] ------------------------------------------Result: SUCCESS-------------------------------------------
79+
[INFO][2024-06-19 21:57:10 -0400] Successfully deployed 2 resources
80+
[INFO][2024-06-19 21:57:10 -0400]
81+
[INFO][2024-06-19 21:57:10 -0400] Successful resources
82+
[INFO][2024-06-19 21:57:10 -0400] Deployment/python-echo-server 1 replica, 1 updatedReplica, 1 availableReplica
83+
[INFO][2024-06-19 21:57:10 -0400] Service/python-echo-server-svc Selects at least 1 pod
84+
85+
❯ kcl --context minikube -n python-echo-server get all
86+
NAME READY STATUS RESTARTS AGE
87+
pod/python-echo-server-d84844957-zl2wb 1/1 Running 0 3h24m
88+
89+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
90+
service/python-echo-server-svc NodePort 10.107.121.68 <none> 80:31016/TCP 3h24m
91+
92+
NAME READY UP-TO-DATE AVAILABLE AGE
93+
deployment.apps/python-echo-server 1/1 1 1 3h24m
94+
95+
NAME DESIRED CURRENT READY AGE
96+
replicaset.apps/python-echo-server-d84844957 1 1 1 3h24m
2597
```

0 commit comments

Comments
 (0)