2

我正在使用https://github.com/kubernetes/charts/tree/master/stable/concourse提供的 concourse helm build 在我们的 kubernetes 集群内设置 concourse。我已经能够使设置正常工作,并且可以在集群内访问它,但在集群外访问它时遇到问题。构建中的注释显示我可以使用kubectl port-forward它来访问网页,但我不希望所有开发人员都必须转发端口才能访问 web 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

4 回答 4

2

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

于 2017-06-29T19:39:20.280 回答
1

此外,您可以通过 kubernetes 中的负载均衡器公开您的端口。

kubectl get deployments

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

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

于 2017-08-21T23:17:51.760 回答
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
于 2018-08-14T13:01:18.280 回答
0

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

helm install stable/concourse -f custom_values.yaml

有一个“externalURL”参数,也许值得尝试将其设置为您的 URL

  ## URL used to reach any ATC from the outside world.
  ##
  # externalURL:
于 2017-06-28T18:40:20.923 回答