mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
remove the create-external-load-balancer flag in cmd/expose.go
This commit is contained in:
parent
81177226a8
commit
55521ee8be
@ -59,7 +59,7 @@ curl http://localhost:4444
|
|||||||
If you are using Google Container Engine, you can expose your hub via the internet. This is a bad idea for many reasons, but you can do it as follows:
|
If you are using Google Container Engine, you can expose your hub via the internet. This is a bad idea for many reasons, but you can do it as follows:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
kubectl expose rc selenium-hub --name=selenium-hub-external --labels="app=selenium-hub,external=true" --create-external-load-balancer=true
|
kubectl expose rc selenium-hub --name=selenium-hub-external --labels="app=selenium-hub,external=true" --type=LoadBalancer
|
||||||
```
|
```
|
||||||
|
|
||||||
Then wait a few minutes, eventually your new `selenium-hub-external` service will be assigned a load balanced IP from gcloud. Once `kubectl get svc selenium-hub-external` shows two IPs, run this snippet.
|
Then wait a few minutes, eventually your new `selenium-hub-external` service will be assigned a load balanced IP from gcloud. Once `kubectl get svc selenium-hub-external` shows two IPs, run this snippet.
|
||||||
|
@ -115,7 +115,6 @@ controller-start-interval
|
|||||||
cors-allowed-origins
|
cors-allowed-origins
|
||||||
cpu-cfs-quota
|
cpu-cfs-quota
|
||||||
cpu-percent
|
cpu-percent
|
||||||
create-external-load-balancer
|
|
||||||
current-release-pr
|
current-release-pr
|
||||||
current-replicas
|
current-replicas
|
||||||
daemonset-lookup-cache-size
|
daemonset-lookup-cache-size
|
||||||
|
@ -99,9 +99,6 @@ func NewCmdExposeService(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||||||
cmd.Flags().String("protocol", "", "The network protocol for the service to be created. Default is 'TCP'.")
|
cmd.Flags().String("protocol", "", "The network protocol for the service to be created. Default is 'TCP'.")
|
||||||
cmd.Flags().String("port", "", "The port that the service should serve on. Copied from the resource being exposed, if unspecified")
|
cmd.Flags().String("port", "", "The port that the service should serve on. Copied from the resource being exposed, if unspecified")
|
||||||
cmd.Flags().String("type", "", "Type for this service: ClusterIP, NodePort, or LoadBalancer. Default is 'ClusterIP'.")
|
cmd.Flags().String("type", "", "Type for this service: ClusterIP, NodePort, or LoadBalancer. Default is 'ClusterIP'.")
|
||||||
// TODO: remove create-external-load-balancer in code on or after Aug 25, 2016.
|
|
||||||
cmd.Flags().Bool("create-external-load-balancer", false, "If true, create an external load balancer for this service (trumped by --type). Implementation is cloud provider dependent. Default is 'false'.")
|
|
||||||
cmd.Flags().MarkDeprecated("create-external-load-balancer", "use --type=\"LoadBalancer\" instead")
|
|
||||||
cmd.Flags().String("load-balancer-ip", "", "IP to assign to the Load Balancer. If empty, an ephemeral IP will be created and used (cloud-provider specific).")
|
cmd.Flags().String("load-balancer-ip", "", "IP to assign to the Load Balancer. If empty, an ephemeral IP will be created and used (cloud-provider specific).")
|
||||||
cmd.Flags().String("selector", "", "A label selector to use for this service. Only equality-based selector requirements are supported. If empty (the default) infer the selector from the replication controller or replica set.")
|
cmd.Flags().String("selector", "", "A label selector to use for this service. Only equality-based selector requirements are supported. If empty (the default) infer the selector from the replication controller or replica set.")
|
||||||
cmd.Flags().StringP("labels", "l", "", "Labels to apply to the service created by this call.")
|
cmd.Flags().StringP("labels", "l", "", "Labels to apply to the service created by this call.")
|
||||||
|
@ -61,7 +61,6 @@ func paramNames() []GeneratorParam {
|
|||||||
{"ports", false},
|
{"ports", false},
|
||||||
{"labels", false},
|
{"labels", false},
|
||||||
{"external-ip", false},
|
{"external-ip", false},
|
||||||
{"create-external-load-balancer", false},
|
|
||||||
{"load-balancer-ip", false},
|
{"load-balancer-ip", false},
|
||||||
{"type", false},
|
{"type", false},
|
||||||
{"protocol", false},
|
{"protocol", false},
|
||||||
@ -204,9 +203,6 @@ func generate(genericParams map[string]interface{}) (runtime.Object, error) {
|
|||||||
service.Spec.Ports[i].TargetPort = intstr.FromInt(int(port))
|
service.Spec.Ports[i].TargetPort = intstr.FromInt(int(port))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if params["create-external-load-balancer"] == "true" {
|
|
||||||
service.Spec.Type = api.ServiceTypeLoadBalancer
|
|
||||||
}
|
|
||||||
if len(params["external-ip"]) > 0 {
|
if len(params["external-ip"]) > 0 {
|
||||||
service.Spec.ExternalIPs = []string{params["external-ip"]}
|
service.Spec.ExternalIPs = []string{params["external-ip"]}
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ func TestGenerateService(t *testing.T) {
|
|||||||
"protocol": "UDP",
|
"protocol": "UDP",
|
||||||
"container-port": "foobar",
|
"container-port": "foobar",
|
||||||
"external-ip": "1.2.3.4",
|
"external-ip": "1.2.3.4",
|
||||||
"create-external-load-balancer": "true",
|
"type": "LoadBalancer",
|
||||||
},
|
},
|
||||||
expected: api.Service{
|
expected: api.Service{
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
|
Loading…
Reference in New Issue
Block a user