drymoeuka282427675 2018-04-20 14:00
浏览 90
已采纳

从Golang连接到kubernetes-aerospike网格集群

I am new to kubernetes. I successfully created a headless service for aerospike-kubernetes. I logged into docker container and verified that the mesh contains all the replicas. I have used https://github.com/aerospike/aerospike-kubernetes/blob/master/aerospike-statefulset.yaml for the same.

Now since its a headless service clusterIP is "none" and i am writing a golang program to connect to the aerospike. I am puzzled as to what should go in the IPaddress to connect to aerospike. What should i give in place of xxx-xxx-xxx-xxx ? how can i generate an Internal IP so that i can connect to the entire mesh?

client, err := as.NewClient("xxx-xxx-xxx-xxx", 3000)
if err != nil {
    log.Fatal(err)
}

This golang project will be deployed as a pod so an internal IP would suffice.

  • 写回答

1条回答 默认 最新

  • dongronge3732 2018-04-23 17:10
    关注

    headless service clusterIP is "none"

    This simply means we don't use the load balancer/reverse proxy mode, but rather DNS Round-Robin mode for the service endpoint.

    By default, visibility of the Aerospike cluster is limited to within the Kubernetes environment. You can use the service name generated by kube-dns to connect. The address would take the form of: <service>.<namespace>.svc.cluster.local. In other words: aerospike.aerospike-cluster-1.svc.cluster.local if you've left it as defaults.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题