Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-scripts: Change apiServerURL for setup-fleet-downstream #2052

Merged
merged 1 commit into from
May 15, 2024

Conversation

p-se
Copy link
Contributor

@p-se p-se commented Jan 9, 2024

The dev scripts failed to work on a customized setup of docker where /etc/docker/daemon.json contains the following JSON to prevent conflicts on the host with a different configuration.

{
  "bip": "172.26.0.1/16",
  "default-address-pools": [
    {
      "base": "172.27.0.0/16",
      "size": 24
    },
    {
      "base": "172.28.0.0/16",
      "size": 24
    },
    {
      "base": "172.29.0.0/16",
      "size": 24
    },
    {
      "base": "172.30.0.0/16",
      "size": 24
    },
    {
      "base": "172.31.0.0/16",
      "size": 24
    },
    {
      "base": "172.32.0.0/16",
      "size": 24
    }
  ]
}

The update makes the certificate usable for the internal DNS name of the upstream cluster. The apiServerURL is then configured to talk to the upstream server directly rather than through the bridge of the host.

Refers to #XXX

@p-se p-se requested a review from a team as a code owner January 9, 2024 09:13
@p-se
Copy link
Contributor Author

p-se commented Jan 9, 2024

I hope this configuration will be more reliable across different systems than the previous one(s) due to the fact that the communication is internal and uses the internal DNS names.

@p-se p-se force-pushed the update-dev-multi-cluster-network branch from 54b76fa to 1d713d0 Compare April 24, 2024 12:29

kubectl config use-context "$downstream_ctx"
helm -n cattle-fleet-system upgrade --install --create-namespace --wait fleet-agent charts/fleet-agent \
--set-string labels.env=test \
--set apiServerCA="$ca" \
--set apiServerURL="https://$public_hostname:36443" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@p-se p-se May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--api-port 6550 is not required for the example to work.
It’s used to have k3s‘s API-Server listening on port 6550 with that port mapped to the host system.

-- https://k3d.io/v5.0.0/usage/exposing_services/

Another explanation for how --api-port works.

As this maps the port to the host system and the idea is to not involve the host system for cluster registrations by going through the Kubernetes internal service, I don't see why it would cause an issue not to use it.

@manno manno merged commit 4bd16a1 into rancher:main May 15, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants