본문 바로가기
Kubernetes/Management

Knative - Custom domain 변경

by 여행을 떠나자! 2021. 10. 6.

1. 개요

- Knative serving은 기본 도메인 값으로 'example.com'을 사용한다

   URL 형식: {Knative service name}.{Kubernetes namespace}.example.com

$ k get inferenceservices.serving.kubeflow.org -n yoosung-jeon
NAME                 URL                                              READY   DEFAULT TRAFFIC   CANARY TRAFFIC   AGE
bert-large           http://bert-large.yoosung-jeon.example.com       True    100                                5d15h
flowers-sample       http://flowers-sample.yoosung-jeon.example.com   True    90                10               4d16h
$

- Ref: https://knative.dev/docs/serving/using-a-custom-domain/

- 사전 작업

   변경할 domain을 DNS에 등록 신청해야 하며, 변경할 domain이 'kf-serv.acp.kt.co.kr'인 경우 '*.kf-serv.acp.kt.co.kr '와 같이 sub domain으로 신청해야 한다.

 

 

2. Custom domain 변경

- 설정 내용 확인

$ k describe cm config-domain -n knative-serving
Name:         config-domain
Namespace:    knative-serving
Labels:       app.kubernetes.io/component=knative-serving-install
              app.kubernetes.io/name=knative-serving-install
              kustomize.component=knative
              serving.knative.dev/release=v0.14.3
Annotations:  kubectl.kubernetes.io/last-applied-configuration:
                {"apiVersion":"v1","data":{"_example":"################################\n#                              #\n#    EXAMPLE CONFIGURATION     ...
 
Data
====
_example:
----
################################
#                              #
#    EXAMPLE CONFIGURATION     #
#                              #
################################
 
# This block is not actually functional configuration,
# but serves to illustrate the available configuration
# options and document them in a way that is accessible
# to users that `kubectl edit` this config map.
#
# These sample configuration options may be copied out of
# this example block and unindented to be in the data block
# to actually change the configuration.
 
# Default value for domain.
# Although it will match all routes, it is the least-specific rule so it
# will only be used if no other domain matches.
example.com: |
 
# These are example settings of domain.
# example.org will be used for routes having app=nonprofit.
example.org: |
  selector:
   app: nonprofit
 
# Routes having domain suffix of 'svc.cluster.local' will not be exposed
# through Ingress. You can define your own label selector to assign that
# domain suffix to your Route here, or you can set the label
#    "serving.knative.dev/visibility=cluster-local"
# to achieve the same effect.  This shows how to make routes having
# the label app=secret only exposed to the local cluster.
svc.cluster.local: |
  selector:
    app: secret
 
Events:  <none>
$

 

- Custom domain 변경

   신규로 사용할 domain(kf-serv.acp.kt.co.kr)으로 변경한다

$ kubectl apply -f - <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
  name: config-domain
  namespace: knative-serving
data:
  kf-serv.acp.kt.co.kr: ""
EOF

 

- Knative service 조회

$ k get inferenceservices.serving.kubeflow.org -n yoosung-jeon
NAME                 URL                                                       READY   DEFAULT TRAFFIC   CANARY TRAFFIC   AGE
bert-large           http://bert-large.yoosung-jeon.kf-serv.acp.kt.co.kr       True    100                                5d16h
flowers-sample       http://flowers-sample.yoosung-jeon.kf-serv.acp.kt.co.kr   True    100                                27m
$

 

 

 

'Kubernetes > Management' 카테고리의 다른 글

Knative - Autoscaling #1 (개념)  (0) 2021.10.09
istio - Access logs 설정  (0) 2021.10.08
Knative 이해  (0) 2021.10.05
K8s - No more than 110 pods per node  (0) 2021.10.02
K8s - Master node의 role이 '<none>' 일 때  (0) 2021.09.30

댓글