vmware-tanzu / community-edition

VMware Tanzu Community Edition is no longer an actively maintained project. Code is available for historical purposes only.
https://tanzucommunityedition.io/
Apache License 2.0
1.33k stars 306 forks source link

Support contour on unmanaged-clusters multi-nodes #4601

Closed jorgemoralespou closed 2 years ago

jorgemoralespou commented 2 years ago

Bug Report

When running an unmanaged cluster with multiple nodes, only the control plane node will be exposed to the host when using the -p flags. So if you create a cluster like this tanzu unmanaged-cluster create tanzu-cluster -p 80:80 -p 443:443 --worker-node-count=2 contour will not properly enable access to the users. In order to support contour in this setup, what I did was:

jpmcb commented 2 years ago

only the control plane node will be exposed to the host when using the -p flags.

Would using the rawKindConfig via a configuration file not alleviate this step? Something like:

ClusterName: my-cluster
KubeconfigPath: ""
ExistingClusterKubeconfig: ""
NodeImage: ""
Provider: kind
ProviderConfiguration:
  rawKindConfig: |
    nodes:
    - role: worker
    - role: worker
    - role: control-plane
      kubeadmConfigPatches:
      - |
        kind: InitConfiguration
        nodeRegistration:
          kubletExtraArgs:
            node-labels: "ingress-ready=true"
            authorization-mode: "AlwaysAllow"
      extraPortMappings:
      - containerPort: 80
        hostPort: 80
        protocol: TCP
        listenAddress: "0.0.0.0"
      - containerPort: 443
        hostPort: 443
        protocol: TCP
        listenAddress: "0.0.0.0"
Cni: calico
CniConfiguration: {}
PodCidr: 10.244.0.0/16
ServiceCidr: 10.96.0.0/16
TkrLocation: ""
AdditionalPackageRepos: []
PortsToForward: []
SkipPreflightChecks: false
ControlPlaneNodeCount: "1"
WorkerNodeCount: "0"
InstallPackages: []
LogFile: ""

As far as applying the tolerations, that is something that kind also recommends.

I'd like to get @vmware-tanzu/pkg-contour-owners input here since this seems like something out of scope for the kind unmanaged-cluster provider.

It'd be really really great if contour just worked out of the box for unmanaged-cluster without having to apply special secrets and tolerations to make kapp happy. Is this something we can add to the spec of the contour deployment overlay? Something like:

envoy:
  service:
    type: ClusterIP
  hostPorts:
    enable: true
  nodeSelector:
    ingress-ready: "true"
  tolerations:
    - key: node-role.kubernetes.io/control-plane
      operator: Equal
      effect: NoSchedule
    - key: node-role.kubernetes.io/master
      operator: Equal
      effect: NoSchedule
github-actions[bot] commented 2 years ago

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.