Skip to main content

Knative


설치

helm show values knative-operator-0.1.0.tgz \
> knative-operator-values.yaml
helm template knative-operator knative-operator-0.1.0.tgz \
-n knative \
-f knative-operator-values.yaml \
> knative-operator.yaml
helm upgrade knative-operator knative-operator-0.1.0.tgz \
--install \
--history-max 5 \
-n knative \
-f knative-operator-values.yaml

KnativeServing

apiVersion: operator.knative.dev/v1beta1
kind: KnativeServing
metadata:
name: <name>
namespace: <namespace>
spec:
# Optional, 설정하지 않으면 최신 버전이 설정됩니다
version: "1.9.0"
# Optional
ingress:
istio:
enabled: true
# Optional
# Gateway: knative-ingress-gateway
knative-ingress-gateway:
# Optional
# istiod의 기본 설정은 namespace 전체에서 찾습니다
selector:
<key>: <value>
# Optional
# Gateway: knative-local-gateway
# knative-local-gateway:
config:
# ConfigMap: config-defaults
# defaults: {}
# ConfigMap: config-istio
istio:
# Optional
gateway.<namespace>.knative-ingress-gateway: <ingressGatewayServiceHost>
gateway.<ingressGatewayNamespace>.<ingressGatewayName>: <ingressGatewayServiceHost>
# Optional
local-gateway.<namespace>.knative-local-gateway: <ingressGatewayServiceHost>
local-gateway.<localGatewayNamespace>.<localGatewayName>: <ingressGatewayServiceHost>
# ConfigMap: config-features
# features: {}
# ConfigMap: config-autoscaler
# autoscaler: {}

Test

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: hello
spec:
template:
spec:
containers:
- image: gcr.io/knative-samples/helloworld-go
ports:
- containerPort: 8080
env:
- name: TARGET
value: "World"
curl -H "Host: hello.default" http://localhost:8081

KnativeEventing

apiVersion: operator.knative.dev/v1beta1
kind: KnativeEventing
metadata:
name: <name>
namespace: <namespace>