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 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题