kstone-io / kstone

Kstone is an etcd management platform, providing cluster management, monitoring, backup, inspection, data migration, visual viewing of etcd data, and intelligent diagnosis.
Apache License 2.0
684 stars 106 forks source link

How to expose managed etcd cluster to the outside of the k8s cluster without manually declare svc yaml #140

Open Battlefield-Pony opened 2 years ago

Battlefield-Pony commented 2 years ago

As I submitted the creation request, there are several ClusterIp exposing etcd cluster TAPP, but if I needto access the etcd cluster, I will need expose an nodePort manually,which is not automated from the operator. Is there a way to espose the etcd cluster without manual exposure?

engow commented 2 years ago

Later, dashboard will support tencentyun LoadBalancer type. As for now, I think creating a new svc with NodePort or LoadBalancer is simple way. If kstone was deployed in TKE, the following yaml can be refered.


apiVersion: v1
kind: Service
metadata:
  annotations:
    service.kubernetes.io/qcloud-loadbalancer-internal-subnetid: ${subnetID}
  labels:
    etcdcluster.etcd.tkestack.io/cluster-name: ${etcdName}
  name: ${etcdName}-etcd-lb
  namespace: kstone
spec:
  externalTrafficPolicy: Cluster
  ports:
  - name: client
    port: 2379
    protocol: TCP
    targetPort: 2379
  selector:
    etcdcluster.etcd.tkestack.io/cluster-name: ${etcdName}
  sessionAffinity: None
  type: LoadBalancer
···