-
Notifications
You must be signed in to change notification settings - Fork 21
Serverless & FaaS 실습
kimsanghoon1 edited this page Dec 31, 2018
·
4 revisions
> kubectl label namespace default istio-injection=enabled
> kubectl apply --filename https://github.com/knative/serving/releases/download/v0.2.2/release.yaml
> kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value core/account)
> kubectl apply --filename https://github.com/knative/serving/releases/download/v0.2.2/istio.yaml
> kubectl get pods --namespace knative-serving
> kubectl get pods --namespace knative-build
> nano service.yaml
apiVersion: serving.knative.dev/v1alpha1 # Current version of Knative
kind: Service
metadata:
name: helloworld-go # The name of the app
namespace: default # The namespace the app will use
spec:
runLatest:
configuration:
revisionTemplate:
spec:
container:
image: gcr.io/knative-samples/helloworld-go # The URL to the image of the app
env:
- name: TARGET # The environment variable printed out by the sample app
value: "Go Sample v1"
> kubectl create -f service.yaml
> kubectl get svc knative-ingressgateway --namespace istio-system # ingress 접속 정보 얻기
> kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
> curl -H "Host: helloworld-go.default.example.com" http://${IP_ADDRESS}
Hello World: Go Sample v1!
> kubectl get virtualservice helloworld-go-clphn -o yaml -n knative-serving