
visual studio 확장 프로그램에서 Google Cloud Code를 설치한다.
그러면 위와 같이 구글 클라우드 코드를 클릭하여 Debug on Kubernetes를 선택하여 실행시키면 yaml파일이 업데이트 될 때마다 자동으로 배포가 된다.
Skaffold를 사용해서 빌드와 배포를 자동화할 수 있다.
C:\k8s-example> skaffold run
apiVersion: skaffold/v4beta11
kind: Config
metadata:
name: counter
build:
artifacts:
- image: web
docker:
dockerfile: dockerfile
manifests:
rawYaml:
- web-deployment.yaml
- redis-deployment.yaml
ingress를 localhost로 터널링한다.
C:\k8s-example> minikube tunnel
브라우저나 curl로 확인한다.
C:\k8s-example> curl localhost/inc
1
C:\k8s-example> curl localhost/inc
2
C:\k8s-example> curl localhost/inc
3
C:\k8s-example> curl localhost
3
C:\k8s-example> curl localhost/inc
3