如何在群集外部访问使用helm构建的Concourse?

时间:2017-06-28 16:09:57

标签: kubernetes concourse kubernetes-helm

我使用https://github.com/kubernetes/charts/tree/master/stable/concourse提供的大厅头盔构建来设置我们的kubernetes群集内的大厅。我已经能够使设置工作,我能够在群集中访问它,但我无法在群集外访问它。构建中的注释显示我可以使用kubectl port-forward来访问网页,但我不希望所有开发人员都必须转发端口才能访问网络ui。我尝试创建一个具有如下节点端口的服务:

apiVersion: v1
kind: Service
metadata:
  name: concourse
  namespace: concourse-ci
spec:
  ports:
  - port: 8080
    name: atc
    nodePort: 31080
  - port: 2222
    name: tsa
    nodePort: 31222
  selector:
    app: concourse-web
  type: NodePort

这允许我以大多数方式访问网页并与之交互,但是当我尝试查看构建状态时,它从不加载发生的事件。相反,/api/v1/builds/1/events的网络请求卡在挂起状态,并且构建的步骤永远不会加载。我能做些什么才能完全访问集群外部的大厅?

编辑:似乎事件网络请求通常以text/event-stream数据类型响应,并且Kubernetes服务可能没有正确处理事件流。或者有一些关于处理不同于规范的事件流的大厅。

4 个答案:

答案 0 :(得分:2)

经过大量调查后,我发现nodePort服务实际上正在运行,只是我的防病毒软件(Sophos)正在静默阻止来自events请求的响应。

答案 1 :(得分:1)

此外,您可以通过kubernetes中的loadbalancer公开您的端口。

kubectl get deployments

kubectl expose deployment <web pod name> --port=80 --target-port=8080 --name=expoport --type=LoadBalancer

它将为您创建一个公共IP,您将能够访问端口80上的大厅。

答案 2 :(得分:0)

不确定,因为我也是新手,但是......您可以通过提供自己的https://github.com/kubernetes/charts/blob/master/stable/concourse/values.yaml

版本来配置图表
  

helm install stable / concourse -f custom_values.yaml

有一个'externalURL'参数,可能值得尝试将其设置为您的网址

  ## URL used to reach any ATC from the outside world.
  ##
  # externalURL:

答案 3 :(得分:0)

此外,如果您使用的是GKE,则可以使用内部负载平衡器,请在values.yaml文件中进行设置

  service:
    ## For minikube, set this to ClusterIP, elsewhere use LoadBalancer or NodePort
    ## ref: https://kubernetes.io/docs/user-guide/services/#publishing-services---service-types
    ##
    #type: ClusterIP
    type: LoadBalancer

    ## When using web.service.type: LoadBalancer, sets the user-specified load balancer IP
    # loadBalancerIP: 172.217.1.174

    ## Annotations to be added to the web service.
    ##
    annotations:
      # May be used in example for internal load balancing in GCP:
      cloud.google.com/load-balancer-type: Internal
相关问题