第一个 Serving 用例 Hello world
1. 创建一个名为 service.yaml 的文件,文件内容如下
service.yaml 的文件,文件内容如下apiVersion: serving.knative.dev/v1 # Current version of Knative
kind: Service
metadata:
name: helloworld-go # The name of the app
namespace: default # The namespace the app will use
spec:
template:
spec:
containers:
- image: gcr.io/knative-samples/helloworld-go # Reference to the image of the app
env:
- name: TARGET # The environment variable printed out by the sample app
value: "Go Sample v1"2. 执行以下脚本
kubectl apply --filename service.yamlkubectl get ksvc helloworld-goLast updated