# Unity Catalog 배포 ## 1. 배포 방법 - 배포 방법 ``` sh $ helm upgrade unitycatalog ../unitycatalog --install \ -n unitycatalog --create-namespace \ -f ./custom-values.yaml ``` ## 2. custom-values.yaml 설명 - custom-values.yaml에 정의된 값에 대한 설명이다. ### 1) 이미지 설정 - private 환경 배포 시에만 변경하여 사용한다. | Name | 설명 | 기본값 | | ---------------------- | ------------------------------------------------------------ | ------ | | `server.statefulset.image.repository` | 오프라인 설치 시에 설정 변경 필요. | `"paasup/unitycatalog"` | | `server.statefulset.image.repository` | 이미지의 태그 설정. | `"0.3.0-minio-2"` | ### 2) server의 pod 설정 - unity catalog server의 tolerations, nodeSelector, affinity, 리소스를 설정한다. | Name | 설명 | 기본값 | | ------------------------ | ---------------------------------- | --------- | | `server.statefulset.tolerations` | server pod의 toleration 설정. | `[]` | | `server.statefulset.nodeSelector` | server pod의 nodeSelector 설정. | `{}` | | `server.statefulset.affinity` | server pod의 affinity 설정. | `{}` | | `server.statefulset.resources` | server pod의 기본 resource 설정.| `{}` | ### 3) Storage 설정 - Minio - s3 연동 시 접속 정보를 secret으로 생성해야 한다. minio 사용 시 접속 정보는 반드시 admin 권한이 있는 사용자의 id, password를 사용한다.(access key는 사용 불가) ``` sh $ kubectl create -n unitycatalog secret generic minio-secret \ --from-literal=accessKey={access key} \ --from-literal=secretKey={secret key} ``` - unity catalog에서 사용할 외부 storage의 목록을 정의한다. 아래 예시는 minio를 대상으로 할 때의 설정이다. ``` yaml storage: credentials: # S3 credentials for accessing the storage # Credential secret must contain the following keys - accessKey, secretKey. s3: - bucketPath: s3://test region: us-east-1 # minio에서는 빈칸으로 설정한다. awsRoleArn: serviceEndpoint: https://minio.example.org # Client secret must contain the following keys - accessKey, secretKey. credentialsSecretName: minio-secret ``` ### 3) Keycloak SSO 설정 - keycloak 연동 시 접속 정보를 secret으로 생성해야 한다. ``` sh $ kubectl create -n unitycatalog secret generic uc-sso-secret \ --from-literal=clientId={keycloak client id} \ --from-literal=clientSecret={keycloak client credential} ``` - 미리 생성할 사용자의 이름과 이메일 정보를 `auth.users`에 작성한다. 그 후 keycloak의 oidc 인증 url과 위에서 생성한 client 정보가 담긴 secret을 작성한다. ``` yaml auth: enabled: false # List of users to be created in the system. Each user must contain the following keys - name, email. users: - name: admin email: paasup@paasup.io provider: keycloak authorizationUrl: https://keycloak.example.org/auth/realms/paasup/protocol/openid-connect/auth # Client secret must contain the following keys - clientId, clientSecret. clientSecretName: uc-sso-secret ``` ### 5) 사설 인증서 등록 - keycloak, minio 등의 서비스가 사설 인증서를 사용한다면 unity catalog 서버에 허용 설정이 필요하다. 해당 설정을 위하여 `privateCA.enabeld: true` 설정 후에 인증서는 secret으로 추가하여 등록한다. - CA 인증서가 클러스터에 `cert-manager`로 관리된다면 다음과 같이 unity catalog의 ingress에서 설정한 secret을 사용할 수 있다. ``` yaml privateCA: enabled: true secretName: "unitycatalog-tls" ``` ### 6) Ingress 설정 #### 6.1) tls 시크릿 직접 생성 - Rancher에서 ingress 사용을 위해서는 다음과 같이 설정할 수 있다. ``` yaml server: ingress: enabled: true hosts: - host: unitycatalog.example.org paths: - path: / pathType: ImplementationSpecific tls: - hosts: - unitycatalog.example.org secretName: unitycatalog-tls ``` - ingress 사용을 위해서는 인증서를 secret으로 제공해야한다. 로컬 파일을 이용해 secret을 생성하는 방법은 다음과 같다. ``` sh kubectl create secret tls unitycatalog-tls-secret --cert= --key= -n ``` #### 6.2) cert-manager를 이용한 자동 생성 - cert manager를 통해 인증서 자동 생성 시 `custom-values.yaml` 수정한다. - `ingress.annotations.cert-manager.io/cluster-issuer`에 미리 배포된 Cluster Issuer의 이름으로 변경한다. ``` yaml server: ingress: enabled: true className: kong annotations: cert-manager.io/cluster-issuer: root-ca-issuer konghq.com/https-redirect-status-code: '301' konghq.com/protocols: https hosts: - host: unitycatalog.example.org paths: - path: / pathType: ImplementationSpecific tls: - hosts: - unitycatalog.example.org secretName: unitycatalog-tls ``` ### 7) postgresql - subchart로 포함된 postgresql을 배포하기 위한 설정이다. - db 정보 변경 시 `db.postgresqlConfig`와 `postgresql.auth`를 동일하게 변경해야 한다. ``` yaml db: type: postgresql postgresqlConfig: user: uc_default_user password: uc_default_password database: ucdb postgresql: enabled: true auth: username: "uc_default_user" password: "uc_default_password" database: "ucdb" persistence: enabled: true accessModes: - ReadWriteOnce size: 5Gi storageClassName: "" ```