Skip to content

Commit

Permalink
feat: support namespace scope installation (#112)
Browse files Browse the repository at this point in the history
* feat: support namespace scope installation

Signed-off-by: Derek Wang <whynowy@gmail.com>
  • Loading branch information
whynowy committed Jul 16, 2022
1 parent c525482 commit a45b2ee
Show file tree
Hide file tree
Showing 22 changed files with 13,133 additions and 62 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ crds:
.PHONY: manifests
manifests: crds
kubectl kustomize config/cluster-install > config/install.yaml
kubectl kustomize config/namespace-install > config/namespace-install.yaml

$(GOPATH)/bin/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin v1.46.2
Expand Down
4 changes: 3 additions & 1 deletion cmd/commands/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ func Test_Commands(t *testing.T) {
t.Run("Controller", func(t *testing.T) {
cmd := NewControllerCommand()
assert.Equal(t, "controller", cmd.Use)
assert.False(t, cmd.HasLocalFlags())
assert.True(t, cmd.HasLocalFlags())
assert.Equal(t, "string", cmd.Flag("managed-namespace").Value.Type())
assert.Equal(t, "bool", cmd.Flag("namespaced").Value.Type())
})

t.Run("BuiltinUDF", func(t *testing.T) {
Expand Down
10 changes: 9 additions & 1 deletion cmd/commands/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@ package commands

import (
ctrlcmd "github.com/numaproj/numaflow/controllers/cmd"
sharedutil "github.com/numaproj/numaflow/pkg/shared/util"
"github.com/spf13/cobra"
)

func NewControllerCommand() *cobra.Command {

var (
namespaced bool
managedNamespace string
)

command := &cobra.Command{
Use: "controller",
Short: "Start a Numaflow controller",
Run: func(cmd *cobra.Command, args []string) {
ctrlcmd.Start()
ctrlcmd.Start(namespaced, managedNamespace)
},
}
command.Flags().BoolVar(&namespaced, "namespaced", false, "Whether to run in namespaced scope, defaults to false.")
command.Flags().StringVar(&managedNamespace, "managed-namespace", sharedutil.LookupEnvStringOr("NAMESPACE", "numaflow-system"), "The namespace that the controller watches when \"--namespaced\" is \"true\".")
return command
}
15 changes: 7 additions & 8 deletions config/base/crds/numaflow.numaproj.io_pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,13 @@ spec:
bufferMaxLength:
description: BufferMaxLength is used to define the max length
of a buffer. It overrides the settings from pipeline limits.
Only meaningful for UDF and Source vertice as only they
do buffer write.
format: int64
type: integer
bufferUsageLimit:
description: BufferUsageLimit is used to define the pencentage
of the buffer usage limit, a valid value should be less
than 100, for example, 85. It overrides the settings from
pipeline limits. Only meaningful for UDF and Source vertice
as only they do buffer write.
pipeline limits.
format: int32
type: integer
type: object
Expand Down Expand Up @@ -148,8 +145,8 @@ spec:
type: integer
readTimeout:
default: 1s
description: Read timeout seconds for all the vertices in the
pipeline, can be overridden by the vertex's limit settings
description: Read timeout for all the vertices in the pipeline,
can be overridden by the vertex's limit settings
type: string
type: object
vertices:
Expand Down Expand Up @@ -1386,11 +1383,13 @@ spec:
pipeline level settings
properties:
readBatchSize:
description: Read batch size
description: Read batch size from the source or buffer.
It overrides the settings from pipeline limits.
format: int64
type: integer
readTimeout:
description: Read timeout duration
description: Read timeout duration from the source or buffer
It overrides the settings from pipeline limits.
type: string
type: object
metadata:
Expand Down
16 changes: 6 additions & 10 deletions config/base/crds/numaflow.numaproj.io_vertices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1214,16 +1214,13 @@ spec:
bufferMaxLength:
description: BufferMaxLength is used to define the max length
of a buffer. It overrides the settings from pipeline limits.
Only meaningful for UDF and Source vertice as only they
do buffer write.
format: int64
type: integer
bufferUsageLimit:
description: BufferUsageLimit is used to define the pencentage
of the buffer usage limit, a valid value should be less
than 100, for example, 85. It overrides the settings from
pipeline limits. Only meaningful for UDF and Source vertice
as only they do buffer write.
pipeline limits.
format: int32
type: integer
type: object
Expand Down Expand Up @@ -1259,11 +1256,13 @@ spec:
level settings
properties:
readBatchSize:
description: Read batch size
description: Read batch size from the source or buffer. It overrides
the settings from pipeline limits.
format: int64
type: integer
readTimeout:
description: Read timeout duration
description: Read timeout duration from the source or buffer It
overrides the settings from pipeline limits.
type: string
type: object
metadata:
Expand Down Expand Up @@ -1938,16 +1937,13 @@ spec:
bufferMaxLength:
description: BufferMaxLength is used to define the max length
of a buffer. It overrides the settings from pipeline limits.
Only meaningful for UDF and Source vertice as only they
do buffer write.
format: int64
type: integer
bufferUsageLimit:
description: BufferUsageLimit is used to define the pencentage
of the buffer usage limit, a valid value should be less
than 100, for example, 85. It overrides the settings from
pipeline limits. Only meaningful for UDF and Source vertice
as only they do buffer write.
pipeline limits.
format: int32
type: integer
type: object
Expand Down
31 changes: 13 additions & 18 deletions config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4792,16 +4792,13 @@ spec:
bufferMaxLength:
description: BufferMaxLength is used to define the max length
of a buffer. It overrides the settings from pipeline limits.
Only meaningful for UDF and Source vertice as only they
do buffer write.
format: int64
type: integer
bufferUsageLimit:
description: BufferUsageLimit is used to define the pencentage
of the buffer usage limit, a valid value should be less
than 100, for example, 85. It overrides the settings from
pipeline limits. Only meaningful for UDF and Source vertice
as only they do buffer write.
pipeline limits.
format: int32
type: integer
type: object
Expand Down Expand Up @@ -4874,8 +4871,8 @@ spec:
type: integer
readTimeout:
default: 1s
description: Read timeout seconds for all the vertices in the
pipeline, can be overridden by the vertex's limit settings
description: Read timeout for all the vertices in the pipeline,
can be overridden by the vertex's limit settings
type: string
type: object
vertices:
Expand Down Expand Up @@ -6112,11 +6109,13 @@ spec:
pipeline level settings
properties:
readBatchSize:
description: Read batch size
description: Read batch size from the source or buffer.
It overrides the settings from pipeline limits.
format: int64
type: integer
readTimeout:
description: Read timeout duration
description: Read timeout duration from the source or buffer
It overrides the settings from pipeline limits.
type: string
type: object
metadata:
Expand Down Expand Up @@ -9953,16 +9952,13 @@ spec:
bufferMaxLength:
description: BufferMaxLength is used to define the max length
of a buffer. It overrides the settings from pipeline limits.
Only meaningful for UDF and Source vertice as only they
do buffer write.
format: int64
type: integer
bufferUsageLimit:
description: BufferUsageLimit is used to define the pencentage
of the buffer usage limit, a valid value should be less
than 100, for example, 85. It overrides the settings from
pipeline limits. Only meaningful for UDF and Source vertice
as only they do buffer write.
pipeline limits.
format: int32
type: integer
type: object
Expand Down Expand Up @@ -9998,11 +9994,13 @@ spec:
level settings
properties:
readBatchSize:
description: Read batch size
description: Read batch size from the source or buffer. It overrides
the settings from pipeline limits.
format: int64
type: integer
readTimeout:
description: Read timeout duration
description: Read timeout duration from the source or buffer It
overrides the settings from pipeline limits.
type: string
type: object
metadata:
Expand Down Expand Up @@ -10677,16 +10675,13 @@ spec:
bufferMaxLength:
description: BufferMaxLength is used to define the max length
of a buffer. It overrides the settings from pipeline limits.
Only meaningful for UDF and Source vertice as only they
do buffer write.
format: int64
type: integer
bufferUsageLimit:
description: BufferUsageLimit is used to define the pencentage
of the buffer usage limit, a valid value should be less
than 100, for example, 85. It overrides the settings from
pipeline limits. Only meaningful for UDF and Source vertice
as only they do buffer write.
pipeline limits.
format: int32
type: integer
type: object
Expand Down
Loading

0 comments on commit a45b2ee

Please sign in to comment.