Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEP: add support for hgctl cmd #229

Open
12 of 18 tasks
Xunzhuo opened this issue Mar 7, 2023 · 13 comments
Open
12 of 18 tasks

HEP: add support for hgctl cmd #229

Xunzhuo opened this issue Mar 7, 2023 · 13 comments

Comments

@Xunzhuo
Copy link
Collaborator

Xunzhuo commented Mar 7, 2023

Why do you need it?

Add command line called hgctl, provides abilities for API Gateway operators/cluster developers to manage/debug/analyze higress control plane and data plane.

Features:

Some init commands for hgctl:

  • install
  • uninstall
  • operator
  • manifests
  • upgrade
  • dashboard
  • profile
  • validate
  • config
  • analyze
  • migrate
  • version
  • status
  • help

CI:

  • Build and Test
  • Release
  • Latest Release
  • e2e
    ...
@Xunzhuo Xunzhuo changed the title HEP: add support for hgctl cmd HEP: add support for hgctl cmd Mar 8, 2023
@Xunzhuo Xunzhuo self-assigned this Mar 8, 2023
@xcbeyond
Copy link
Contributor

xcbeyond commented Apr 4, 2023

assign to me.

@Xunzhuo
Copy link
Collaborator Author

Xunzhuo commented Apr 4, 2023

Thanks @xcbeyond, but there are some pre-tasks I am working on. I will separate this issue into sub-tasks to be assignable.

@xcbeyond
Copy link
Contributor

xcbeyond commented Apr 4, 2023

Thanks @xcbeyond, but there are some pre-tasks I am working on. I will separate this issue into sub-tasks to be assignable.

@Xunzhuo ok, I'll pick up the assignment after we break it down

@CH3CHO
Copy link
Collaborator

CH3CHO commented Jun 5, 2023

After discussing with @johnlanni , we think it would be better to add a hgctl ui command to perform port-forward operation on 8080 port of Higress Console and open the console page directly, so user doesn't need to worry about Higress Console being blocked by some incorrect configurations on the Gateway itself, since the Ingress route of Higress Console is also served by the said gateway.

@Xunzhuo
Copy link
Collaborator Author

Xunzhuo commented Jun 6, 2023

@CH3CHO LGFM, similar to istioctl dashboard

@CH3CHO
Copy link
Collaborator

CH3CHO commented Jun 6, 2023

@CH3CHO LGFM, similar to istioctl dashboard

Then should I create a separate issue for this sub-command?

@2456868764
Copy link
Collaborator

2456868764 commented Sep 11, 2023

hgctl install demo 如下

  1. 本地 kind 环境安装
hgctl install --set profile=kind --set global.install=local --set global.enableIstioAPI=true --set gateway.replicas=2  --set console. o11yEnabled=true
  1. 本地 docker 环境安装
hgctl install --set profile=kind --set global.install=docker   --set nacos.url=nacos://192.168.0.1:8848 --set console.adminPassword=admin

关于 hgctl install 具体配置元数据 yaml 结构如下:

profile: kind
global:
  install: local # install mode k8s/local/docker
  ingressClass: higress
  watchNamespace:
  disableAlpnH2: true
  enableStatus: true
  enableIstioAPI: false
  namespace: higress-system

console:
  port: 8080
  replicas: 1
  serviceType: ClusterIP
  domain: console.higress.io
  tlsSecretName:
  webLoginPrompt:
  adminPassword: admin
  o11yEnabled: false
  pvcRwxSupported: true

gateway:
  replicas: 1
  httpPort: 80
  httpsPort: 443
  metricsPort: 15020

controller:
  replicas: 1

nacos:
  useBuiltin: false
  port: 8848
  url: nacos://192.168.0.1:8848 #  file://opt/higress/conf
  ns: higress-system
  username:
  password:
  dataEncKey:

# values passed through to helm
values:

charts:
  higress:
    chartUrl: https://higress.io/helm-charts
    chartName: higress
    chartVersion: 1.1.1
  istio:
    chartUrl: https://istio-release.storage.googleapis.com/charts
    chartName: base
    chartVersion: 1.18.2

@johnlanni
Copy link
Collaborator

@2456868764
有两个问题:

  1. 本地K8s环境,kind 是否用 local-k8s 更合理,本地docker环境,kind用 local-docker,未来我们还会提供纯 local 的方式,直接基于binary部署;另外是否这个kind可以无需指定,而是根据当前是否有 kubectl 命令,以及docker命令来自动选择。
  2. nacos 是local-docker/local模式下的配置来源,配置url所属的第一配置层级不应该是nacos,应该是configure,是通过配置的url里的协议头部分决定了是走nacos:nacos://

@johnlanni
Copy link
Collaborator

@CH3CHO 一起看下这块

@johnlanni johnlanni assigned 2456868764 and unassigned Xunzhuo Sep 11, 2023
@2456868764
Copy link
Collaborator

@2456868764 有两个问题:

  1. 本地K8s环境,kind 是否用 local-k8s 更合理,本地docker环境,kind用 local-docker,未来我们还会提供纯 local 的方式,直接基于binary部署;另外是否这个kind可以无需指定,而是根据当前是否有 kubectl 命令,以及docker命令来自动选择。
  2. nacos 是local-docker/local模式下的配置来源,配置url所属的第一配置层级不应该是nacos,应该是configure,是通过配置的url里的协议头部分决定了是走nacos:nacos://
  1. OK, 四种安装方式 k8s, local-k8s, local-docker, local 分别对应 K8s环境, 本地K8s环境, 本地docker环境, 和 供纯 local ,同时提供不同方式安装默认profile, 用户可以指定profile 就可以安装。 但是用户环境比较复杂,比如同时有 kubectl和docker等,安装方式 profile 还是让用户明确来指定
  2. 关于 nacos 这块整体配置, 这块我理解是非K8环境安装后端存储配置内容。目前支持三种方式,用户指定nacos, buildin nacos, 和文件系统。 可以用URL部分的协议来区分, 可以优化如下配置
storage:
  url: nacos://192.168.0.1:8848 #  file://opt/higress/conf   或者  buildin://127.0.0.1:8848
  ns: higress-system
  username:
  password:
  dataEncKey:

@johnlanni
Copy link
Collaborator

@2456868764 用户指定了profile可以按指定的来,没有指定就按约定的来即可,profile不应该是必填的

@2456868764
Copy link
Collaborator

目前支持 K8s环境(k8s), 本地K8s环境(local-k8s) 两个proifle 安装, 安装场景可以参考如下:

  1. 默认安装
hgctl install 

Please select higress install configration profile:
1.Install higress to local kubernetes cluster like kind etc.
2.Install higress to kubernetes cluster
Please input 1 or 2 to select, input your selection:

这里会输出 默认安装模式选择,让用户来选择当前安装环境 

(如果 profile 没有指定,都会出现这个选择提示)

  1. 指定 默认 profile
hgctl install --set profile=local-k8s

3.指定 默认 profile 同时 简单定制 profile 参数

 hgctl install --set profile=local-k8s  --set global.enableIstioAPI=true --set gateway.replicas=2
  1. 定制 profile 和 安装
#生成 profile 
hgctl profile dump --output=./custom_profile.yaml

# 编辑 custom_profile.yaml

# 指定profile 安装

hgctl install --set profile=./custom_profile.yaml

@Xunzhuo
Copy link
Collaborator Author

Xunzhuo commented Sep 21, 2023

Track: #538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

5 participants