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

feat(kuma-cp) KDS multiplexer #917

Merged
merged 9 commits into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 243 additions & 0 deletions api/mesh/v1alpha1/mux.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions api/mesh/v1alpha1/mux.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

package kuma.mesh.v1alpha1;

option go_package = "v1alpha1";

import "envoy/api/v2/discovery.proto";

service MultiplexService {
rpc StreamMessage(stream Message) returns (stream Message);
}

message Message {
oneof value {
envoy.api.v2.DiscoveryRequest request = 1;
envoy.api.v2.DiscoveryResponse response = 2;
}
}
12 changes: 4 additions & 8 deletions app/kuma-cp/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ func newRunCmdWithOpts(opts runCmdOpts) *cobra.Command {
runLog.Error(err, "unable to set up Monitoring Assignment server")
return err
}
if err := kds_remote.SetupServer(rt); err != nil {
runLog.Error(err, "unable to set up KDS Remote Server")
if err := kds_remote.Setup(rt); err != nil {
runLog.Error(err, "unable to set up KDS Remote")
return err
}
if err := dns.SetupServer(rt); err != nil {
Expand All @@ -117,12 +117,8 @@ func newRunCmdWithOpts(opts runCmdOpts) *cobra.Command {
runLog.Error(err, "unable to set up Clusters server")
return err
}
if err := kds_global.SetupComponent(rt); err != nil {
runLog.Error(err, "unable to set up KDS Global Sink")
return err
}
if err := kds_global.SetupServer(rt); err != nil {
runLog.Error(err, "unable to set up KDS Global Server")
if err := kds_global.Setup(rt); err != nil {
runLog.Error(err, "unable to set up KDS Global")
return err
}
}
Expand Down
3 changes: 3 additions & 0 deletions app/kumactl/cmd/completion/testdata/bash.golden
Original file line number Diff line number Diff line change
Expand Up @@ -1747,6 +1747,9 @@ _kumactl_install_control-plane()
flags+=("--injector-failure-policy=")
two_word_flags+=("--injector-failure-policy")
local_nonpersistent_flags+=("--injector-failure-policy=")
flags+=("--kds-global-address=")
two_word_flags+=("--kds-global-address")
local_nonpersistent_flags+=("--kds-global-address=")
flags+=("--kds-tls-cert=")
two_word_flags+=("--kds-tls-cert")
local_nonpersistent_flags+=("--kds-tls-cert=")
Expand Down
1 change: 1 addition & 0 deletions app/kumactl/cmd/completion/testdata/zsh.golden
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ function _kumactl_install_control-plane {
'--dataplane-init-image[init image of the Kuma Dataplane component]:' \
'--image-pull-policy[image pull policy that applies to all components of the Kuma Control Plane]:' \
'--injector-failure-policy[failue policy of the mutating web hook implemented by the Kuma Injector component]:' \
'--kds-global-address[URL of Global Kuma CP]:' \
'--kds-tls-cert[TLS certificate for the KDS server]:' \
'--kds-tls-key[TLS key for the KDS server]:' \
'--mode[kuma cp modes: one of standalone|remote|global]:' \
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/cmd/install/install_control_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func newInstallControlPlaneCmd(pctx *kumactl_cmd.RootContext) *cobra.Command {
SdsTlsKey string
KdsTlsCert string
KdsTlsKey string
KdsGlobalAddress string
CNIEnabled bool
CNIImage string
CNIVersion string
Expand Down Expand Up @@ -171,6 +172,7 @@ func newInstallControlPlaneCmd(pctx *kumactl_cmd.RootContext) *cobra.Command {
cmd.Flags().StringVar(&args.SdsTlsKey, "sds-tls-key", args.SdsTlsKey, "TLS key for the SDS server")
cmd.Flags().StringVar(&args.KdsTlsCert, "kds-tls-cert", args.KdsTlsCert, "TLS certificate for the KDS server")
cmd.Flags().StringVar(&args.KdsTlsKey, "kds-tls-key", args.KdsTlsKey, "TLS key for the KDS server")
cmd.Flags().StringVar(&args.KdsGlobalAddress, "kds-global-address", args.KdsGlobalAddress, "URL of Global Kuma CP")
cmd.Flags().BoolVar(&args.CNIEnabled, "cni-enabled", args.CNIEnabled, "install Kuma with CNI instead of proxy init container")
cmd.Flags().StringVar(&args.CNIImage, "cni-image", args.CNIImage, "image of Kuma CNI component, if CNIEnabled equals true")
cmd.Flags().StringVar(&args.CNIVersion, "cni-version", args.CNIVersion, "version of the CNIImage")
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/cmd/install/install_control_plane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ var _ = Describe("kumactl install control-plane", func() {
"--kds-tls-cert", "KdsCert",
"--kds-tls-key", "KdsKey",
"--mode", "remote",
"--kds-global-address", "grpcs://192.168.0.1:5685",
"--zone", "zone-1",
"--use-node-port",
},
Expand All @@ -144,6 +145,7 @@ var _ = Describe("kumactl install control-plane", func() {
extraArgs: []string{
"--mode", "remote",
"--zone", "zone-1",
"--kds-global-address", "grpcs://192.168.0.1:5685",
},
goldenFile: "install-control-plane.remote.golden.yaml",
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ spec:
names:
kind: Zone
plural: zones
scope: ""
scope: Cluster
validation:
openAPIV3Schema:
description: Zone is the Schema for the zone API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ spec:
names:
kind: Zone
plural: zones
scope: ""
scope: "Cluster"
validation:
openAPIV3Schema:
description: Zone is the Schema for the zone API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ spec:
names:
kind: Zone
plural: zones
scope: ""
scope: Cluster
validation:
openAPIV3Schema:
description: Zone is the Schema for the zone API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ spec:
names:
kind: Zone
plural: zones
scope: ""
scope: "Cluster"
validation:
openAPIV3Schema:
description: Zone is the Schema for the zone API
Expand Down Expand Up @@ -5022,6 +5022,8 @@ spec:
value: /var/run/secrets/kuma.io/kuma-sds/tls-cert/tls.crt
- name: KUMA_SDS_SERVER_TLS_KEY_FILE
value: /var/run/secrets/kuma.io/kuma-sds/tls-cert/tls.key
- name: KUMA_KDS_CLIENT_GLOBAL_ADDRESS
value: grpcs://192.168.0.1:5685
- name: KUMA_KDS_SERVER_TLS_CERT_FILE
value: /var/run/secrets/kuma.io/kuma-kds/tls-cert/tls.crt
- name: KUMA_KDS_SERVER_TLS_KEY_FILE
Expand Down
Loading