Skip to content

Instantly share code, notes, and snippets.

@r3xakead0
Last active November 25, 2025 20:09
Show Gist options
  • Select an option

  • Save r3xakead0/1d700edf42bf9a65bdea2e52a9407a8a to your computer and use it in GitHub Desktop.

Select an option

Save r3xakead0/1d700edf42bf9a65bdea2e52a9407a8a to your computer and use it in GitHub Desktop.
Hello World deployed in GKE Cluster
#!/bin/sh
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
kubectl apply -f ingress.yaml
kubectl get deployment
kubectl autoscale deployment helloworld-deployment \
--cpu-percent=60 \
--min=1 \
--max=3
kubectl get service
kubectl get ingress
curl http://<EXTERNAL-IP>
kubectl get pod
kubectl logs <POD_NAME>
apiVersion: apps/v1
kind: Deployment
metadata:
name: helloworld-deployment
labels:
app: helloworld
spec:
replicas: 3
selector:
matchLabels:
app: helloworld
template:
metadata:
labels:
app: helloworld
spec:
containers:
- name: helloworld
image: gcr.io/google-samples/hello-app:1.0
ports:
- containerPort: 8080
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: helloworld-ingress
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: helloworld-service
port:
number: 80
apiVersion: v1
kind: Service
metadata:
name: helloworld-service
spec:
selector:
app: helloworld
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment