Использование CLI для установки Trino в Kubernetes
Требования
Для развертывания Trino в Kubernetes с помощью CLI необходимы:
-
Кластер Kubernetes (версии 1.32 или более поздней) с настроенным доступом через
kubectl. -
CLI-утилита, извлеченная из offline-пакета.
-
Извлеченные и загруженные в ваш репозиторий образы:
-
hub.arenadata.io/adc-enterprise/trino-operator:<version>
-
hub.arenadata.io/adh-enterprise/trino-docker:<version>
Эти артефакты присутствуют в offline-пакете, который можно запросить у службы поддержки Arenadata.
-
-
Функционирующий ADH-кластер (версии 4.2.0 или более поздней) со следующими сервисами:
-
Core configuration
-
ADPG
-
Zookeeper
-
HDFS
-
YARN
-
Hive
Сервис Trino будет запущен вне кластера ADH — в подах Kubernetes (pod) и будет взаимодействовать с сервисами ADH по сети.
-
Настройки безопасности описаны ниже.
Если вы планируете интегрировать Trino с Ranger, вам необходим установленный и функционирующий кластер ADPS версии 2.0.0 или более поздней. Также вам необходимо создать сервис для Trino в Ranger.
На данном шаге описывается создание сервиса с помощью REST API Ranger. Вы также можете создать сервис в веб-интерфейсе Ranger.
-
Создайте конфигурацию сервиса в JSON-файле:
{ "isEnabled": true, "type": "trino", "name": "trino_k8s", (1) "displayName": "trino_k8s", "description": "Service for Kubernetes Trino", "configs": { "username": "trino", (2) "password": "bigdata", (3) "ranger.plugin.audit.filters": "[{'accessResult':'DENIED','isAudited':true},{'isAudited':false,'resources':{'queryid':{'values':['*']}},'accessTypes':['execute']},{'isAudited':false,'resources':{'trinouser':{'values':['{USER}']}},'accessTypes':['impersonate']}]", "jdbc.driverClassName": "org.apache.hive.jdbc.HiveDriver", "jdbc.url": "jdbc:trino://10.92.42.219" (4) } }1 Наименование сервиса Trino в Ranger. Данное имя должно быть уникальным. 2 Имя пользователя для сервиса. 3 Пароль для сервиса. 4 JDBC-строка подключения к Trino. Эндпойнт для подключения выставляется Ingress или балансировщиком нагрузки. -
Загрузите конфигурацию сервиса в Ranger:
$ curl -u admin:<admin_pwd> -H "Content-Type: application/json" -X POST -d @ranger-trino-k8s.json http://<ranger-admin>:6080/service/public/v2/api/service
-
Активируйте SSL для кластера ADH и ADPS, если планируете использовать SSL и Ranger.
-
Для доступа к веб-интерфейсу Trino и JDBC-соединений сгенерируйте сертификат для Ingress:
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout trino-cloud.ru-central1.internal.key -out trino-cloud.ru-central1.internal.crt -subj "/CN=trino-cloud.ru-central1.internal" -
Извлеките и загрузите образ оператора Kerberos в ваш репозиторий.
-
Инициализируйте оператор Kerberos:
$ ./adc operators init --kerberos -o operator-kerberos-init.yamlДанная команда создаст файл operator-kerberos-init.yaml с шаблоном конфигурации.
-
Отредактируйте конфигурационный файл:
kerberos: image: hub.arenadata.io/adc-enterprise/kerberos-operator:<tag> (1) # Number of replicas # replicas: 1 resources: limits: cpu: 500m memory: 256Mi # Operator service account. serviceAccount: (2) create: true name: kerberos-operator # Namespace to run the operator. # Operator's ServiceAccount, deployment and RBAC components will be installed in it. namespace: (3) create: true name: kerberos-operator # Create namespaces to run the payload. createPayloadNamespaces: true # List of namespaces to run the payload in. payloadNamespaces: (4) - trino ## Image pull secret for a private registry. ## Either set 'name' to reference an existing Secret, ## or set 'credentials' and the CLI will create a dockerconfigjson Secret. #imagePullSecret: # name: my-pull-secret # credentials: # registry: registry.example.com # username: user # password: pass kdc: (5) realm: RU-CENTRAL1.INTERNAL labelSelector: env: prod realms: RU-CENTRAL1.INTERNAL: |- kdc = tsn-freeipa.ru-central1.internal admin_server = tsn-freeipa.ru-central1.internal domainRealm: ru-central1.internal: RU-CENTRAL1.INTERNAL libdefaults: debug: "false" default_realm: RU-CENTRAL1.INTERNAL dns_lookup_kdc: "false" dns_lookup_realm: 'false' udp_preference_limit: '1' ldapSecret: (6) addr: ldaps://tsn-freeipa.ru-central1.internal:636 adminPW: AdhCloud! adminDN: uid=admin,cn=users,cn=accounts,dc=ru-central1,dc=internal baseDN: cn=services,cn=accounts,dc=ru-central1,dc=internal ca: (7) provider: freeipa1 URL образа оператора Kerberos в вашем репозитории. 2 Настройки сервисного аккаунта. 3 Настройки пространства имен. 4 Список пространств имен, доступных оператору Kerberos. 5 Настройки KDC. 6 Настройки LDAP. Если вы не используете SSL, замените протокол на ldapи порт на389.7 CA-сертификат, необходимый, если LDAP защищен SSL. -
Примените конфигурацию и разверните оператор Kerberos:
$ ./adc operators apply kerberos-operator -f operator-kerberos-init.yaml
Шаг 1. Установка оператора Trino
-
Инициализируйте оператор Trino:
$ ./adc operators init --trino -o operator-trino-init.yamlДанная команда создаст файл operator-trino-init.yaml с шаблоном конфигурации.
-
Отредактируйте конфигурационный файл:
operator-trino-init.yamltrino: image: hub.arenadata.io/adc-enterprise/trino-operator:<tag> (1) # Number of replicas # replicas: 1 resources: limits: cpu: 500m memory: 256Mi # Operator service account. serviceAccount: (2) create: true name: "trino" # Namespace to run the operator. # Operator's ServiceAccount, deployment and RBAC components will be installed in it. namespace: (3) create: true name: trino-operator # Create namespaces to run the payload. createPayloadNamespaces: true # List of namespaces to run the payload in. payloadNamespaces: (4) - trino ## Image pull secret for a private registry. ## Either set 'name' to reference an existing Secret, ## or set 'credentials' and the CLI will create a dockerconfigjson Secret. #imagePullSecret: # name: my-pull-secret # credentials: # registry: registry.example.com # username: user # password: pass1 URL образа оператора Trino в вашем репозитории. 2 Настройки сервисного аккаунта. 3 Настройки пространства имен. 4 Список пространств имен, доступных оператору Trino. -
Примените конфигурацию и разверните оператор Trino:
$ ./adc operators apply trino-operator -f operator-trino-init.yamlОжидаемый вывод содержит сообщение с подтверждением успеха:
time="20260518125157UTC" level="info" msg="operator trino-operator applied to namespace trino-operator"
-
Проверьте работоспособность подов оператора Trino:
$ kubectl get pods -n trino-operatorОжидаемый вывод должен быть похож на следующий:
NAME READY STATUS RESTARTS AGE trino-operator-trino-operator-6bf8788587-7s22r 1/1 Running 0 150m
Шаг 2. Установка кластера Trino
-
Подготовьте файл hadoop_conf.yaml с настройками Hadoop:
sites: core: fs.defaultFS: hdfs://adh hadoop.security.authentication: simple hdfs: dfs.client.failover.proxy.provider.adh: org.apache.hadoop.hdfs.server.namenode.ha.ObserverReadProxyProvider dfs.ha.namenodes.adh: nn_tsn-k8s-1,nn_tsn-k8s-3 dfs.namenode.rpc-address.adh.nn_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:8020 dfs.namenode.rpc-address.adh.nn_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:8020 dfs.nameservices: adh ozone: ozone.om.address.adh.om_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-2: tsn-k8s-2.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:9862 ozone.om.nodes.adh: om_tsn-k8s-1,om_tsn-k8s-1,om_tsn-k8s-1 ozone.om.service.ids: adhom hive: hive.metastore.sasl.enabled: false hive.metastore.uris: thrift://tsn-k8s-1.ru-central1.internal:9083 metastore.use.SSL: false -
Инициализируйте кластер Trino:
$ ./adc cluster init --product trino --hadoop-file hadoop_conf.yaml --output cluster-trino-init.yamlДанная команда создаст файл cluster-trino-init.yaml с шаблоном конфигурации.
-
Отредактируйте конфигурационный файл:
product: trino namespace: trino (1) image: (2) registry: hub.arenadata.io repository: adh-enterprise/trino-docker tag: <version> pullPolicy: Always ## Image pull secret for a private registry. ## Either set 'name' to reference an existing Secret, ## or set 'credentials' and the CLI will create a dockerconfigjson Secret. #imagePullSecret: # name: my-pull-secret # credentials: # registry: registry.example.com # username: user # password: pass trino: ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" coordinator: replicas: 1 ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" worker: replicas: 2 catalogs: iceberg.properties: connector.name: iceberg fs.hadoop.enabled: "True" hive.config.resources: /opt/trino-server/etc/catalog/core-site.xml hive.hdfs.authentication.type: NONE hive.hdfs.impersonation.enabled: "True" hive.metastore.authentication.type: NONE hive.metastore.thrift.impersonation.enabled: "True" hive.metastore.uri: thrift://tsn-k8s-1.ru-central1.internal:9083 hive.metastore.thrift.client.ssl.enabled: "False" ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" hadoop: (3) core: fs.defaultFS: hdfs://adh hadoop.proxyuser.trino.groups: '*' hadoop.proxyuser.trino.hosts: '*' hadoop.security.authentication: simple hdfs: dfs.client.failover.proxy.provider.adh: org.apache.hadoop.hdfs.server.namenode.ha.ObserverReadProxyProvider dfs.ha.namenodes.adh: nn_tsn-k8s-1,nn_tsn-k8s-3 dfs.namenode.rpc-address.adh.nn_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:8020 dfs.namenode.rpc-address.adh.nn_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:8020 dfs.nameservices: adh hive: hive.metastore.sasl.enabled: "false" hive.metastore.uris: thrift://tsn-k8s-1.ru-central1.internal:9083 metastore.use.SSL: "false" ozone: ozone.om.address.adh.om_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-2: tsn-k8s-2.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:9862 ozone.om.nodes.adh: om_tsn-k8s-1,om_tsn-k8s-2,om_tsn-k8s-3 ozone.om.service.ids: adhom1 Пространство имен, используемое кластером Trino. 2 Настройки для загрузки образа кластера Trino. 3 Настройки Hadoop, взятые из ранее созданного файла hadoop_conf.yaml.
-
Подготовьте файл hadoop_conf.yaml с настройками Hadoop:
sites: core: fs.defaultFS: hdfs://adh hadoop.security.authentication: simple hdfs: dfs.client.failover.proxy.provider.adh: org.apache.hadoop.hdfs.server.namenode.ha.ObserverReadProxyProvider dfs.ha.namenodes.adh: nn_tsn-k8s-1,nn_tsn-k8s-3 dfs.namenode.rpc-address.adh.nn_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:8020 dfs.namenode.rpc-address.adh.nn_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:8020 dfs.nameservices: adh ozone: ozone.om.address.adh.om_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-2: tsn-k8s-2.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:9862 ozone.om.nodes.adh: om_tsn-k8s-1,om_tsn-k8s-1,om_tsn-k8s-1 ozone.om.service.ids: adhom hive: hive.metastore.sasl.enabled: false hive.metastore.uris: thrift://tsn-k8s-1.ru-central1.internal:9083 metastore.use.SSL: false -
Инициализируйте кластер Trino:
$ ./adc cluster init --product trino --hadoop-file hadoop_conf.yaml --output cluster-trino-init.yamlДанная операция создаст файл cluster-trino-init.yaml с шаблоном конфигурации.
-
Отредактируйте конфигурационный файл:
product: trino namespace: trino (1) image: (2) registry: hub.arenadata.io repository: adh-enterprise/trino-docker tag: <version> pullPolicy: Always ## Image pull secret for a private registry. ## Either set 'name' to reference an existing Secret, ## or set 'credentials' and the CLI will create a dockerconfigjson Secret. #imagePullSecret: # name: my-pull-secret # credentials: # registry: registry.example.com # username: user # password: pass trino: ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" coordinator: replicas: 1 ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" worker: replicas: 2 ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" catalogs: iceberg.properties: connector.name: iceberg fs.hadoop.enabled: "True" hive.config.resources: /opt/trino-server/etc/catalog/core-site.xml hive.hdfs.authentication.type: NONE hive.hdfs.impersonation.enabled: "True" hive.metastore.authentication.type: NONE hive.metastore.thrift.impersonation.enabled: "True" hive.metastore.uri: thrift://tsn-k8s-1.ru-central1.internal:9083 hive.metastore.thrift.client.ssl.enabled: "False" ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" hadoop: (3) core: fs.defaultFS: hdfs://adh hadoop.proxyuser.trino.groups: '*' hadoop.proxyuser.trino.hosts: '*' hadoop.security.authentication: simple hdfs: dfs.client.failover.proxy.provider.adh: org.apache.hadoop.hdfs.server.namenode.ha.ObserverReadProxyProvider dfs.ha.namenodes.adh: nn_tsn-k8s-1,nn_tsn-k8s-3 dfs.namenode.rpc-address.adh.nn_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:8020 dfs.namenode.rpc-address.adh.nn_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:8020 dfs.nameservices: adh hive: hive.metastore.sasl.enabled: "false" hive.metastore.uris: thrift://tsn-k8s-1.ru-central1.internal:9083 metastore.use.SSL: "false" ozone: ozone.om.address.adh.om_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-2: tsn-k8s-2.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:9862 ozone.om.nodes.adh: om_tsn-k8s-1,om_tsn-k8s-2,om_tsn-k8s-3 ozone.om.service.ids: adhom ## Ranger plugin configuration. ## Uncomment and fill the lines below. cluster apply derives the rest. ranger: (4) security: ranger.plugin.trino.policy.rest.url: "<ranger-admin>:6080" ranger.plugin.trino.service.name: "trino_k8s" ranger.plugin.trino.use.rangerGroups: "True" ranger.plugin.trino.use.only.rangerGroups: "True" # fill xasecure.audit.destination.solr.zookeepers below with Zookeepers endpoints to resolve solr service, e.g. adps-adc.ru-central1.internal:2181/Arenadata.Hadoop-2.solr.server audit: xasecure.audit.destination.solr.zookeepers: "tsn-adps2-1.ru-central1.internal:2181/Arenadata.Hadoop-3.solr.server" # Local Ranger files consumed by the CLI during 'cluster apply'. # Paths are relative to the config file. The CLI reads these files # and writes them into the generated configs Secret. files: (5) jceksStorePath: ranger-trino.jceks1 Пространство имен, используемое кластером Trino. 2 Настройки для загрузки образа кластера Trino. 3 Настройки Hadoop, взятые из ранее созданного файла hadoop_conf.yaml. 4 Настройки Ranger. 5 JCEKS-файл, если Ranger используется вместе с SSL.
-
Подготовьте файл hadoop_conf.yaml с настройками Hadoop:
sites: core: fs.defaultFS: hdfs://adh hadoop.security.authentication: kerberos hdfs: dfs.client.failover.proxy.provider.adh: org.apache.hadoop.hdfs.server.namenode.ha.ObserverReadProxyProvider dfs.ha.namenodes.adh: nn_tsn-k8s-1,nn_tsn-k8s-3 dfs.namenode.rpc-address.adh.nn_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:8020 dfs.namenode.rpc-address.adh.nn_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:8020 dfs.nameservices: adh dfs.namenode.kerberos.principal: nn/_HOST@RU-CENTRAL1.INTERNAL dfs.journalnode.kerberos.principal: jn/_HOST@RU-CENTRAL1.INTERNAL dfs.datanode.kerberos.principal: dn/_HOST@RU-CENTRAL1.INTERNAL ozone: ozone.om.address.adh.om_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-2: tsn-k8s-2.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:9862 ozone.om.nodes.adh: om_tsn-k8s-1,om_tsn-k8s-1,om_tsn-k8s-1 ozone.om.kerberos.principal: om/_HOST@RU-CENTRAL1.INTERNAL ozone.om.service.ids: adhom hive: hive.metastore.sasl.enabled: true hive.metastore.uris: thrift://tsn-k8s-1.ru-central1.internal:9083 metastore.truststore.password: bigdata metastore.truststore.path: /etc/ssl/truststore.jks hive.metastore.kerberos.principal: hive/_HOST@RU-CENTRAL1.INTERNAL metastore.use.SSL: true -
Инициализируйте кластер Trino:
$ ./adc cluster init --product trino --hadoop-file hadoop_conf.yaml --output cluster-trino-init.yamlДанная операция создаст файл cluster-trino-init.yaml с шаблоном конфигурации.
-
Отредактируйте конфигурационный файл:
product: trino namespace: trino (1) image: (2) registry: hub.arenadata.io repository: adh-enterprise/trino-docker tag: <version> pullPolicy: Always ## Image pull secret for a private registry. ## Either set 'name' to reference an existing Secret, ## or set 'credentials' and the CLI will create a dockerconfigjson Secret. #imagePullSecret: # name: my-pull-secret # credentials: # registry: registry.example.com # username: user # password: pass trino: ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" coordinator: replicas: 1 ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" worker: replicas: 2 ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" catalogs: iceberg.properties: connector.name: iceberg fs.hadoop.enabled: "True" hive.config.resources: /opt/trino-server/etc/catalog/core-site.xml hive.hdfs.authentication.type: KERBEROS hive.hdfs.impersonation.enabled: "True" hive.hdfs.trino.keytab: /opt/trino-server/kerberos/keytab hive.metastore.authentication.type: KERBEROS hive.metastore.client.keytab: /opt/trino-server/kerberos/keytab hive.metastore.service.principal: hive/_HOST@RU-CENTRAL1.INTERNAL hive.metastore.thrift.client.ssl.trust-certificate: /etc/ssl/truststore.jks hive.metastore.thrift.client.ssl.trust-certificate-password: bigdata hive.metastore.thrift.impersonation.enabled: "True" hive.metastore.uri: thrift://tsn-k8s-1.ru-central1.internal:9083 hive.metastore.thrift.client.ssl.enabled: "True" ## Component arguments. Key-value pairs passed to the component configuration. #args: # redirect_stdout_stderr: "false" hadoop: (3) core: fs.defaultFS: hdfs://adh hadoop.proxyuser.trino.groups: '*' hadoop.proxyuser.trino.hosts: '*' hadoop.security.authentication: kerberos hdfs: dfs.client.failover.proxy.provider.adh: org.apache.hadoop.hdfs.server.namenode.ha.ObserverReadProxyProvider dfs.ha.namenodes.adh: nn_tsn-k8s-1,nn_tsn-k8s-3 dfs.namenode.rpc-address.adh.nn_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:8020 dfs.namenode.rpc-address.adh.nn_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:8020 dfs.nameservices: adh dfs.namenode.kerberos.principal: nn/_HOST@RU-CENTRAL1.INTERNAL dfs.journalnode.kerberos.principal: jn/_HOST@RU-CENTRAL1.INTERNAL dfs.datanode.kerberos.principal: dn/_HOST@RU-CENTRAL1.INTERNAL ozone: ozone.om.address.adh.om_tsn-k8s-1: tsn-k8s-1.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-2: tsn-k8s-2.ru-central1.internal:9862 ozone.om.address.adh.om_tsn-k8s-3: tsn-k8s-3.ru-central1.internal:9862 ozone.om.nodes.adh: om_tsn-k8s-1,om_tsn-k8s-1,om_tsn-k8s-1 ozone.om.kerberos.principal: om/_HOST@RU-CENTRAL1.INTERNAL ozone.om.service.ids: adhom hive: hive.metastore.sasl.enabled: "true" hive.metastore.uris: thrift://tsn-k8s-1.ru-central1.internal:9083 hive.metastore.kerberos.principal: hive/_HOST@RU-CENTRAL1.INTERNAL metastore.use.SSL: "true" ## Kerberos configuration for authentication. ## Set 'keytab.create: true' to let the operator create the keytab Secret, ## or set 'keytab.secretName' to reference an existing keytab Secret. kerberos: (4) realm: RU-CENTRAL1.INTERNAL service: trino hostname: trino-cloud.ru-central1.internal keytab: create: true secretName: kerberos-secret labelSelector: env: prod additionalPrincipals: - HTTP/trino-cloud.ru-central1.internal - trino/trino-cloud.ru-central1.internal rotation: interval: 24h checkInterval: 1h ## Java KeyStore/TrustStore certificate configuration. ## Either reference an existing Secret via secretName, ## or set files: to have the CLI create the Secret from local files. ssl: (5) secretName: ssl-secret trustStoreKey: truststore.jks # Local file paths consumed by the CLI during 'cluster apply'. # Paths are relative to the config file. The CLI reads these files # and creates or updates the Secret named by ssl.secretName. files: trustStorePath: /etc/ssl/truststore.jks1 Пространство имен, используемое кластером Trino. 2 Настройки для загрузки образа кластера Trino. 3 Настройки Hadoop, взятые из ранее созданного файла hadoop_conf.yaml. 4 Настройки Kerberos. 5 Настройки SSL.
После выполнения всех шагов в хотя бы одной из веток выше, завершите установку выполнением следующих шагов:
-
Примените конфигурацию и разверните кластер Trino:
$ ./adc cluster apply trino --file cluster-trino-init.yamlОжидаемый вывод содержит сообщение с подтверждением успеха:
time="20260518133858UTC" level="info" msg="cluster trino applied to namespace trino"
-
Проверьте работоспособность подов кластера Trino:
$ kubectl get pods -n trinoОжидаемый вывод должен быть похож на следующий:
trino-cluster-coordinator-0 1/1 Running 0 4m49s trino-cluster-worker-0 1/1 Running 0 4m49s trino-cluster-worker-1 1/1 Running 0 4m20s
Шаг 3. Предоставление доступа к Trino через JDBC
Для внешнего доступа к Trino по JDBC необходимо настроить один из способов публикации сервиса, например, используя балансировщик нагрузки (load balancer) или Ingress-контроллер.
Все настройки, связанные с публикацией сервиса, включая DNS, аннотации, параметры Ingress, правила балансировщика и прочие, должны быть указаны в соответствии с вашей инфраструктурой Kubernetes.
-
Получите внешний адрес балансировщика или Ingress-контроллера. Например:
trino-lb LoadBalancer 10.96.231.158 10.92.42.144 21050:32154/TCP,26000:30753/TCP,24000:32645/TCP 25h
-
Добавьте следующую строку в файл /etc/hosts:
<lb_ip> trino-cloud.ru-central1.internalгде
<lb_ip>— внешний IP-адрес балансировщика нагрузки. В данном примере это10.92.42.144. -
Подключитесь к кластеру Trino через JDBC, например, с помощью DBeaver. Строка подключения JDBC имеет следующий вид:
jdbc:trino://trino-cloud.ru-central1.internal/default
При использовании Kerberos и SSL добавьте в строку порт
443и следующие параметры:SSL=true&SSLTrustStorePath=<path>/truststore.jks&SSLTrustStorePassword=<password>&KerberosPrincipal=user&KerberosRemoteServiceName=HTTP&KerberosKeytabPath=<path>/user.keytab
где:
-
SSLTrustStorePath=<path>/truststore.jks— путь к truststore-файлу с сертификатами, который использует DBeaver. -
SSLTrustStorePassword=<password>— пароль для доступа к truststore-файлу. -
KerberosPrincipal=user— принципал Kerberos, используемый DBeaver для подключения. -
KerberosRemoteServiceName=HTTP— сервисное имя, используемое для подключения.
-
-
Установив подключение, выполните тестовую команду для проверки работоспособности кластера:
SHOW CATALOGS;Ожидаемый вывод:
Catalog | ----------+ iceberg | system |
Шаг 4. Предоставление доступа к веб-интерфейсу Trino
Для доступа к веб-интерфейсу Trino необходимо настроить один из способов публикации сервиса, например, используя балансировщик нагрузки (load balancer) или Ingress-контроллер. Все настройки, связанные с публикацией сервиса, включая DNS, аннотации, параметры Ingress, правила балансировщика и прочие, должны быть указаны в соответствии с вашей инфраструктурой Kubernetes.
-
Получите внешний адрес балансировщика или Ingress-контроллера. Например:
NAME CLASS HOSTS ADDRESS PORTS AGE trino-ingress nginx trino-cloud.ru-central1.internal 10.92.41.95 80 8m45s
-
Добавьте следующую строку в файл /etc/hosts:
<ingress_ip> trino-cloud.ru-central1.internalгде
<ingress_ip>— внешний IP-адрес контроллера Ingress. В данном примере это10.92.41.95. -
Откройте веб-интерфейс Trino в браузере, используя URL http://trino-cloud.ru-central1.internal (измените протокол на
https, если используете Kerberos и SSL).
Веб-интерфейс Trino
Удаление инстансов
|
ВАЖНО
Удалять оператор следует только после удаления всех управляемых им ресурсов. |
Чтобы удалить кластер Trino, запустите следующую команду:
$ ./adc cluster destroy trino -f cluster-trino-init.yaml
Чтобы удалить оператор Trino, запустите следующую команду:
$ ./adc operators destroy trino-operator -f operator-trino-init.yaml
Чтобы удалить оператор Kerberos, запустите следующую команду:
$ ./adc operators destroy kerberos-operator -f operator-kerberos-init.yaml