Last active
November 25, 2025 20:09
-
-
Save r3xakead0/1d700edf42bf9a65bdea2e52a9407a8a to your computer and use it in GitHub Desktop.
Hello World deployed in GKE Cluster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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