Skip to content
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
81 changes: 81 additions & 0 deletions kubernetes/01-hello-world-rest-api/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
autopilot.gke.io/resource-adjustment: '{"input":{"containers":[{"name":"hello-world-rest-api"}]},"output":{"containers":[{"limits":{"ephemeral-storage":"1Gi"},"requests":{"cpu":"500m","ephemeral-storage":"1Gi","memory":"2Gi"},"name":"hello-world-rest-api"}]},"computeClassAtAdmission":"Default","modified":true}'
autopilot.gke.io/warden-version: 33.33.19-gke.1
deployment.kubernetes.io/revision: "5"
creationTimestamp: "2025-10-16T02:55:03Z"
generation: 6
labels:
app: hello-world-rest-api
name: hello-world-rest-api
namespace: default
resourceVersion: "1761451092369951013"
uid: 9fedc012-0f0f-4ee7-a3ba-52ec78bb91b7
spec:
progressDeadlineSeconds: 600
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
app: hello-world-rest-api
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: hello-world-rest-api
spec:
containers:
- image: in28min/hello-world-rest-api:0.0.1.RELEASE
imagePullPolicy: IfNotPresent
name: hello-world-rest-api
resources:
limits:
ephemeral-storage: 1Gi
requests:
cpu: 500m
ephemeral-storage: 1Gi
memory: 2Gi
securityContext:
capabilities:
drop:
- NET_RAW
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext:
seccompProfile:
type: RuntimeDefault
terminationGracePeriodSeconds: 30
tolerations:
- effect: NoSchedule
key: kubernetes.io/arch
operator: Equal
value: amd64
status:
availableReplicas: 2
conditions:
- lastTransitionTime: "2025-10-16T03:33:53Z"
lastUpdateTime: "2025-10-16T03:33:53Z"
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
- lastTransitionTime: "2025-10-16T02:55:03Z"
lastUpdateTime: "2025-10-26T03:58:12Z"
message: ReplicaSet "hello-world-rest-api-fd687cfd4" has successfully progressed.
reason: NewReplicaSetAvailable
status: "True"
type: Progressing
observedGeneration: 6
readyReplicas: 2
replicas: 2
updatedReplicas: 2
39 changes: 39 additions & 0 deletions kubernetes/01-hello-world-rest-api/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: v1
kind: Service
metadata:
annotations:
cloud.google.com/neg: '{"ingress":true}'
creationTimestamp: "2025-10-15T03:36:26Z"
finalizers:
- service.kubernetes.io/load-balancer-cleanup
- gke.networking.io/l4-netlb-v1
labels:
app: hello-world-rest-api
name: hello-world-rest-api
namespace: default
resourceVersion: "1760499574672943007"
uid: e95a4165-4017-49bb-94fa-3f5b9bb045c9
spec:
allocateLoadBalancerNodePorts: true
clusterIP: 34.118.228.162
clusterIPs:
- 34.118.228.162
externalTrafficPolicy: Cluster
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- nodePort: 32676
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: hello-world-rest-api
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer:
ingress:
- ip: 34.60.229.1
ipMode: VIP
3 changes: 2 additions & 1 deletion projects/hello-world/hello-world-nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM node:8.16.1-alpine
WORKDIR /app
COPY . /app
COPY package.json /app
RUN npm install
EXPOSE 5000
COPY . /app
CMD node index.js

#ENTRYPOINT ["node", "index.js"]
Expand Down
2 changes: 1 addition & 1 deletion projects/hello-world/hello-world-nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const process = require('process');

var expressapp = express()
expressapp.get('/', function (req, res) {
res.send('{"message":"Hello World JavaScript v1"}')
res.send('{"message":"Hello World JavaScript v3"}')
})
expressapp.listen(5000, function () {
console.log('Ready on port 5000!')
Expand Down
2 changes: 2 additions & 0 deletions projects/hello-world/hello-world-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ CMD python ./launch.py

#COPY requirements.txt /app/requirements.txt
#ENTRYPOINT ["python", "./launch.py"]


2 changes: 1 addition & 1 deletion projects/hello-world/hello-world-python/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
helloworld = Flask(__name__)
@helloworld.route("/")
def run():
return "{\"message\":\"Hello World Python v1\"}"
return "{\"message\":\"Hello World Python v3\"}"
if __name__ == "__main__":
helloworld.run(host="0.0.0.0", port=int("5000"), debug=True)