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

chore(*) rename remote cp to zone cp #2125

Merged
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
2 changes: 1 addition & 1 deletion api/mesh/v1alpha1/dataplane_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ func (d *Dataplane) HasAvailableServices() bool {
return len(d.Networking.Ingress.AvailableServices) != 0
}

func (d *Dataplane) IsRemoteIngress(localZone string) bool {
func (d *Dataplane) IsZoneIngress(localZone string) bool {
if !d.IsIngress() {
return false
}
Expand Down
1 change: 1 addition & 0 deletions api/mesh/v1alpha1/traffic_route_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (s SortedSplit) Less(i, j int) bool {
}
return less(s[i].Destination, s[j].Destination)
}

func (s SortedSplit) Swap(i, j int) { s[i], s[j] = s[j], s[i] }

func less(m1, m2 map[string]string) bool {
Expand Down
20 changes: 10 additions & 10 deletions api/system/v1alpha1/zone_insight.pb.go

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

20 changes: 10 additions & 10 deletions api/system/v1alpha1/zone_insight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ option go_package = "github.com/kumahq/kuma/api/system/v1alpha1";
import "google/protobuf/timestamp.proto";
import "validate/validate.proto";

// ZoneInsight defines the observed state of a Remote Kuma CP.
// ZoneInsight defines the observed state of a Zone Kuma CP.
message ZoneInsight {

// List of KDS subscriptions created by a given Remote Kuma CP.
// List of KDS subscriptions created by a given Zone Kuma CP.
repeated KDSSubscription subscriptions = 1;
}

// KDSSubscription describes a single KDS subscription
// created by a Remote to the Global.
// Ideally, there should be only one such subscription per Remote lifecycle.
// created by a Zone to the Global.
// Ideally, there should be only one such subscription per Zone lifecycle.
// Presence of multiple subscriptions might indicate one of the following
// events:
// - transient loss of network connection between Remote and Global Control
// - transient loss of network connection between Zone and Global Control
// Planes
// - Remote Kuma CP restarts (i.e. hot restart or crash)
// - Zone Kuma CP restarts (i.e. hot restart or crash)
// - Global Kuma CP restarts (i.e. rolling update or crash)
// - etc
message KDSSubscription {
Expand All @@ -32,17 +32,17 @@ message KDSSubscription {
// Global CP instance that handled given subscription.
string global_instance_id = 2 [ (validate.rules).string.min_len = 1 ];

// Time when a given Remote connected to the Global.
// Time when a given Zone connected to the Global.
google.protobuf.Timestamp connect_time = 3
[ (validate.rules).timestamp.required = true ];

// Time when a given Remote disconnected from the Global.
// Time when a given Zone disconnected from the Global.
google.protobuf.Timestamp disconnect_time = 4;

// Status of the KDS subscription.
KDSSubscriptionStatus status = 5 [ (validate.rules).message.required = true ];

// Version of Remote Kuma CP.
// Version of Zone Kuma CP.
Version version = 6;
}

Expand Down Expand Up @@ -74,7 +74,7 @@ message KDSServiceStats {
// Version defines version of Kuma ControlPlane
message Version {

// Version of Remote Kuma CP
// Version of Zone Kuma CP
KumaCpVersion kumaCp = 1;
}

Expand Down
8 changes: 4 additions & 4 deletions app/kuma-cp/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/kumahq/kuma/pkg/hds"
"github.com/kumahq/kuma/pkg/insights"
kds_global "github.com/kumahq/kuma/pkg/kds/global"
kds_remote "github.com/kumahq/kuma/pkg/kds/remote"
kds_zone "github.com/kumahq/kuma/pkg/kds/zone"
mads_server "github.com/kumahq/kuma/pkg/mads/server"
metrics "github.com/kumahq/kuma/pkg/metrics/components"
sds_server "github.com/kumahq/kuma/pkg/sds/server"
Expand Down Expand Up @@ -131,13 +131,13 @@ func newRunCmdWithOpts(opts runCmdOpts) *cobra.Command {
runLog.Error(err, "unable to set up Defaults")
return err
}
case config_core.Remote:
case config_core.Zone:
if err := mads_server.SetupServer(rt); err != nil {
runLog.Error(err, "unable to set up Monitoring Assignment server")
return err
}
if err := kds_remote.Setup(rt); err != nil {
runLog.Error(err, "unable to set up KDS Remote")
if err := kds_zone.Setup(rt); err != nil {
runLog.Error(err, "unable to set up KDS Zone")
return err
}
if err := dns.Setup(rt); err != nil {
Expand Down
2 changes: 2 additions & 0 deletions app/kuma-dp/pkg/dataplane/accesslogs/v2/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ type fakeSender []string
func (s *fakeSender) Connect() error {
return nil
}

func (s *fakeSender) Send(record string) error {
*s = append(*s, record)
return nil
}

func (s *fakeSender) Close() error {
return nil
}
4 changes: 2 additions & 2 deletions app/kumactl/cmd/apply/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ var _ = Describe("kumactl apply", func() {

// when
resource := mesh.NewMeshResource()
// with production code, the mesh is not required for remote store. API Server then infer mesh from the name
// with production code, the mesh is not required for zone store. API Server then infer mesh from the name
err = store.Get(context.Background(), resource, core_store.GetByKey("sample", ""))
Expect(err).ToNot(HaveOccurred())

Expand Down Expand Up @@ -265,7 +265,7 @@ var _ = Describe("kumactl apply", func() {

// when
resource := mesh.NewMeshResource()
// with production code, the mesh is not required for remote store. API Server then infer mesh from the name
// with production code, the mesh is not required for zone store. API Server then infer mesh from the name
err = store.Get(context.Background(), resource, core_store.GetByKey("meshinit", ""))
Expect(err).ToNot(HaveOccurred())

Expand Down
6 changes: 3 additions & 3 deletions app/kumactl/cmd/completion/testdata/bash.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2230,9 +2230,9 @@ _kumactl_install_control-plane()
flags+=("--tls-kds-global-server-secret=")
two_word_flags+=("--tls-kds-global-server-secret")
local_nonpersistent_flags+=("--tls-kds-global-server-secret=")
flags+=("--tls-kds-remote-client-secret=")
two_word_flags+=("--tls-kds-remote-client-secret")
local_nonpersistent_flags+=("--tls-kds-remote-client-secret=")
flags+=("--tls-kds-zone-client-secret=")
two_word_flags+=("--tls-kds-zone-client-secret")
local_nonpersistent_flags+=("--tls-kds-zone-client-secret=")
flags+=("--use-node-port")
local_nonpersistent_flags+=("--use-node-port")
flags+=("--without-kubernetes-connection")
Expand Down
4 changes: 2 additions & 2 deletions app/kumactl/cmd/completion/testdata/zsh.golden
Original file line number Diff line number Diff line change
Expand Up @@ -969,14 +969,14 @@ function _kumactl_install_control-plane {
'--ingress-use-node-port[use NodePort instead of LoadBalancer for the Ingress Service]' \
'--injector-failure-policy[failue policy of the mutating web hook implemented by the Kuma Injector component]:' \
'--kds-global-address[URL of Global Kuma CP (example: grpcs://192.168.0.1:5685)]:' \
'--mode[kuma cp modes: one of standalone|remote|global]:' \
'--mode[kuma cp modes: one of standalone|zone|global]:' \
'--namespace[namespace to install Kuma Control Plane to]:' \
'--tls-api-server-client-certs-secret[Secret that contains list of .pem certificates that can access admin endpoints of Kuma API on HTTPS]:' \
'--tls-api-server-secret[Secret that contains tls.crt, key.crt for protecting Kuma API on HTTPS]:' \
'--tls-general-ca-bundle[Base64 encoded CA certificate (the same as in controlPlane.tls.general.secret#ca.crt)]:' \
'--tls-general-secret[Secret that contains tls.crt, key.crt and ca.crt for protecting Kuma in-cluster communication]:' \
'--tls-kds-global-server-secret[Secret that contains tls.crt, key.crt for protecting cross cluster communication]:' \
'--tls-kds-remote-client-secret[Secret that contains ca.crt which was used to sign KDS Global server. Used for CP verification]:' \
'--tls-kds-zone-client-secret[Secret that contains ca.crt which was used to sign KDS Global server. Used for CP verification]:' \
'--use-node-port[use NodePort instead of LoadBalancer]' \
'--without-kubernetes-connection[install without connection to Kubernetes cluster. This can be used for initial Kuma installation, but not for upgrades]' \
'--zone[set the Kuma zone name]:' \
Expand Down
8 changes: 4 additions & 4 deletions app/kumactl/cmd/inspect/inspect_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func newInspectZonesCmd(ctx *cmd.RootContext) *cobra.Command {

func printZoneOverviews(now time.Time, zoneOverviews *system.ZoneOverviewResourceList, out io.Writer) error {
data := printers.Table{
Headers: []string{"NAME", "STATUS", "LAST CONNECTED AGO", "LAST UPDATED AGO", "TOTAL UPDATES", "TOTAL ERRORS", "REMOTE-CP VERSION"},
Headers: []string{"NAME", "STATUS", "LAST CONNECTED AGO", "LAST UPDATED AGO", "TOTAL UPDATES", "TOTAL ERRORS", "ZONE-CP VERSION"},
NextRow: func() func() []string {
i := 0
return func() []string {
Expand All @@ -76,10 +76,10 @@ func printZoneOverviews(now time.Time, zoneOverviews *system.ZoneOverviewResourc
}
lastUpdated := util_proto.MustTimestampFromProto(lastSubscription.GetStatus().GetLastUpdateTime())

var remoteCpVersion string
var zoneCPVersion string
if lastSubscription.GetVersion() != nil {
if lastSubscription.Version.KumaCp != nil {
remoteCpVersion = lastSubscription.Version.KumaCp.Version
zoneCPVersion = lastSubscription.Version.KumaCp.Version
}
}

Expand All @@ -90,7 +90,7 @@ func printZoneOverviews(now time.Time, zoneOverviews *system.ZoneOverviewResourc
table.Ago(lastUpdated, now), // LAST UPDATED AGO
table.Number(totalResponsesSent), // TOTAL UPDATES
table.Number(totalResponsesRejected), // TOTAL ERRORS
remoteCpVersion, // REMOTE-CP VERSION
zoneCPVersion, // ZONE-CP VERSION
}
}
}(),
Expand Down
4 changes: 2 additions & 2 deletions app/kumactl/cmd/inspect/testdata/inspect-zones.golden.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME STATUS LAST CONNECTED AGO LAST UPDATED AGO TOTAL UPDATES TOTAL ERRORS REMOTE-CP VERSION
NAME STATUS LAST CONNECTED AGO LAST UPDATED AGO TOTAL UPDATES TOTAL ERRORS ZONE-CP VERSION
zone-1 Online 2h never 42 13 1.0.0
zone-2 Offline never never 0 0
zone-3 Offline 2h never 0 0 1.0.0
zone-3 Offline 2h never 0 0 1.0.0
62 changes: 31 additions & 31 deletions app/kumactl/cmd/install/context/install_control_plane_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type InstallControlPlaneArgs struct {
ControlPlane_tls_apiServer_secret string `helm:"controlPlane.tls.apiServer.secretName"`
ControlPlane_tls_apiServer_clientCertsSecret string `helm:"controlPlane.tls.apiServer.clientCertsSecretName"`
ControlPlane_tls_kdsGlobalServer_secret string `helm:"controlPlane.tls.kdsGlobalServer.secretName"`
ControlPlane_tls_kdsRemoteClient_secret string `helm:"controlPlane.tls.kdsRemoteClient.secretName"`
ControlPlane_tls_kdsZoneClient_secret string `helm:"controlPlane.tls.kdsZoneClient.secretName"`
ControlPlane_injectorFailurePolicy string `helm:"controlPlane.injectorFailurePolicy"`
ControlPlane_secrets []ImageEnvSecret `helm:"controlPlane.secrets"`
ControlPlane_envVars map[string]string `helm:"controlPlane.envVars"`
Expand All @@ -41,7 +41,7 @@ type InstallControlPlaneArgs struct {
Cni_image_tag string `helm:"cni.image.tag"`
ControlPlane_mode string `helm:"controlPlane.mode"`
ControlPlane_zone string `helm:"controlPlane.zone"`
ControlPlane_globalRemoteSyncService_type string `helm:"controlPlane.globalRemoteSyncService.type"`
ControlPlane_globalZoneSyncService_type string `helm:"controlPlane.globalZoneSyncService.type"`
Ingress_enabled bool `helm:"ingress.enabled"`
Ingress_mesh string `helm:"ingress.mesh"`
Ingress_drainTime string `helm:"ingress.drainTime"`
Expand All @@ -66,35 +66,35 @@ type InstallCpContext struct {
func DefaultInstallCpContext() InstallCpContext {
return InstallCpContext{
Args: InstallControlPlaneArgs{
Namespace: "kuma-system",
ControlPlane_image_pullPolicy: "IfNotPresent",
ControlPlane_image_registry: "docker.io/kumahq",
ControlPlane_image_repository: "kuma-cp",
ControlPlane_image_tag: kuma_version.Build.Version,
ControlPlane_service_name: "kuma-control-plane",
ControlPlane_envVars: map[string]string{},
ControlPlane_injectorFailurePolicy: "Ignore",
DataPlane_image_registry: "docker.io/kumahq",
DataPlane_image_repository: "kuma-dp",
DataPlane_image_tag: kuma_version.Build.Version,
DataPlane_initImage_registry: "docker.io/kumahq",
DataPlane_initImage_repository: "kuma-init",
DataPlane_initImage_tag: kuma_version.Build.Version,
Cni_enabled: false,
Cni_chained: false,
Cni_net_dir: "/etc/cni/multus/net.d",
Cni_bin_dir: "/var/lib/cni/bin",
Cni_conf_name: "kuma-cni.conf",
Cni_image_registry: "docker.io/lobkovilya",
Cni_image_repository: "install-cni",
Cni_image_tag: "0.0.8",
ControlPlane_mode: core.Standalone,
ControlPlane_zone: "",
ControlPlane_globalRemoteSyncService_type: "LoadBalancer",
Ingress_enabled: false,
Ingress_mesh: "default",
Ingress_drainTime: "30s",
Ingress_service_type: "LoadBalancer",
Namespace: "kuma-system",
ControlPlane_image_pullPolicy: "IfNotPresent",
ControlPlane_image_registry: "docker.io/kumahq",
ControlPlane_image_repository: "kuma-cp",
ControlPlane_image_tag: kuma_version.Build.Version,
ControlPlane_service_name: "kuma-control-plane",
ControlPlane_envVars: map[string]string{},
ControlPlane_injectorFailurePolicy: "Ignore",
DataPlane_image_registry: "docker.io/kumahq",
DataPlane_image_repository: "kuma-dp",
DataPlane_image_tag: kuma_version.Build.Version,
DataPlane_initImage_registry: "docker.io/kumahq",
DataPlane_initImage_repository: "kuma-init",
DataPlane_initImage_tag: kuma_version.Build.Version,
Cni_enabled: false,
Cni_chained: false,
Cni_net_dir: "/etc/cni/multus/net.d",
Cni_bin_dir: "/var/lib/cni/bin",
Cni_conf_name: "kuma-cni.conf",
Cni_image_registry: "docker.io/lobkovilya",
Cni_image_repository: "install-cni",
Cni_image_tag: "0.0.8",
ControlPlane_mode: core.Standalone,
ControlPlane_zone: "",
ControlPlane_globalZoneSyncService_type: "LoadBalancer",
Ingress_enabled: false,
Ingress_mesh: "default",
Ingress_drainTime: "30s",
Ingress_service_type: "LoadBalancer",
},
NewSelfSignedCert: tls.NewSelfSignedCert,
InstallCpTemplateFiles: func(args *InstallControlPlaneArgs) (data.FileList, error) {
Expand Down
Loading