Browse code

provide vxlan integration options to the router cmd line

Rajat Chopra authored on 2016/11/01 05:37:03
Showing 11 changed files
... ...
@@ -4308,6 +4308,8 @@ _oadm_router()
4308 4308
     local_nonpersistent_flags+=("--external-host-https-vserver=")
4309 4309
     flags+=("--external-host-insecure")
4310 4310
     local_nonpersistent_flags+=("--external-host-insecure")
4311
+    flags+=("--external-host-internal-ip=")
4312
+    local_nonpersistent_flags+=("--external-host-internal-ip=")
4311 4313
     flags+=("--external-host-partition-path=")
4312 4314
     local_nonpersistent_flags+=("--external-host-partition-path=")
4313 4315
     flags+=("--external-host-password=")
... ...
@@ -4316,6 +4318,8 @@ _oadm_router()
4316 4316
     local_nonpersistent_flags+=("--external-host-private-key=")
4317 4317
     flags+=("--external-host-username=")
4318 4318
     local_nonpersistent_flags+=("--external-host-username=")
4319
+    flags+=("--external-host-vxlan-gw=")
4320
+    local_nonpersistent_flags+=("--external-host-vxlan-gw=")
4319 4321
     flags+=("--force-subdomain=")
4320 4322
     local_nonpersistent_flags+=("--force-subdomain=")
4321 4323
     flags+=("--host-network")
... ...
@@ -4358,6 +4358,8 @@ _oc_adm_router()
4358 4358
     local_nonpersistent_flags+=("--external-host-https-vserver=")
4359 4359
     flags+=("--external-host-insecure")
4360 4360
     local_nonpersistent_flags+=("--external-host-insecure")
4361
+    flags+=("--external-host-internal-ip=")
4362
+    local_nonpersistent_flags+=("--external-host-internal-ip=")
4361 4363
     flags+=("--external-host-partition-path=")
4362 4364
     local_nonpersistent_flags+=("--external-host-partition-path=")
4363 4365
     flags+=("--external-host-password=")
... ...
@@ -4366,6 +4368,8 @@ _oc_adm_router()
4366 4366
     local_nonpersistent_flags+=("--external-host-private-key=")
4367 4367
     flags+=("--external-host-username=")
4368 4368
     local_nonpersistent_flags+=("--external-host-username=")
4369
+    flags+=("--external-host-vxlan-gw=")
4370
+    local_nonpersistent_flags+=("--external-host-vxlan-gw=")
4369 4371
     flags+=("--force-subdomain=")
4370 4372
     local_nonpersistent_flags+=("--force-subdomain=")
4371 4373
     flags+=("--host-network")
... ...
@@ -4308,6 +4308,8 @@ _openshift_admin_router()
4308 4308
     local_nonpersistent_flags+=("--external-host-https-vserver=")
4309 4309
     flags+=("--external-host-insecure")
4310 4310
     local_nonpersistent_flags+=("--external-host-insecure")
4311
+    flags+=("--external-host-internal-ip=")
4312
+    local_nonpersistent_flags+=("--external-host-internal-ip=")
4311 4313
     flags+=("--external-host-partition-path=")
4312 4314
     local_nonpersistent_flags+=("--external-host-partition-path=")
4313 4315
     flags+=("--external-host-password=")
... ...
@@ -4316,6 +4318,8 @@ _openshift_admin_router()
4316 4316
     local_nonpersistent_flags+=("--external-host-private-key=")
4317 4317
     flags+=("--external-host-username=")
4318 4318
     local_nonpersistent_flags+=("--external-host-username=")
4319
+    flags+=("--external-host-vxlan-gw=")
4320
+    local_nonpersistent_flags+=("--external-host-vxlan-gw=")
4319 4321
     flags+=("--force-subdomain=")
4320 4322
     local_nonpersistent_flags+=("--force-subdomain=")
4321 4323
     flags+=("--host-network")
... ...
@@ -8905,6 +8909,8 @@ _openshift_cli_adm_router()
8905 8905
     local_nonpersistent_flags+=("--external-host-https-vserver=")
8906 8906
     flags+=("--external-host-insecure")
8907 8907
     local_nonpersistent_flags+=("--external-host-insecure")
8908
+    flags+=("--external-host-internal-ip=")
8909
+    local_nonpersistent_flags+=("--external-host-internal-ip=")
8908 8910
     flags+=("--external-host-partition-path=")
8909 8911
     local_nonpersistent_flags+=("--external-host-partition-path=")
8910 8912
     flags+=("--external-host-password=")
... ...
@@ -8913,6 +8919,8 @@ _openshift_cli_adm_router()
8913 8913
     local_nonpersistent_flags+=("--external-host-private-key=")
8914 8914
     flags+=("--external-host-username=")
8915 8915
     local_nonpersistent_flags+=("--external-host-username=")
8916
+    flags+=("--external-host-vxlan-gw=")
8917
+    local_nonpersistent_flags+=("--external-host-vxlan-gw=")
8916 8918
     flags+=("--force-subdomain=")
8917 8919
     local_nonpersistent_flags+=("--force-subdomain=")
8918 8920
     flags+=("--host-network")
... ...
@@ -4469,6 +4469,8 @@ _oadm_router()
4469 4469
     local_nonpersistent_flags+=("--external-host-https-vserver=")
4470 4470
     flags+=("--external-host-insecure")
4471 4471
     local_nonpersistent_flags+=("--external-host-insecure")
4472
+    flags+=("--external-host-internal-ip=")
4473
+    local_nonpersistent_flags+=("--external-host-internal-ip=")
4472 4474
     flags+=("--external-host-partition-path=")
4473 4475
     local_nonpersistent_flags+=("--external-host-partition-path=")
4474 4476
     flags+=("--external-host-password=")
... ...
@@ -4477,6 +4479,8 @@ _oadm_router()
4477 4477
     local_nonpersistent_flags+=("--external-host-private-key=")
4478 4478
     flags+=("--external-host-username=")
4479 4479
     local_nonpersistent_flags+=("--external-host-username=")
4480
+    flags+=("--external-host-vxlan-gw=")
4481
+    local_nonpersistent_flags+=("--external-host-vxlan-gw=")
4480 4482
     flags+=("--force-subdomain=")
4481 4483
     local_nonpersistent_flags+=("--force-subdomain=")
4482 4484
     flags+=("--host-network")
... ...
@@ -4519,6 +4519,8 @@ _oc_adm_router()
4519 4519
     local_nonpersistent_flags+=("--external-host-https-vserver=")
4520 4520
     flags+=("--external-host-insecure")
4521 4521
     local_nonpersistent_flags+=("--external-host-insecure")
4522
+    flags+=("--external-host-internal-ip=")
4523
+    local_nonpersistent_flags+=("--external-host-internal-ip=")
4522 4524
     flags+=("--external-host-partition-path=")
4523 4525
     local_nonpersistent_flags+=("--external-host-partition-path=")
4524 4526
     flags+=("--external-host-password=")
... ...
@@ -4527,6 +4529,8 @@ _oc_adm_router()
4527 4527
     local_nonpersistent_flags+=("--external-host-private-key=")
4528 4528
     flags+=("--external-host-username=")
4529 4529
     local_nonpersistent_flags+=("--external-host-username=")
4530
+    flags+=("--external-host-vxlan-gw=")
4531
+    local_nonpersistent_flags+=("--external-host-vxlan-gw=")
4530 4532
     flags+=("--force-subdomain=")
4531 4533
     local_nonpersistent_flags+=("--force-subdomain=")
4532 4534
     flags+=("--host-network")
... ...
@@ -4469,6 +4469,8 @@ _openshift_admin_router()
4469 4469
     local_nonpersistent_flags+=("--external-host-https-vserver=")
4470 4470
     flags+=("--external-host-insecure")
4471 4471
     local_nonpersistent_flags+=("--external-host-insecure")
4472
+    flags+=("--external-host-internal-ip=")
4473
+    local_nonpersistent_flags+=("--external-host-internal-ip=")
4472 4474
     flags+=("--external-host-partition-path=")
4473 4475
     local_nonpersistent_flags+=("--external-host-partition-path=")
4474 4476
     flags+=("--external-host-password=")
... ...
@@ -4477,6 +4479,8 @@ _openshift_admin_router()
4477 4477
     local_nonpersistent_flags+=("--external-host-private-key=")
4478 4478
     flags+=("--external-host-username=")
4479 4479
     local_nonpersistent_flags+=("--external-host-username=")
4480
+    flags+=("--external-host-vxlan-gw=")
4481
+    local_nonpersistent_flags+=("--external-host-vxlan-gw=")
4480 4482
     flags+=("--force-subdomain=")
4481 4483
     local_nonpersistent_flags+=("--force-subdomain=")
4482 4484
     flags+=("--host-network")
... ...
@@ -9066,6 +9070,8 @@ _openshift_cli_adm_router()
9066 9066
     local_nonpersistent_flags+=("--external-host-https-vserver=")
9067 9067
     flags+=("--external-host-insecure")
9068 9068
     local_nonpersistent_flags+=("--external-host-insecure")
9069
+    flags+=("--external-host-internal-ip=")
9070
+    local_nonpersistent_flags+=("--external-host-internal-ip=")
9069 9071
     flags+=("--external-host-partition-path=")
9070 9072
     local_nonpersistent_flags+=("--external-host-partition-path=")
9071 9073
     flags+=("--external-host-password=")
... ...
@@ -9074,6 +9080,8 @@ _openshift_cli_adm_router()
9074 9074
     local_nonpersistent_flags+=("--external-host-private-key=")
9075 9075
     flags+=("--external-host-username=")
9076 9076
     local_nonpersistent_flags+=("--external-host-username=")
9077
+    flags+=("--external-host-vxlan-gw=")
9078
+    local_nonpersistent_flags+=("--external-host-vxlan-gw=")
9077 9079
     flags+=("--force-subdomain=")
9078 9080
     local_nonpersistent_flags+=("--force-subdomain=")
9079 9081
     flags+=("--host-network")
... ...
@@ -60,6 +60,10 @@ If a router does not exist with the given name, this command will create a deplo
60 60
     If the underlying router implementation connects with an external host over a secure connection, this causes the router to skip strict certificate verification with the external host.
61 61
 
62 62
 .PP
63
+\fB\-\-external\-host\-internal\-ip\fP=""
64
+    If the underlying router implementation requires the use of a specific network interface to connect to the pod network, this is the IP address of that internal interface.
65
+
66
+.PP
63 67
 \fB\-\-external\-host\-partition\-path\fP=""
64 68
     If the underlying router implementation uses partitions for control boundaries, this is the path to use for that partition.
65 69
 
... ...
@@ -76,6 +80,10 @@ If a router does not exist with the given name, this command will create a deplo
76 76
     If the underlying router implementation connects with an external host, this is the username for authenticating with the external host.
77 77
 
78 78
 .PP
79
+\fB\-\-external\-host\-vxlan\-gw\fP=""
80
+    If the underlying router implementation requires VxLAN access to the pod network, this is the gateway address that should be used in cidr format.
81
+
82
+.PP
79 83
 \fB\-\-force\-subdomain\fP=""
80 84
     A router path format to force on all routes used by this router (will ignore the route host value)
81 85
 
... ...
@@ -60,6 +60,10 @@ If a router does not exist with the given name, this command will create a deplo
60 60
     If the underlying router implementation connects with an external host over a secure connection, this causes the router to skip strict certificate verification with the external host.
61 61
 
62 62
 .PP
63
+\fB\-\-external\-host\-internal\-ip\fP=""
64
+    If the underlying router implementation requires the use of a specific network interface to connect to the pod network, this is the IP address of that internal interface.
65
+
66
+.PP
63 67
 \fB\-\-external\-host\-partition\-path\fP=""
64 68
     If the underlying router implementation uses partitions for control boundaries, this is the path to use for that partition.
65 69
 
... ...
@@ -76,6 +80,10 @@ If a router does not exist with the given name, this command will create a deplo
76 76
     If the underlying router implementation connects with an external host, this is the username for authenticating with the external host.
77 77
 
78 78
 .PP
79
+\fB\-\-external\-host\-vxlan\-gw\fP=""
80
+    If the underlying router implementation requires VxLAN access to the pod network, this is the gateway address that should be used in cidr format.
81
+
82
+.PP
79 83
 \fB\-\-force\-subdomain\fP=""
80 84
     A router path format to force on all routes used by this router (will ignore the route host value)
81 85
 
... ...
@@ -60,6 +60,10 @@ If a router does not exist with the given name, this command will create a deplo
60 60
     If the underlying router implementation connects with an external host over a secure connection, this causes the router to skip strict certificate verification with the external host.
61 61
 
62 62
 .PP
63
+\fB\-\-external\-host\-internal\-ip\fP=""
64
+    If the underlying router implementation requires the use of a specific network interface to connect to the pod network, this is the IP address of that internal interface.
65
+
66
+.PP
63 67
 \fB\-\-external\-host\-partition\-path\fP=""
64 68
     If the underlying router implementation uses partitions for control boundaries, this is the path to use for that partition.
65 69
 
... ...
@@ -76,6 +80,10 @@ If a router does not exist with the given name, this command will create a deplo
76 76
     If the underlying router implementation connects with an external host, this is the username for authenticating with the external host.
77 77
 
78 78
 .PP
79
+\fB\-\-external\-host\-vxlan\-gw\fP=""
80
+    If the underlying router implementation requires VxLAN access to the pod network, this is the gateway address that should be used in cidr format.
81
+
82
+.PP
79 83
 \fB\-\-force\-subdomain\fP=""
80 84
     A router path format to force on all routes used by this router (will ignore the route host value)
81 85
 
... ...
@@ -60,6 +60,10 @@ If a router does not exist with the given name, this command will create a deplo
60 60
     If the underlying router implementation connects with an external host over a secure connection, this causes the router to skip strict certificate verification with the external host.
61 61
 
62 62
 .PP
63
+\fB\-\-external\-host\-internal\-ip\fP=""
64
+    If the underlying router implementation requires the use of a specific network interface to connect to the pod network, this is the IP address of that internal interface.
65
+
66
+.PP
63 67
 \fB\-\-external\-host\-partition\-path\fP=""
64 68
     If the underlying router implementation uses partitions for control boundaries, this is the path to use for that partition.
65 69
 
... ...
@@ -76,6 +80,10 @@ If a router does not exist with the given name, this command will create a deplo
76 76
     If the underlying router implementation connects with an external host, this is the username for authenticating with the external host.
77 77
 
78 78
 .PP
79
+\fB\-\-external\-host\-vxlan\-gw\fP=""
80
+    If the underlying router implementation requires VxLAN access to the pod network, this is the gateway address that should be used in cidr format.
81
+
82
+.PP
79 83
 \fB\-\-force\-subdomain\fP=""
80 84
     A router path format to force on all routes used by this router (will ignore the route host value)
81 85
 
... ...
@@ -183,6 +183,14 @@ type RouterConfig struct {
183 183
 	// the external host.
184 184
 	ExternalHostPrivateKey string
185 185
 
186
+	// ExternalHostInternalIP specifies the IP address of the internal interface that is
187
+	// used by the external host to connect to the pod network
188
+	ExternalHostInternalIP string
189
+
190
+	// ExternalHostVxLANGateway specifies the gateway IP and mask (cidr) of the IP
191
+	// address to be used to connect to the pod network from the external host
192
+	ExternalHostVxLANGateway string
193
+
186 194
 	// ExternalHostInsecure specifies that the router should skip strict
187 195
 	// certificate verification when connecting to the external host.
188 196
 	ExternalHostInsecure bool
... ...
@@ -271,6 +279,8 @@ func NewCmdRouter(f *clientcmd.Factory, parentName, name string, out, errout io.
271 271
 	cmd.Flags().StringVar(&cfg.ExternalHostHttpVserver, "external-host-http-vserver", cfg.ExternalHostHttpVserver, "If the underlying router implementation uses virtual servers, this is the name of the virtual server for HTTP connections.")
272 272
 	cmd.Flags().StringVar(&cfg.ExternalHostHttpsVserver, "external-host-https-vserver", cfg.ExternalHostHttpsVserver, "If the underlying router implementation uses virtual servers, this is the name of the virtual server for HTTPS connections.")
273 273
 	cmd.Flags().StringVar(&cfg.ExternalHostPrivateKey, "external-host-private-key", cfg.ExternalHostPrivateKey, "If the underlying router implementation requires an SSH private key, this is the path to the private key file.")
274
+	cmd.Flags().StringVar(&cfg.ExternalHostInternalIP, "external-host-internal-ip", cfg.ExternalHostInternalIP, "If the underlying router implementation requires the use of a specific network interface to connect to the pod network, this is the IP address of that internal interface.")
275
+	cmd.Flags().StringVar(&cfg.ExternalHostVxLANGateway, "external-host-vxlan-gw", cfg.ExternalHostVxLANGateway, "If the underlying router implementation requires VxLAN access to the pod network, this is the gateway address that should be used in cidr format.")
274 276
 	cmd.Flags().BoolVar(&cfg.ExternalHostInsecure, "external-host-insecure", cfg.ExternalHostInsecure, "If the underlying router implementation connects with an external host over a secure connection, this causes the router to skip strict certificate verification with the external host.")
275 277
 	cmd.Flags().StringVar(&cfg.ExternalHostPartitionPath, "external-host-partition-path", cfg.ExternalHostPartitionPath, "If the underlying router implementation uses partitions for control boundaries, this is the path to use for that partition.")
276 278
 
... ...
@@ -631,22 +641,24 @@ func RunCmdRouter(f *clientcmd.Factory, cmd *cobra.Command, out, errout io.Write
631 631
 	}
632 632
 
633 633
 	env := app.Environment{
634
-		"ROUTER_SUBDOMAIN":                    cfg.Subdomain,
635
-		"ROUTER_SERVICE_NAME":                 name,
636
-		"ROUTER_SERVICE_NAMESPACE":            namespace,
637
-		"ROUTER_SERVICE_HTTP_PORT":            "80",
638
-		"ROUTER_SERVICE_HTTPS_PORT":           "443",
639
-		"ROUTER_EXTERNAL_HOST_HOSTNAME":       cfg.ExternalHost,
640
-		"ROUTER_EXTERNAL_HOST_USERNAME":       cfg.ExternalHostUsername,
641
-		"ROUTER_EXTERNAL_HOST_PASSWORD":       cfg.ExternalHostPassword,
642
-		"ROUTER_EXTERNAL_HOST_HTTP_VSERVER":   cfg.ExternalHostHttpVserver,
643
-		"ROUTER_EXTERNAL_HOST_HTTPS_VSERVER":  cfg.ExternalHostHttpsVserver,
644
-		"ROUTER_EXTERNAL_HOST_INSECURE":       strconv.FormatBool(cfg.ExternalHostInsecure),
645
-		"ROUTER_EXTERNAL_HOST_PARTITION_PATH": cfg.ExternalHostPartitionPath,
646
-		"ROUTER_EXTERNAL_HOST_PRIVKEY":        privkeyPath,
647
-		"STATS_PORT":                          strconv.Itoa(cfg.StatsPort),
648
-		"STATS_USERNAME":                      cfg.StatsUsername,
649
-		"STATS_PASSWORD":                      cfg.StatsPassword,
634
+		"ROUTER_SUBDOMAIN":                      cfg.Subdomain,
635
+		"ROUTER_SERVICE_NAME":                   name,
636
+		"ROUTER_SERVICE_NAMESPACE":              namespace,
637
+		"ROUTER_SERVICE_HTTP_PORT":              "80",
638
+		"ROUTER_SERVICE_HTTPS_PORT":             "443",
639
+		"ROUTER_EXTERNAL_HOST_HOSTNAME":         cfg.ExternalHost,
640
+		"ROUTER_EXTERNAL_HOST_USERNAME":         cfg.ExternalHostUsername,
641
+		"ROUTER_EXTERNAL_HOST_PASSWORD":         cfg.ExternalHostPassword,
642
+		"ROUTER_EXTERNAL_HOST_HTTP_VSERVER":     cfg.ExternalHostHttpVserver,
643
+		"ROUTER_EXTERNAL_HOST_HTTPS_VSERVER":    cfg.ExternalHostHttpsVserver,
644
+		"ROUTER_EXTERNAL_HOST_INSECURE":         strconv.FormatBool(cfg.ExternalHostInsecure),
645
+		"ROUTER_EXTERNAL_HOST_PARTITION_PATH":   cfg.ExternalHostPartitionPath,
646
+		"ROUTER_EXTERNAL_HOST_PRIVKEY":          privkeyPath,
647
+		"ROUTER_EXTERNAL_HOST_INTERNAL_ADDRESS": cfg.ExternalHostInternalIP,
648
+		"ROUTER_EXTERNAL_HOST_VXLAN_GW_CIDR":    cfg.ExternalHostVxLANGateway,
649
+		"STATS_PORT":                            strconv.Itoa(cfg.StatsPort),
650
+		"STATS_USERNAME":                        cfg.StatsUsername,
651
+		"STATS_PASSWORD":                        cfg.StatsPassword,
650 652
 	}
651 653
 	if len(cfg.ForceSubdomain) > 0 {
652 654
 		env["ROUTER_SUBDOMAIN"] = cfg.ForceSubdomain