Skip to content

Instantly share code, notes, and snippets.

@wohugb
Last active December 13, 2022 08:49
Show Gist options
  • Save wohugb/66891e42414d33eba711f317f6c463a6 to your computer and use it in GitHub Desktop.
Save wohugb/66891e42414d33eba711f317f6c463a6 to your computer and use it in GitHub Desktop.
knative 配置
# 在Knative使用自定义域名
kubectl edit cm config-domain --namespace knative-serving
# https://help.aliyun.com/document_detail/127204.html
# 修改mydomain.com 为你的域名
apiVersion: v1
data:
mydomain.com: ""
kind: ConfigMap
[...]
# 添加自定义路由
# https://help.aliyun.com/document_detail/184836.html
# 修改 knative.aliyun.com/serving-ingress: 后面的域名
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: coffee-mydomain
annotations:
knative.aliyun.com/serving-ingress: cafe.mydomain.com/coffee
spec:
template:
spec:
containers:
- image: registry.cn-hangzhou.aliyuncs.com/knative-sample/helloworld-go:160e4dc8
# 配置HTTPS证书访问
# https://help.aliyun.com/document_detail/185307.html
# knative.k8s.alibabacloud/tls: "true"
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: helloworld
namespace: default
annotations:
knative.k8s.alibabacloud/tls: "true"
spec:
template:
spec:
containers:
- image: registry-vpc.cn-shenzhen.aliyuncs.com/knative-sample/helloworld-go:73fbdd56
env:
- name: TARGET
value: "Knative"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment