From e2c2239c64e936ec8b6e931ceee60bdbc34c1f2e Mon Sep 17 00:00:00 2001 From: Robert Grandl Date: Mon, 7 Aug 2023 09:21:21 -0700 Subject: [PATCH] Enable support to create app in any namespace (#43) * Enable support to create app in any namespace Before this PR, the Kube deployer was able to deploy an app only in the default namespace. With this PR, the user can deploy an app in any namespace. The custom namespace can be specified through config. * fixed Srdjan's comments --- cmd/weaver-kube/deploy.go | 3 + go.mod | 2 +- go.sum | 4 +- internal/impl/babysitter.go | 2 +- internal/impl/kube.go | 162 +++++++++++++++++++++++++----------- internal/impl/kube.pb.go | 56 ++++++++----- internal/impl/kube.proto | 1 + 7 files changed, 154 insertions(+), 76 deletions(-) diff --git a/cmd/weaver-kube/deploy.go b/cmd/weaver-kube/deploy.go index b2f1ac9..92bc729 100644 --- a/cmd/weaver-kube/deploy.go +++ b/cmd/weaver-kube/deploy.go @@ -112,6 +112,9 @@ func deploy(ctx context.Context, args []string) error { if config.Image == "" { return fmt.Errorf("No image name provided in config file. See `weaver kube deploy --help` for details") } + if config.Namespace == "" { + config.Namespace = "default" + } binListeners, err := bin.ReadListeners(app.Binary) if err != nil { return fmt.Errorf("cannot read listeners from binary %s: %w", app.Binary, err) diff --git a/go.mod b/go.mod index 92dda5a..21f9ca2 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/ServiceWeaver/weaver-kube go 1.21 require ( - github.com/ServiceWeaver/weaver v0.18.0 + github.com/ServiceWeaver/weaver v0.18.1 github.com/google/uuid v1.3.0 go.opentelemetry.io/otel v1.16.0 go.opentelemetry.io/otel/exporters/jaeger v1.16.0 diff --git a/go.sum b/go.sum index b02d9bb..4a07c4c 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/DataDog/hyperloglog v0.0.0-20220804205443-1806d9b66146 h1:S5WsRc58vIe github.com/DataDog/hyperloglog v0.0.0-20220804205443-1806d9b66146/go.mod h1:hFPkswc42pKhRbeKDKXy05mRi7J1kJ2vMNbvd9erH0M= github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 h1:EbzDX8HPk5uE2FsJYxD74QmMw0/3CqSKhEr6teh0ncQ= github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= -github.com/ServiceWeaver/weaver v0.18.0 h1:b62r1E9mYnCaPEH+KOT34FsMjSZNLFSlXEnNLTR0pyM= -github.com/ServiceWeaver/weaver v0.18.0/go.mod h1:/tJzitb+h8nLeHa4Mk7iIGU5ZV4OGB4C9IvIfD8n/1I= +github.com/ServiceWeaver/weaver v0.18.1 h1:SE3YhFO58xm3zjYY1wF4Lbz928m27tmQdnbEsdagil4= +github.com/ServiceWeaver/weaver v0.18.1/go.mod h1:/tJzitb+h8nLeHa4Mk7iIGU5ZV4OGB4C9IvIfD8n/1I= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= diff --git a/internal/impl/babysitter.go b/internal/impl/babysitter.go index 7e3139b..7e18c16 100644 --- a/internal/impl/babysitter.go +++ b/internal/impl/babysitter.go @@ -188,7 +188,7 @@ func (b *babysitter) watchPods(ctx context.Context, component string) error { rs := replicaSet(component, b.cfg.Deployment) name := name{b.cfg.Deployment.App.Name, rs, b.cfg.Deployment.Id[:8]}.DNSLabel() opts := metav1.ListOptions{LabelSelector: fmt.Sprintf("depName=%s", name)} - watcher, err := b.clientset.CoreV1().Pods("default").Watch(ctx, opts) + watcher, err := b.clientset.CoreV1().Pods(b.cfg.Namespace).Watch(ctx, opts) if err != nil { return fmt.Errorf("watch pods for component %s: %w", component, err) } diff --git a/internal/impl/kube.go b/internal/impl/kube.go index a1831fe..d9ebdc8 100644 --- a/internal/impl/kube.go +++ b/internal/impl/kube.go @@ -126,9 +126,10 @@ var dashboardContent string // replicaSetInfo contains information associated with a replica set. type replicaSetInfo struct { - name string // name of the replica set - image string // name of the image to be deployed - dep *protos.Deployment // deployment info + name string // name of the replica set + image string // name of the image to be deployed + namespace string // namespace where the replica set will be deployed + dep *protos.Deployment // deployment info // set of the components hosted by the replica set and their listeners, // keyed by component name. @@ -165,6 +166,11 @@ type KubeConfig struct { // Image, so Image should not already contain a tag. Image string + // Namespace is the name of the Kubernetes namespace where the application + // should be deployed. If not specified, the application will be deployed in + // the default namespace. + Namespace string + // Options for the application listeners, keyed by listener name. // If a listener isn't specified in the map, default options will be used. Listeners map[string]*ListenerOptions @@ -213,14 +219,18 @@ func (r *replicaSetInfo) buildDeployment() (*v1.Deployment, error) { APIVersion: "apps/v1", Kind: "Deployment", }, - ObjectMeta: metav1.ObjectMeta{Name: name}, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: r.namespace, + }, Spec: appsv1.DeploymentSpec{ Selector: &metav1.LabelSelector{ MatchLabels: matchLabels, }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: podLabels, + Labels: podLabels, + Namespace: r.namespace, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{container}, @@ -260,7 +270,8 @@ func (r *replicaSetInfo) buildListenerService(lis *ReplicaSetConfig_Listener) (* Kind: "Service", }, ObjectMeta: metav1.ObjectMeta{ - Name: globalLisName, + Name: globalLisName, + Namespace: r.namespace, Labels: map[string]string{ "lisName": lis.Name, }, @@ -297,7 +308,10 @@ func (r *replicaSetInfo) buildAutoscaler() (*v2.HorizontalPodAutoscaler, error) APIVersion: "autoscaling/v2", Kind: "HorizontalPodAutoscaler", }, - ObjectMeta: metav1.ObjectMeta{Name: aname}, + ObjectMeta: metav1.ObjectMeta{ + Name: aname, + Namespace: r.namespace, + }, Spec: v2.HorizontalPodAutoscalerSpec{ ScaleTargetRef: v2.CrossVersionObjectReference{ APIVersion: "apps/v1", @@ -330,6 +344,7 @@ func (r *replicaSetInfo) buildContainer() (corev1.Container, error) { // docker image. r.dep.App.Binary = fmt.Sprintf("/weaver/%s", filepath.Base(r.dep.App.Binary)) kubeCfgStr, err := proto.ToEnv(&ReplicaSetConfig{ + Namespace: r.namespace, Deployment: r.dep, ReplicaSet: r.name, ComponentsToStart: r.components, @@ -420,7 +435,7 @@ func GenerateKubeDeployment(image string, dep *protos.Deployment, cfg *KubeConfi // Generate roles and role bindings. var generated []byte - content, err := generateRolesAndBindings() + content, err := generateRolesAndBindings(cfg.Namespace) if err != nil { return fmt.Errorf("unable to generate roles and bindings: %w", err) } @@ -439,36 +454,38 @@ func GenerateKubeDeployment(image string, dep *protos.Deployment, cfg *KubeConfi } generated = append(generated, content...) + // Generate deployment info needed to get insights into the application. + // Generate the Jaeger deployment info. - content, err = generateJaegerDeployment(dep) + content, err = generateJaegerDeployment(dep, cfg.Namespace) if err != nil { return fmt.Errorf("unable to create kube jaeger deployment: %w", err) } generated = append(generated, content...) // Generate the Prometheus deployment info. - content, err = generatePrometheusDeployment(dep) + content, err = generatePrometheusDeployment(dep, cfg.Namespace) if err != nil { return fmt.Errorf("unable to create kube deployment for the Prometheus service: %w", err) } generated = append(generated, content...) // Generate the Loki deployment info. - content, err = generateLokiDeployment(dep) + content, err = generateLokiDeployment(dep, cfg.Namespace) if err != nil { return fmt.Errorf("unable to create kube deployment for the Loki service: %w", err) } generated = append(generated, content...) // Generate the Promtail deployment info. - content, err = generatePromtailDeployment(dep) + content, err = generatePromtailDeployment(dep, cfg.Namespace) if err != nil { return fmt.Errorf("unable to create kube deployment for Promtail: %w", err) } generated = append(generated, content...) // Generate the Grafana deployment info. - content, err = generateGrafanaDeployment(dep) + content, err = generateGrafanaDeployment(dep, cfg.Namespace) if err != nil { return fmt.Errorf("unable to create kube deployment for the Grafana service: %w", err) } @@ -489,22 +506,24 @@ func GenerateKubeDeployment(image string, dep *protos.Deployment, cfg *KubeConfi return nil } -// generateRolesAndBindings generates Kubernetes roles and role bindings that -// grant permissions to the appropriate service accounts. -func generateRolesAndBindings() ([]byte, error) { +// generateRolesAndBindings generates Kubernetes roles and role bindings in +// namespace that grant permissions to the appropriate service accounts. +func generateRolesAndBindings(namespace string) ([]byte, error) { // Grant the default service account the permission to get, list, and watch // pods. The babysitter watches pods to generate routing info. // // TODO(mwhittaker): This leaks permissions to the user's code. We should // avoid that. We might have to run the babysitter and weavelet in separate // containers or pods. + role := rbacv1.Role{ TypeMeta: metav1.TypeMeta{ APIVersion: "rbac.authorization.k8s.io/v1", Kind: "Role", }, ObjectMeta: metav1.ObjectMeta{ - Name: "pods-getter", + Name: "pods-getter", + Namespace: namespace, }, Rules: []rbacv1.PolicyRule{ { @@ -521,7 +540,8 @@ func generateRolesAndBindings() ([]byte, error) { Kind: "RoleBinding", }, ObjectMeta: metav1.ObjectMeta{ - Name: "default-pods-getter", + Name: "default-pods-getter", + Namespace: namespace, }, RoleRef: rbacv1.RoleRef{ APIGroup: "rbac.authorization.k8s.io", @@ -530,8 +550,9 @@ func generateRolesAndBindings() ([]byte, error) { }, Subjects: []rbacv1.Subject{ { - Kind: "ServiceAccount", - Name: "default", + Kind: "ServiceAccount", + Name: "default", + Namespace: namespace, }, }, } @@ -616,14 +637,14 @@ func generateAppDeployment(replicaSets map[string]*replicaSetInfo) ([]byte, erro } // generateJaegerDeployment generates the Jaeger kubernetes deployment and service -// information for a given app. +// information for a given app in namespace. // // Note that we run a single instance of Jaeger. This is because we are using // a Jaeger image that combines three Jaeger components, agent, collector, and // query service/UI in a single image. // TODO(rgrandl): If the trace volume can't be handled by a single instance, we // should scale these components independently, and use different image(s). -func generateJaegerDeployment(dep *protos.Deployment) ([]byte, error) { +func generateJaegerDeployment(dep *protos.Deployment, namespace string) ([]byte, error) { jname := name{dep.App.Name, jaegerAppName}.DNSLabel() // Generate the Jaeger deployment. @@ -632,7 +653,10 @@ func generateJaegerDeployment(dep *protos.Deployment) ([]byte, error) { APIVersion: "apps/v1", Kind: "Deployment", }, - ObjectMeta: metav1.ObjectMeta{Name: jname}, + ObjectMeta: metav1.ObjectMeta{ + Name: jname, + Namespace: namespace, + }, Spec: appsv1.DeploymentSpec{ Replicas: ptrOf(int32(1)), Selector: &metav1.LabelSelector{ @@ -645,6 +669,7 @@ func generateJaegerDeployment(dep *protos.Deployment) ([]byte, error) { Labels: map[string]string{ "jaeger": jname, }, + Namespace: namespace, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -678,7 +703,10 @@ func generateJaegerDeployment(dep *protos.Deployment) ([]byte, error) { APIVersion: "v1", Kind: "Service", }, - ObjectMeta: metav1.ObjectMeta{Name: jname}, + ObjectMeta: metav1.ObjectMeta{ + Name: jname, + Namespace: namespace, + }, Spec: corev1.ServiceSpec{ Selector: map[string]string{"jaeger": jname}, Ports: []corev1.ServicePort{ @@ -710,13 +738,13 @@ func generateJaegerDeployment(dep *protos.Deployment) ([]byte, error) { } // generatePrometheusDeployment generates the kubernetes configurations to deploy -// a Prometheus service for a given app. +// a Prometheus service for a given app in namespace. // // TODO(rgrandl): check if we can simplify the config map, and the deployment info. // // TODO(rgrandl): We run a single instance of Prometheus for now. We might want // to scale it up if it becomes a bottleneck. -func generatePrometheusDeployment(dep *protos.Deployment) ([]byte, error) { +func generatePrometheusDeployment(dep *protos.Deployment, namespace string) ([]byte, error) { cname := name{dep.App.Name, "prometheus", "config"}.DNSLabel() pname := name{dep.App.Name, "prometheus"}.DNSLabel() @@ -732,13 +760,13 @@ scrape_configs: - role: pod namespaces: names: - - default + - %s scheme: http relabel_configs: - source_labels: [__meta_kubernetes_pod_label_metrics] regex: "%s" action: keep -`, pname, prometheusEndpoint, dep.App.Name) +`, pname, prometheusEndpoint, namespace, dep.App.Name) // Create a config map to store the prometheus config. cm := corev1.ConfigMap{ @@ -746,7 +774,10 @@ scrape_configs: Kind: "ConfigMap", APIVersion: "v1", }, - ObjectMeta: metav1.ObjectMeta{Name: cname}, + ObjectMeta: metav1.ObjectMeta{ + Name: cname, + Namespace: namespace, + }, Data: map[string]string{ "prometheus.yaml": config, }, @@ -767,7 +798,10 @@ scrape_configs: APIVersion: "apps/v1", Kind: "Deployment", }, - ObjectMeta: metav1.ObjectMeta{Name: pname}, + ObjectMeta: metav1.ObjectMeta{ + Name: pname, + Namespace: namespace, + }, Spec: appsv1.DeploymentSpec{ Replicas: ptrOf(int32(1)), Selector: &metav1.LabelSelector{ @@ -775,7 +809,8 @@ scrape_configs: }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"prometheus": pname}, + Labels: map[string]string{"prometheus": pname}, + Namespace: namespace, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -845,7 +880,10 @@ scrape_configs: APIVersion: "v1", Kind: "Service", }, - ObjectMeta: metav1.ObjectMeta{Name: pname}, + ObjectMeta: metav1.ObjectMeta{ + Name: pname, + Namespace: namespace, + }, Spec: corev1.ServiceSpec{ Selector: map[string]string{"prometheus": pname}, Ports: []corev1.ServicePort{ @@ -869,13 +907,13 @@ scrape_configs: } // generateLokiDeployment generates the kubernetes configurations to deploy -// a Loki service for a given app. +// a Loki service for a given app in namespace. // // TODO(rgrandl): check if we can simplify the config map, and the deployment info. // // TODO(rgrandl): We run a single instance of Loki for now. We might want // to scale it up if it becomes a bottleneck. -func generateLokiDeployment(dep *protos.Deployment) ([]byte, error) { +func generateLokiDeployment(dep *protos.Deployment, namespace string) ([]byte, error) { cname := name{dep.App.Name, "loki", "config"}.DNSLabel() lname := name{dep.App.Name, "loki"}.DNSLabel() @@ -927,7 +965,10 @@ schema_config: Kind: "ConfigMap", APIVersion: "v1", }, - ObjectMeta: metav1.ObjectMeta{Name: cname}, + ObjectMeta: metav1.ObjectMeta{ + Name: cname, + Namespace: namespace, + }, Data: map[string]string{ "loki.yaml": config, }, @@ -948,7 +989,10 @@ schema_config: APIVersion: "apps/v1", Kind: "Deployment", }, - ObjectMeta: metav1.ObjectMeta{Name: lname}, + ObjectMeta: metav1.ObjectMeta{ + Name: lname, + Namespace: namespace, + }, Spec: appsv1.DeploymentSpec{ Replicas: ptrOf(int32(1)), Selector: &metav1.LabelSelector{ @@ -956,7 +1000,8 @@ schema_config: }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"loki": lname}, + Labels: map[string]string{"loki": lname}, + Namespace: namespace, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -1017,7 +1062,10 @@ schema_config: APIVersion: "v1", Kind: "Service", }, - ObjectMeta: metav1.ObjectMeta{Name: lname}, + ObjectMeta: metav1.ObjectMeta{ + Name: lname, + Namespace: namespace, + }, Spec: corev1.ServiceSpec{ Selector: map[string]string{"loki": lname}, Ports: []corev1.ServicePort{ @@ -1042,7 +1090,7 @@ schema_config: // generatePromtailDeployment generates information that is needed to run a // Promtail agent on each node in order to scrape the logs. -func generatePromtailDeployment(dep *protos.Deployment) ([]byte, error) { +func generatePromtailDeployment(dep *protos.Deployment, namespace string) ([]byte, error) { promName := name{dep.App.Name, "promtail"}.DNSLabel() lname := name{dep.App.Name, "loki"}.DNSLabel() @@ -1070,7 +1118,7 @@ scrape_configs: - role: pod namespaces: names: - - default + - %s relabel_configs: - source_labels: - __meta_kubernetes_pod_label_appName @@ -1091,7 +1139,7 @@ scrape_configs: - __meta_kubernetes_pod_uid - __meta_kubernetes_pod_container_name target_label: __path__ -`, lname, lokiPort, dep.App.Name) +`, lname, lokiPort, namespace, dep.App.Name) // Config is stored as a config map in the daemonset. cm := corev1.ConfigMap{ @@ -1099,7 +1147,10 @@ scrape_configs: Kind: "ConfigMap", APIVersion: "v1", }, - ObjectMeta: metav1.ObjectMeta{Name: promName}, + ObjectMeta: metav1.ObjectMeta{ + Name: promName, + Namespace: namespace, + }, Data: map[string]string{ "promtail.yaml": config, }, @@ -1123,7 +1174,8 @@ scrape_configs: APIVersion: "apps/v1", }, ObjectMeta: metav1.ObjectMeta{ - Name: promName, + Name: promName, + Namespace: namespace, }, Spec: appsv1.DaemonSetSpec{ Selector: &metav1.LabelSelector{ @@ -1136,6 +1188,7 @@ scrape_configs: Labels: map[string]string{ "promtail": promName, }, + Namespace: namespace, }, Spec: corev1.PodSpec{ ServiceAccountName: "default", @@ -1242,11 +1295,11 @@ scrape_configs: } // generateGrafanaDeployment generates the kubernetes configurations to deploy -// a Grafana service for a given app. +// a Grafana service for a given app in namespace. // // TODO(rgrandl): We run a single instance of Grafana for now. We might want // to scale it up if it becomes a bottleneck. -func generateGrafanaDeployment(dep *protos.Deployment) ([]byte, error) { +func generateGrafanaDeployment(dep *protos.Deployment, namespace string) ([]byte, error) { cname := name{dep.App.Name, "grafana", "config"}.DNSLabel() gname := name{dep.App.Name, "grafana"}.DNSLabel() pname := name{dep.App.Name, "prometheus"}.DNSLabel() @@ -1295,7 +1348,10 @@ providers: Kind: "ConfigMap", APIVersion: "v1", }, - ObjectMeta: metav1.ObjectMeta{Name: cname}, + ObjectMeta: metav1.ObjectMeta{ + Name: cname, + Namespace: namespace, + }, Data: map[string]string{ "grafana.yaml": config, "dashboard-config.yaml": dashboard, @@ -1318,7 +1374,10 @@ providers: APIVersion: "apps/v1", Kind: "Deployment", }, - ObjectMeta: metav1.ObjectMeta{Name: gname}, + ObjectMeta: metav1.ObjectMeta{ + Name: gname, + Namespace: namespace, + }, Spec: appsv1.DeploymentSpec{ Replicas: ptrOf(int32(1)), Selector: &metav1.LabelSelector{ @@ -1326,7 +1385,8 @@ providers: }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"grafana": gname}, + Labels: map[string]string{"grafana": gname}, + Namespace: namespace, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -1447,7 +1507,10 @@ providers: APIVersion: "v1", Kind: "Service", }, - ObjectMeta: metav1.ObjectMeta{Name: gname}, + ObjectMeta: metav1.ObjectMeta{ + Name: gname, + Namespace: namespace, + }, Spec: corev1.ServiceSpec{ Selector: map[string]string{"grafana": gname}, Ports: []corev1.ServicePort{ @@ -1491,6 +1554,7 @@ func buildReplicaSetSpecs(dep *protos.Deployment, image string, cfg *KubeConfig) rsets[rsName] = &replicaSetInfo{ name: rsName, image: image, + namespace: cfg.Namespace, dep: dep, components: map[string]*ReplicaSetConfig_Listeners{}, internalPort: internalPort, diff --git a/internal/impl/kube.pb.go b/internal/impl/kube.pb.go index 74da6d6..cdca779 100644 --- a/internal/impl/kube.pb.go +++ b/internal/impl/kube.pb.go @@ -46,6 +46,7 @@ type ReplicaSetConfig struct { ReplicaSet string `protobuf:"bytes,2,opt,name=replica_set,json=replicaSet,proto3" json:"replica_set,omitempty"` ComponentsToStart map[string]*ReplicaSetConfig_Listeners `protobuf:"bytes,3,rep,name=components_to_start,json=componentsToStart,proto3" json:"components_to_start,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` InternalPort int32 `protobuf:"varint,4,opt,name=internal_port,json=internalPort,proto3" json:"internal_port,omitempty"` + Namespace string `protobuf:"bytes,5,opt,name=namespace,proto3" json:"namespace,omitempty"` } func (x *ReplicaSetConfig) Reset() { @@ -108,6 +109,13 @@ func (x *ReplicaSetConfig) GetInternalPort() int32 { return 0 } +func (x *ReplicaSetConfig) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + type ReplicaSetConfig_Listeners struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -224,7 +232,7 @@ var file_internal_impl_kube_proto_rawDesc = []byte{ 0x0a, 0x18, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6d, 0x70, 0x6c, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x69, 0x6d, 0x70, 0x6c, 0x1a, 0x1b, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82, 0x04, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x04, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x33, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, @@ -239,28 +247,30 @@ var file_internal_impl_kube_proto_rawDesc = []byte{ 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x1a, 0x4a, 0x0a, 0x09, - 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x6c, 0x69, 0x73, - 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, - 0x6d, 0x70, 0x6c, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x6c, - 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x1a, 0x60, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, - 0x65, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, - 0x09, 0x69, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x1a, 0x66, 0x0a, 0x16, 0x43, 0x6f, - 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6d, 0x70, 0x6c, 0x2e, 0x52, 0x65, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x57, 0x65, 0x61, 0x76, 0x65, 0x72, 0x2f, 0x77, - 0x65, 0x61, 0x76, 0x65, 0x72, 0x2d, 0x6b, 0x75, 0x62, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6d, 0x70, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x1a, 0x4a, 0x0a, 0x09, 0x4c, 0x69, + 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x65, + 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6d, 0x70, + 0x6c, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x6c, 0x69, 0x73, + 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x1a, 0x60, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, + 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x65, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, + 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x1a, 0x66, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x54, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6d, 0x70, 0x6c, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x57, 0x65, 0x61, 0x76, 0x65, 0x72, 0x2f, 0x77, 0x65, 0x61, + 0x76, 0x65, 0x72, 0x2d, 0x6b, 0x75, 0x62, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x69, 0x6d, 0x70, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/impl/kube.proto b/internal/impl/kube.proto index 1a07226..1eb7b55 100644 --- a/internal/impl/kube.proto +++ b/internal/impl/kube.proto @@ -34,4 +34,5 @@ message ReplicaSetConfig { string replica_set = 2; map components_to_start = 3; int32 internal_port = 4; + string namespace = 5; }