createCluster: use default 6443 api port in hostNetwork mode

Fixes #284
pull/287/head
iwilltry42 4 years ago
parent eac293a263
commit 24f92b9c3f
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 5
      cmd/create/createCluster.go

@ -234,6 +234,11 @@ func parseCreateClusterCmd(cmd *cobra.Command, args []string, createClusterOpts
if exposeAPI.HostIP == "" {
exposeAPI.HostIP = k3d.DefaultAPIHost
}
if networkName == "host" {
// in hostNetwork mode, we're not going to map a hostport. Here it should always use 6443.
// Note that hostNetwork mode is super inflexible and since we don't change the backend port (on the container), it will only be one hostmode cluster allowed.
exposeAPI.Port = k3d.DefaultAPIPort
}
// --volume
volumeFlags, err := cmd.Flags().GetStringArray("volume")

Loading…
Cancel
Save