Repository: banzaicloud/logging-operator
Pull request #217 (2019-11-07 14:52:28)

introduce sdk submodule composed from ./api ./pkg/model ./pkg/util ./pkg/plugins
| Q               | A
| --------------- | ---
| Bug fix?        | no
| New feature?    | no
| API breaks?     | no
| Deprecations?   | no
| License         | Apache 2.0


### What's in this PR?
It creates a separate submodule that can be consumed from other go programs without depending on the whole logging-operator package

### Why?
Because the project has several large dependencies, like the prometheus-operator which is unnecessary for every downstream component that depend on the logging-operator types.

### Checklist
<!-- Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields. -->

- [x] Error handling code meets the [guideline](https://github.com/banzaicloud/pipeline/blob/master/docs/error-handling-guide.md)
- [x] Logging code meets the guideline (TODO)
- [x] User guide and development docs updated (if needed)
- [x] Related Helm chart(s) updated (if needed)



Patch:
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 00000000..3558c565
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,2 @@
+bin/
+build/
diff --git a/Dockerfile b/Dockerfile
index 71ce731a..667bcfa8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -5,13 +5,15 @@ WORKDIR /workspace
 # Copy the Go Modules manifests
 COPY go.mod go.mod
 COPY go.sum go.sum
+COPY pkg/sdk/go.mod pkg/sdk/go.mod
+COPY pkg/sdk/go.sum pkg/sdk/go.sum
+
 # cache deps before building and copying source so that we don't need to re-download as much
 # and so that source changes don't invalidate our downloaded layer
 RUN go mod download
 
 # Copy the go source
 COPY main.go main.go
-COPY api/ api/
 COPY controllers/ controllers/
 COPY pkg/ pkg/
 
diff --git a/Makefile b/Makefile
index 61251b73..7cca4e3d 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ VERSION := $(shell git describe --abbrev=0 --tags)
 DOCKER_IMAGE = banzaicloud/logging-operator
 DOCKER_TAG ?= ${VERSION}
 GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./client/*")
-GOFILES_NOPLUGINS =  $(shell find . -type f -name '*.go' -not -path "./pkg/model/filter/*"  -not -path "./pkg/model/output/*"  -not -path "./pkg/model/input/*")
+GOFILES_NOPLUGINS =  $(shell find . -type f -name '*.go' -not -path "./pkg/sdk/model/filter/*"  -not -path "./pkg/sdk/model/output/*"  -not -path "./pkg/sdk/model/input/*")
 PKGS=$(shell go list ./... | grep -v /vendor)
 
 GOLANGCI_VERSION = 1.19.1
@@ -63,7 +63,7 @@ test: generate fmt vet manifests bin/kubebuilder
 	@which kubebuilder
 	@which etcd
 	kubebuilder version
-	go test ./api/... ./controllers/... ./pkg/... -coverprofile cover.out
+	go test ./controllers/... ./pkg/... -coverprofile cover.out
 
 # Build manager binary
 manager: generate fmt vet
@@ -96,8 +96,8 @@ vet:
 
 # Generate code
 generate: controller-gen
-	$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./api/...
-	$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./pkg/model/...
+	cd pkg/sdk && $(CONTROLLER_GEN) object:headerFile=./../../hack/boilerplate.go.txt paths=./api/...
+	cd pkg/sdk && $(CONTROLLER_GEN) object:headerFile=./../../hack/boilerplate.go.txt paths=./model/...
 
 # Build the docker image
 docker-build: test
diff --git a/cmd/docs.go b/cmd/docs.go
index dba272d6..33c4f07e 100644
--- a/cmd/docs.go
+++ b/cmd/docs.go
@@ -115,9 +115,9 @@ type PluginDir struct {
 }
 
 var pluginDirs = []PluginDir{
-	{"filters", "./pkg/model/filter/"},
-	{"outputs", "./pkg/model/output/"},
-	{"common", "./pkg/model/common/"},
+	{"filters", "./pkg/sdk/model/filter/"},
+	{"outputs", "./pkg/sdk/model/output/"},
+	{"common", "./pkg/sdk/model/common/"},
 }
 
 var docsPath = "docs/plugins"
diff --git a/controllers/logging_controller.go b/controllers/logging_controller.go
index 55d273cc..546eb1f5 100644
--- a/controllers/logging_controller.go
+++ b/controllers/logging_controller.go
@@ -20,12 +20,12 @@ import (
 	"regexp"
 
 	"emperror.dev/errors"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
 	"github.com/banzaicloud/logging-operator/pkg/resources"
 	"github.com/banzaicloud/logging-operator/pkg/resources/fluentbit"
 	"github.com/banzaicloud/logging-operator/pkg/resources/fluentd"
 	"github.com/banzaicloud/logging-operator/pkg/resources/model"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
 	"github.com/go-logr/logr"
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
@@ -39,7 +39,7 @@ import (
 	"sigs.k8s.io/controller-runtime/pkg/reconcile"
 	"sigs.k8s.io/controller-runtime/pkg/source"
 
-	loggingv1alpha2 "github.com/banzaicloud/logging-operator/api/v1beta1"
+	loggingv1alpha2 "github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
 )
 
 // LoggingReconciler reconciles a Logging object
diff --git a/docs/developers.md b/docs/developers.md
index 26113350..86f7bf72 100644
--- a/docs/developers.md
+++ b/docs/developers.md
@@ -28,7 +28,7 @@ go run main.go
 
 To add a `plugin` to the logging operator you need to define the plugin struct.
 
-> Note: Place your plugin in the corresponding directory `pkg/model/filter` or `pkg/model/output`
+> Note: Place your plugin in the corresponding directory `pkg/sdk/model/filter` or `pkg/sdk/model/output`
 
 ```go
 type MyExampleOutput struct {
diff --git a/go.mod b/go.mod
index f1c84c77..76cec674 100644
--- a/go.mod
+++ b/go.mod
@@ -4,23 +4,15 @@ go 1.12
 
 require (
 	emperror.dev/errors v0.4.2
-	github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e
-	github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
 	github.com/banzaicloud/k8s-objectmatcher v1.0.1
+	github.com/banzaicloud/logging-operator/pkg/sdk v0.0.0
 	github.com/coreos/prometheus-operator v0.33.0
-	github.com/ghodss/yaml v1.0.0
 	github.com/go-logr/logr v0.1.0
 	github.com/goph/emperror v0.17.2
-	github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0
-	github.com/onsi/ginkgo v1.8.0
 	github.com/onsi/gomega v1.5.0
 	github.com/pborman/uuid v1.2.0
 	github.com/prometheus/common v0.6.0
-	github.com/sergi/go-diff v1.0.0 // indirect
 	github.com/spf13/cast v1.3.0
-	github.com/spf13/pflag v1.0.3 // indirect
-	golang.org/x/net v0.0.0-20190724013045-ca1201d0de80
-	golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
 	k8s.io/api v0.0.0-20190813020757-36bff7324fb7
 	k8s.io/apiextensions-apiserver v0.0.0-20190801143813-8b5f3a974f92
 	k8s.io/apimachinery v0.0.0-20190809020650-423f5d784010
@@ -29,6 +21,7 @@ require (
 )
 
 replace (
+	github.com/banzaicloud/logging-operator/pkg/sdk => ./pkg/sdk
 	github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.8.2-0.20190818123050-43acd0e2e93f
 	k8s.io/api => k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b
 	// required for test deps only
diff --git a/go.sum b/go.sum
index 032987f1..7032abae 100644
--- a/go.sum
+++ b/go.sum
@@ -435,9 +435,8 @@ github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
 github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
 github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
 github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc=
 github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
-github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
-github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
diff --git a/main.go b/main.go
index c1946c64..1c2fd4c1 100644
--- a/main.go
+++ b/main.go
@@ -18,9 +18,9 @@ import (
 	"flag"
 	"os"
 
-	loggingv1alpha2 "github.com/banzaicloud/logging-operator/api/v1beta1"
 	"github.com/banzaicloud/logging-operator/controllers"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	loggingv1alpha2 "github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	prometheusOperator "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
 	apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
 	"k8s.io/apimachinery/pkg/runtime"
diff --git a/pkg/resources/fluentbit/configsecret.go b/pkg/resources/fluentbit/configsecret.go
index 53925c68..ec59c752 100644
--- a/pkg/resources/fluentbit/configsecret.go
+++ b/pkg/resources/fluentbit/configsecret.go
@@ -20,9 +20,9 @@ import (
 	"text/template"
 
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
 	"github.com/banzaicloud/logging-operator/pkg/resources/fluentd"
 	"github.com/banzaicloud/logging-operator/pkg/resources/templates"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 	"github.com/prometheus/common/log"
 	corev1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/runtime"
diff --git a/pkg/resources/fluentbit/daemonset.go b/pkg/resources/fluentbit/daemonset.go
index c8ef3ba8..6c0d1e31 100644
--- a/pkg/resources/fluentbit/daemonset.go
+++ b/pkg/resources/fluentbit/daemonset.go
@@ -18,10 +18,10 @@ import (
 	"crypto/sha256"
 	"fmt"
 
-	"github.com/banzaicloud/logging-operator/api/v1beta1"
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
 	"github.com/banzaicloud/logging-operator/pkg/resources/templates"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/resources/fluentbit/fluentbit.go b/pkg/resources/fluentbit/fluentbit.go
index 7ed44d60..91b451ae 100644
--- a/pkg/resources/fluentbit/fluentbit.go
+++ b/pkg/resources/fluentbit/fluentbit.go
@@ -18,10 +18,10 @@ import (
 	"emperror.dev/errors"
 	"k8s.io/apimachinery/pkg/runtime"
 
-	"github.com/banzaicloud/logging-operator/api/v1beta1"
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
 	"github.com/banzaicloud/logging-operator/pkg/resources"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	"github.com/go-logr/logr"
 	"github.com/goph/emperror"
 	"sigs.k8s.io/controller-runtime/pkg/client"
diff --git a/pkg/resources/fluentbit/psp.go b/pkg/resources/fluentbit/psp.go
index fca7943b..e8f51e86 100644
--- a/pkg/resources/fluentbit/psp.go
+++ b/pkg/resources/fluentbit/psp.go
@@ -17,7 +17,7 @@ package fluentbit
 import (
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
 	"github.com/banzaicloud/logging-operator/pkg/resources/templates"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	policyv1beta1 "k8s.io/api/policy/v1beta1"
 	rbacv1 "k8s.io/api/rbac/v1"
 
diff --git a/pkg/resources/fluentbit/service.go b/pkg/resources/fluentbit/service.go
index b4352cac..8a3e8216 100644
--- a/pkg/resources/fluentbit/service.go
+++ b/pkg/resources/fluentbit/service.go
@@ -17,7 +17,7 @@ package fluentbit
 import (
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
 	"github.com/banzaicloud/logging-operator/pkg/resources/templates"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
 	corev1 "k8s.io/api/core/v1"
 	v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/resources/fluentd/appconfigmap.go b/pkg/resources/fluentd/appconfigmap.go
index 68b68444..7e4c1e3b 100644
--- a/pkg/resources/fluentd/appconfigmap.go
+++ b/pkg/resources/fluentd/appconfigmap.go
@@ -28,7 +28,7 @@ import (
 
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
 	"github.com/banzaicloud/logging-operator/pkg/resources/templates"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 )
 
 type ConfigCheckResult struct {
diff --git a/pkg/resources/fluentd/configsecret.go b/pkg/resources/fluentd/configsecret.go
index 2e9919f4..f507ba48 100644
--- a/pkg/resources/fluentd/configsecret.go
+++ b/pkg/resources/fluentd/configsecret.go
@@ -21,7 +21,7 @@ import (
 
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
 	"github.com/banzaicloud/logging-operator/pkg/resources/templates"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	corev1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/runtime"
 )
diff --git a/pkg/resources/fluentd/fluentd.go b/pkg/resources/fluentd/fluentd.go
index daf24d89..3f29e121 100644
--- a/pkg/resources/fluentd/fluentd.go
+++ b/pkg/resources/fluentd/fluentd.go
@@ -19,11 +19,11 @@ import (
 	"time"
 
 	"emperror.dev/errors"
-	"github.com/banzaicloud/logging-operator/api/v1beta1"
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
 	"github.com/banzaicloud/logging-operator/pkg/resources"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	"github.com/go-logr/logr"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 	"sigs.k8s.io/controller-runtime/pkg/reconcile"
diff --git a/pkg/resources/fluentd/outputsecret.go b/pkg/resources/fluentd/outputsecret.go
index 0bb3bc5c..3b131b1d 100644
--- a/pkg/resources/fluentd/outputsecret.go
+++ b/pkg/resources/fluentd/outputsecret.go
@@ -19,7 +19,7 @@ import (
 	"fmt"
 
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
 	corev1 "k8s.io/api/core/v1"
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/runtime"
diff --git a/pkg/resources/fluentd/psp.go b/pkg/resources/fluentd/psp.go
index e5ccf51f..b9289b94 100644
--- a/pkg/resources/fluentd/psp.go
+++ b/pkg/resources/fluentd/psp.go
@@ -17,7 +17,7 @@ package fluentd
 import (
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
 	"github.com/banzaicloud/logging-operator/pkg/resources/templates"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	policyv1beta1 "k8s.io/api/policy/v1beta1"
 	rbacv1 "k8s.io/api/rbac/v1"
 
diff --git a/pkg/resources/fluentd/service.go b/pkg/resources/fluentd/service.go
index e60779e1..8483af14 100644
--- a/pkg/resources/fluentd/service.go
+++ b/pkg/resources/fluentd/service.go
@@ -17,7 +17,7 @@ package fluentd
 import (
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
 	"github.com/banzaicloud/logging-operator/pkg/resources/templates"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
 	corev1 "k8s.io/api/core/v1"
 	v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/resources/fluentd/statefulset.go b/pkg/resources/fluentd/statefulset.go
index 4fd5ee96..77ac48e6 100644
--- a/pkg/resources/fluentd/statefulset.go
+++ b/pkg/resources/fluentd/statefulset.go
@@ -15,10 +15,10 @@
 package fluentd
 
 import (
-	"github.com/banzaicloud/logging-operator/api/v1beta1"
 	"github.com/banzaicloud/logging-operator/pkg/k8sutil"
 	"github.com/banzaicloud/logging-operator/pkg/resources/templates"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	"github.com/spf13/cast"
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
diff --git a/pkg/resources/model/system.go b/pkg/resources/model/system.go
index 1e1bacd1..0fd481dd 100644
--- a/pkg/resources/model/system.go
+++ b/pkg/resources/model/system.go
@@ -16,13 +16,13 @@ package model
 
 import (
 	"emperror.dev/errors"
-	"github.com/banzaicloud/logging-operator/api/v1beta1"
-	"github.com/banzaicloud/logging-operator/pkg/model/common"
-	"github.com/banzaicloud/logging-operator/pkg/model/input"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
-	"github.com/banzaicloud/logging-operator/pkg/plugins"
 	"github.com/banzaicloud/logging-operator/pkg/resources/fluentd"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/common"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/input"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/plugins"
 	"github.com/go-logr/logr"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 )
diff --git a/pkg/resources/templates/templates.go b/pkg/resources/templates/templates.go
index c1231c43..8aa766ae 100644
--- a/pkg/resources/templates/templates.go
+++ b/pkg/resources/templates/templates.go
@@ -15,8 +15,8 @@
 package templates
 
 import (
-	"github.com/banzaicloud/logging-operator/api/v1beta1"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
diff --git a/api/v1beta1/clusterflow_types.go b/pkg/sdk/api/v1beta1/clusterflow_types.go
similarity index 100%
rename from api/v1beta1/clusterflow_types.go
rename to pkg/sdk/api/v1beta1/clusterflow_types.go
diff --git a/api/v1beta1/clusterflow_types_test.go b/pkg/sdk/api/v1beta1/clusterflow_types_test.go
similarity index 100%
rename from api/v1beta1/clusterflow_types_test.go
rename to pkg/sdk/api/v1beta1/clusterflow_types_test.go
diff --git a/api/v1beta1/clusteroutput_types.go b/pkg/sdk/api/v1beta1/clusteroutput_types.go
similarity index 100%
rename from api/v1beta1/clusteroutput_types.go
rename to pkg/sdk/api/v1beta1/clusteroutput_types.go
diff --git a/api/v1beta1/clusteroutput_types_test.go b/pkg/sdk/api/v1beta1/clusteroutput_types_test.go
similarity index 100%
rename from api/v1beta1/clusteroutput_types_test.go
rename to pkg/sdk/api/v1beta1/clusteroutput_types_test.go
diff --git a/api/v1beta1/common_types.go b/pkg/sdk/api/v1beta1/common_types.go
similarity index 100%
rename from api/v1beta1/common_types.go
rename to pkg/sdk/api/v1beta1/common_types.go
diff --git a/api/v1beta1/flow_types.go b/pkg/sdk/api/v1beta1/flow_types.go
similarity index 97%
rename from api/v1beta1/flow_types.go
rename to pkg/sdk/api/v1beta1/flow_types.go
index dd9d4fc4..0c13be43 100644
--- a/api/v1beta1/flow_types.go
+++ b/pkg/sdk/api/v1beta1/flow_types.go
@@ -15,7 +15,7 @@
 package v1beta1
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/filter"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/filter"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
diff --git a/api/v1beta1/flow_types_test.go b/pkg/sdk/api/v1beta1/flow_types_test.go
similarity index 100%
rename from api/v1beta1/flow_types_test.go
rename to pkg/sdk/api/v1beta1/flow_types_test.go
diff --git a/api/v1beta1/fluentbit_types.go b/pkg/sdk/api/v1beta1/fluentbit_types.go
similarity index 100%
rename from api/v1beta1/fluentbit_types.go
rename to pkg/sdk/api/v1beta1/fluentbit_types.go
diff --git a/api/v1beta1/fluentd_types.go b/pkg/sdk/api/v1beta1/fluentd_types.go
similarity index 100%
rename from api/v1beta1/fluentd_types.go
rename to pkg/sdk/api/v1beta1/fluentd_types.go
diff --git a/api/v1beta1/groupversion_info.go b/pkg/sdk/api/v1beta1/groupversion_info.go
similarity index 100%
rename from api/v1beta1/groupversion_info.go
rename to pkg/sdk/api/v1beta1/groupversion_info.go
diff --git a/api/v1beta1/logging_types.go b/pkg/sdk/api/v1beta1/logging_types.go
similarity index 99%
rename from api/v1beta1/logging_types.go
rename to pkg/sdk/api/v1beta1/logging_types.go
index c5ed524e..01ec3317 100644
--- a/api/v1beta1/logging_types.go
+++ b/pkg/sdk/api/v1beta1/logging_types.go
@@ -17,7 +17,7 @@ package v1beta1
 import (
 	"fmt"
 
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	v1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/resource"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/api/v1beta1/output_types.go b/pkg/sdk/api/v1beta1/output_types.go
similarity index 97%
rename from api/v1beta1/output_types.go
rename to pkg/sdk/api/v1beta1/output_types.go
index 526fe4bd..55336d5f 100644
--- a/api/v1beta1/output_types.go
+++ b/pkg/sdk/api/v1beta1/output_types.go
@@ -15,7 +15,7 @@
 package v1beta1
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
diff --git a/api/v1beta1/output_types_test.go b/pkg/sdk/api/v1beta1/output_types_test.go
similarity index 100%
rename from api/v1beta1/output_types_test.go
rename to pkg/sdk/api/v1beta1/output_types_test.go
diff --git a/api/v1beta1/suite_test.go b/pkg/sdk/api/v1beta1/suite_test.go
similarity index 100%
rename from api/v1beta1/suite_test.go
rename to pkg/sdk/api/v1beta1/suite_test.go
diff --git a/api/v1beta1/zz_generated.deepcopy.go b/pkg/sdk/api/v1beta1/zz_generated.deepcopy.go
similarity index 99%
rename from api/v1beta1/zz_generated.deepcopy.go
rename to pkg/sdk/api/v1beta1/zz_generated.deepcopy.go
index a3a45ff1..1ad09dd3 100644
--- a/api/v1beta1/zz_generated.deepcopy.go
+++ b/pkg/sdk/api/v1beta1/zz_generated.deepcopy.go
@@ -19,8 +19,8 @@
 package v1beta1
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/filter"
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/filter"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
 	"k8s.io/api/core/v1"
 	runtime "k8s.io/apimachinery/pkg/runtime"
 )
diff --git a/pkg/sdk/go.mod b/pkg/sdk/go.mod
new file mode 100644
index 00000000..459cf69c
--- /dev/null
+++ b/pkg/sdk/go.mod
@@ -0,0 +1,21 @@
+module github.com/banzaicloud/logging-operator/pkg/sdk
+
+go 1.13
+
+require (
+	emperror.dev/errors v0.4.2
+	github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e
+	github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883
+	github.com/ghodss/yaml v1.0.0
+	github.com/goph/emperror v0.17.2
+	github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0
+	github.com/onsi/ginkgo v1.8.0
+	github.com/onsi/gomega v1.5.0
+	github.com/sergi/go-diff v1.0.0 // indirect
+	golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
+	golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
+	k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b
+	k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d
+	k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
+	sigs.k8s.io/controller-runtime v0.2.0
+)
diff --git a/pkg/sdk/go.sum b/pkg/sdk/go.sum
new file mode 100644
index 00000000..5f81eaba
--- /dev/null
+++ b/pkg/sdk/go.sum
@@ -0,0 +1,127 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+emperror.dev/errors v0.4.2 h1:snD5ODyv4c9DOBBZh645dy/TziVHZivuFtRRMZP8zK8=
+emperror.dev/errors v0.4.2/go.mod h1:cA5SMsyzo+KXq997DKGK+lTV1DGx5TXLQUNtYe9p2p0=
+github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E=
+github.com/airbrake/gobrake v3.6.1+incompatible/go.mod h1:wM4gu3Cn0W0K7GUuVWnlXZU11AGBXMILnrdOU8Kn00o=
+github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
+github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
+github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
+github.com/bugsnag/bugsnag-go v1.4.0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8=
+github.com/bugsnag/panicwrap v1.2.0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE=
+github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M=
+github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=
+github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
+github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk=
+github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
+github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
+github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
+github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
+github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
+github.com/goph/emperror v0.17.2 h1:yLapQcmEsO0ipe9p5TaN22djm3OFV/TfM/fcYP0/J18=
+github.com/goph/emperror v0.17.2/go.mod h1:+ZbQ+fUNO/6FNiUo0ujtMjhgad9Xa6fQL9KhH4LNHic=
+github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk=
+github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
+github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
+github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
+github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/rollbar/rollbar-go v1.0.2/go.mod h1:AcFs5f0I+c71bpHlXNNDbOWJiKwjFDtISeXco0L5PKQ=
+github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
+github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
+github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
+go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
+go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
+go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
+golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac h1:7d7lG9fHOLdL6jZPtnV4LpI41SbohIJ1Atq7U991dMg=
+golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
+golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
+gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b h1:aBGgKJUM9Hk/3AE8WaZIApnTxG35kbuQba2w+SXqezo=
+k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
+k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE=
+k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d h1:Jmdtdt1ZnoGfWWIIik61Z7nKYgO3J+swQJtPYsP9wHA=
+k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
+k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ=
+k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
+k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE=
+k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
+k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
+k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5 h1:VBM/0P5TWxwk+Nw6Z+lAw3DKgO76g90ETOiA6rfLV1Y=
+k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
+sigs.k8s.io/controller-runtime v0.2.0 h1:5gL30PXOisGZl+Osi4CmLhvMUj77BO3wJeouKF2va50=
+sigs.k8s.io/controller-runtime v0.2.0/go.mod h1:ZHqrRDZi3f6BzONcvlUxkqCKgwasGk5FZrnSv9TVZF4=
+sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U=
+sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
+sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
diff --git a/pkg/model/common/security.go b/pkg/sdk/model/common/security.go
similarity index 90%
rename from pkg/model/common/security.go
rename to pkg/sdk/model/common/security.go
index 250613bd..6d72320b 100644
--- a/pkg/model/common/security.go
+++ b/pkg/sdk/model/common/security.go
@@ -14,8 +14,8 @@
 package common
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 type Security struct {
diff --git a/pkg/model/common/transport.go b/pkg/sdk/model/common/transport.go
similarity index 94%
rename from pkg/model/common/transport.go
rename to pkg/sdk/model/common/transport.go
index 373058d1..2f0a3740 100644
--- a/pkg/model/common/transport.go
+++ b/pkg/sdk/model/common/transport.go
@@ -14,8 +14,8 @@
 package common
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 type Transport struct {
diff --git a/pkg/model/filter/concat.go b/pkg/sdk/model/filter/concat.go
similarity index 96%
rename from pkg/model/filter/concat.go
rename to pkg/sdk/model/filter/concat.go
index 125a5c53..132f94ee 100644
--- a/pkg/model/filter/concat.go
+++ b/pkg/sdk/model/filter/concat.go
@@ -15,8 +15,8 @@
 package filter
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"Fluentd concat filter"
diff --git a/pkg/model/filter/dedot.go b/pkg/sdk/model/filter/dedot.go
similarity index 92%
rename from pkg/model/filter/dedot.go
rename to pkg/sdk/model/filter/dedot.go
index c98b96e0..4b7c3b04 100644
--- a/pkg/model/filter/dedot.go
+++ b/pkg/sdk/model/filter/dedot.go
@@ -15,8 +15,8 @@
 package filter
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/filter/geoip.go b/pkg/sdk/model/filter/geoip.go
similarity index 96%
rename from pkg/model/filter/geoip.go
rename to pkg/sdk/model/filter/geoip.go
index 98ca62c0..d2b6cb90 100644
--- a/pkg/model/filter/geoip.go
+++ b/pkg/sdk/model/filter/geoip.go
@@ -15,8 +15,8 @@
 package filter
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"Fluentd GeoIP filter"
diff --git a/pkg/model/filter/parser.go b/pkg/sdk/model/filter/parser.go
similarity index 97%
rename from pkg/model/filter/parser.go
rename to pkg/sdk/model/filter/parser.go
index 77020c9f..3e52324f 100644
--- a/pkg/model/filter/parser.go
+++ b/pkg/sdk/model/filter/parser.go
@@ -15,8 +15,8 @@
 package filter
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/filter/record_transformer.go b/pkg/sdk/model/filter/record_transformer.go
similarity index 95%
rename from pkg/model/filter/record_transformer.go
rename to pkg/sdk/model/filter/record_transformer.go
index 33f7e24c..e452ff68 100644
--- a/pkg/model/filter/record_transformer.go
+++ b/pkg/sdk/model/filter/record_transformer.go
@@ -15,8 +15,8 @@
 package filter
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/filter/stdout.go b/pkg/sdk/model/filter/stdout.go
similarity index 89%
rename from pkg/model/filter/stdout.go
rename to pkg/sdk/model/filter/stdout.go
index db0f9823..bc0bcc32 100644
--- a/pkg/model/filter/stdout.go
+++ b/pkg/sdk/model/filter/stdout.go
@@ -15,8 +15,8 @@
 package filter
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/filter/tagnormaliser.go b/pkg/sdk/model/filter/tagnormaliser.go
similarity index 94%
rename from pkg/model/filter/tagnormaliser.go
rename to pkg/sdk/model/filter/tagnormaliser.go
index 2668d432..f6e68f9e 100644
--- a/pkg/model/filter/tagnormaliser.go
+++ b/pkg/sdk/model/filter/tagnormaliser.go
@@ -15,8 +15,8 @@
 package filter
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"Fluentd Plugin to re-tag based on log metadata"
diff --git a/pkg/model/filter/zz_generated.deepcopy.go b/pkg/sdk/model/filter/zz_generated.deepcopy.go
similarity index 100%
rename from pkg/model/filter/zz_generated.deepcopy.go
rename to pkg/sdk/model/filter/zz_generated.deepcopy.go
diff --git a/pkg/model/input/forward.go b/pkg/sdk/model/input/forward.go
similarity index 91%
rename from pkg/model/input/forward.go
rename to pkg/sdk/model/input/forward.go
index 10f415c2..4aa4abc2 100644
--- a/pkg/model/input/forward.go
+++ b/pkg/sdk/model/input/forward.go
@@ -15,9 +15,9 @@
 package input
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/common"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/common"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/input/tail.go b/pkg/sdk/model/input/tail.go
similarity index 89%
rename from pkg/model/input/tail.go
rename to pkg/sdk/model/input/tail.go
index 60b7a00e..69e9a989 100644
--- a/pkg/model/input/tail.go
+++ b/pkg/sdk/model/input/tail.go
@@ -15,8 +15,8 @@
 package input
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/input/zz_generated.deepcopy.go b/pkg/sdk/model/input/zz_generated.deepcopy.go
similarity index 96%
rename from pkg/model/input/zz_generated.deepcopy.go
rename to pkg/sdk/model/input/zz_generated.deepcopy.go
index f660c315..361399a8 100644
--- a/pkg/model/input/zz_generated.deepcopy.go
+++ b/pkg/sdk/model/input/zz_generated.deepcopy.go
@@ -19,7 +19,7 @@
 package input
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/common"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/common"
 )
 
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
diff --git a/pkg/model/output/azurestore.go b/pkg/sdk/model/output/azurestore.go
similarity index 95%
rename from pkg/model/output/azurestore.go
rename to pkg/sdk/model/output/azurestore.go
index 84daa8b2..0ad34e77 100644
--- a/pkg/model/output/azurestore.go
+++ b/pkg/sdk/model/output/azurestore.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"Azure Storage output plugin for Fluentd"
diff --git a/pkg/model/output/buffer.go b/pkg/sdk/model/output/buffer.go
similarity index 98%
rename from pkg/model/output/buffer.go
rename to pkg/sdk/model/output/buffer.go
index 00ab6c6b..9a525f76 100644
--- a/pkg/model/output/buffer.go
+++ b/pkg/sdk/model/output/buffer.go
@@ -17,8 +17,8 @@ package output
 import (
 	"fmt"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/output/cloudwatch.go b/pkg/sdk/model/output/cloudwatch.go
similarity index 97%
rename from pkg/model/output/cloudwatch.go
rename to pkg/sdk/model/output/cloudwatch.go
index cfa6e36a..15fed860 100644
--- a/pkg/model/output/cloudwatch.go
+++ b/pkg/sdk/model/output/cloudwatch.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"CloudWatch output plugin for Fluentd"
diff --git a/pkg/model/output/elasticsearch.go b/pkg/sdk/model/output/elasticsearch.go
similarity index 99%
rename from pkg/model/output/elasticsearch.go
rename to pkg/sdk/model/output/elasticsearch.go
index 2162b6cd..728cb6ec 100644
--- a/pkg/model/output/elasticsearch.go
+++ b/pkg/sdk/model/output/elasticsearch.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"Elasticsearch output plugin for Fluentd"
diff --git a/pkg/model/output/file.go b/pkg/sdk/model/output/file.go
similarity index 89%
rename from pkg/model/output/file.go
rename to pkg/sdk/model/output/file.go
index 537724a9..a68e4eca 100644
--- a/pkg/model/output/file.go
+++ b/pkg/sdk/model/output/file.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/output/format.go b/pkg/sdk/model/output/format.go
similarity index 90%
rename from pkg/model/output/format.go
rename to pkg/sdk/model/output/format.go
index b9c7f086..ef1392ee 100644
--- a/pkg/model/output/format.go
+++ b/pkg/sdk/model/output/format.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/output/forward.go b/pkg/sdk/model/output/forward.go
similarity index 97%
rename from pkg/model/output/forward.go
rename to pkg/sdk/model/output/forward.go
index 2c35e059..5ea038e3 100644
--- a/pkg/model/output/forward.go
+++ b/pkg/sdk/model/output/forward.go
@@ -15,9 +15,9 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/common"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/common"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/output/gcs.go b/pkg/sdk/model/output/gcs.go
similarity index 97%
rename from pkg/model/output/gcs.go
rename to pkg/sdk/model/output/gcs.go
index 4a869ea6..82279586 100644
--- a/pkg/model/output/gcs.go
+++ b/pkg/sdk/model/output/gcs.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/output/kafka.go b/pkg/sdk/model/output/kafka.go
similarity index 97%
rename from pkg/model/output/kafka.go
rename to pkg/sdk/model/output/kafka.go
index 5c7b314e..297a378d 100644
--- a/pkg/model/output/kafka.go
+++ b/pkg/sdk/model/output/kafka.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"Kafka output plugin for Fluentd"
diff --git a/pkg/model/output/loki.go b/pkg/sdk/model/output/loki.go
similarity index 96%
rename from pkg/model/output/loki.go
rename to pkg/sdk/model/output/loki.go
index 5aecd564..b534d8d6 100644
--- a/pkg/model/output/loki.go
+++ b/pkg/sdk/model/output/loki.go
@@ -15,9 +15,9 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 )
 
 // +docName:"Loki output plugin "
diff --git a/pkg/model/output/null.go b/pkg/sdk/model/output/null.go
similarity index 89%
rename from pkg/model/output/null.go
rename to pkg/sdk/model/output/null.go
index 7431c5be..fd11f71b 100644
--- a/pkg/model/output/null.go
+++ b/pkg/sdk/model/output/null.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +kubebuilder:object:generate=true
diff --git a/pkg/model/output/oss.go b/pkg/sdk/model/output/oss.go
similarity index 97%
rename from pkg/model/output/oss.go
rename to pkg/sdk/model/output/oss.go
index 09186957..4956ed49 100644
--- a/pkg/model/output/oss.go
+++ b/pkg/sdk/model/output/oss.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"Aliyun OSS plugin for Fluentd"
diff --git a/pkg/model/output/s3.go b/pkg/sdk/model/output/s3.go
similarity index 98%
rename from pkg/model/output/s3.go
rename to pkg/sdk/model/output/s3.go
index b7f69ec9..f06fbf13 100644
--- a/pkg/model/output/s3.go
+++ b/pkg/sdk/model/output/s3.go
@@ -17,8 +17,8 @@ package output
 import (
 	"errors"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"Amazon S3 plugin for Fluentd"
diff --git a/pkg/model/output/sumologic.go b/pkg/sdk/model/output/sumologic.go
similarity index 96%
rename from pkg/model/output/sumologic.go
rename to pkg/sdk/model/output/sumologic.go
index a6b5ad9d..85c30da0 100644
--- a/pkg/model/output/sumologic.go
+++ b/pkg/sdk/model/output/sumologic.go
@@ -15,8 +15,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 // +docName:"SumoLogic output plugin for Fluentd"
diff --git a/pkg/model/output/zz_generated.deepcopy.go b/pkg/sdk/model/output/zz_generated.deepcopy.go
similarity index 99%
rename from pkg/model/output/zz_generated.deepcopy.go
rename to pkg/sdk/model/output/zz_generated.deepcopy.go
index 9abfe539..4a69892a 100644
--- a/pkg/model/output/zz_generated.deepcopy.go
+++ b/pkg/sdk/model/output/zz_generated.deepcopy.go
@@ -19,8 +19,8 @@
 package output
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/common"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/common"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
 )
 
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
diff --git a/pkg/model/render/fluent.go b/pkg/sdk/model/render/fluent.go
similarity index 95%
rename from pkg/model/render/fluent.go
rename to pkg/sdk/model/render/fluent.go
index e5bd47b2..e0bc3728 100644
--- a/pkg/model/render/fluent.go
+++ b/pkg/sdk/model/render/fluent.go
@@ -19,8 +19,8 @@ import (
 	"io"
 	"strings"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 	"github.com/goph/emperror"
 )
 
diff --git a/pkg/model/render/interface.go b/pkg/sdk/model/render/interface.go
similarity index 91%
rename from pkg/model/render/interface.go
rename to pkg/sdk/model/render/interface.go
index 5ad5b9fb..3e732e67 100644
--- a/pkg/model/render/interface.go
+++ b/pkg/sdk/model/render/interface.go
@@ -15,7 +15,7 @@
 package render
 
 import (
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 type Renderer interface {
diff --git a/pkg/model/render/json.go b/pkg/sdk/model/render/json.go
similarity index 94%
rename from pkg/model/render/json.go
rename to pkg/sdk/model/render/json.go
index 12e2750f..6a773005 100644
--- a/pkg/model/render/json.go
+++ b/pkg/sdk/model/render/json.go
@@ -20,7 +20,7 @@ import (
 	"io"
 	"strings"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 	"github.com/goph/emperror"
 )
 
diff --git a/pkg/model/secret/secret.go b/pkg/sdk/model/secret/secret.go
similarity index 100%
rename from pkg/model/secret/secret.go
rename to pkg/sdk/model/secret/secret.go
diff --git a/pkg/model/secret/zz_generated.deepcopy.go b/pkg/sdk/model/secret/zz_generated.deepcopy.go
similarity index 100%
rename from pkg/model/secret/zz_generated.deepcopy.go
rename to pkg/sdk/model/secret/zz_generated.deepcopy.go
diff --git a/pkg/model/types/builder.go b/pkg/sdk/model/types/builder.go
similarity index 100%
rename from pkg/model/types/builder.go
rename to pkg/sdk/model/types/builder.go
diff --git a/pkg/model/types/flow.go b/pkg/sdk/model/types/flow.go
similarity index 100%
rename from pkg/model/types/flow.go
rename to pkg/sdk/model/types/flow.go
diff --git a/pkg/model/types/router.go b/pkg/sdk/model/types/router.go
similarity index 97%
rename from pkg/model/types/router.go
rename to pkg/sdk/model/types/router.go
index abca676e..12463ecc 100644
--- a/pkg/model/types/router.go
+++ b/pkg/sdk/model/types/router.go
@@ -17,7 +17,7 @@ package types
 import (
 	"strings"
 
-	"github.com/banzaicloud/logging-operator/pkg/util"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/util"
 )
 
 // OutputPlugin plugin: https://github.com/banzaicloud/fluent-plugin-label-router
diff --git a/pkg/model/types/stringmaps.go b/pkg/sdk/model/types/stringmaps.go
similarity index 99%
rename from pkg/model/types/stringmaps.go
rename to pkg/sdk/model/types/stringmaps.go
index 18c9f298..65bdfe14 100644
--- a/pkg/model/types/stringmaps.go
+++ b/pkg/sdk/model/types/stringmaps.go
@@ -21,7 +21,7 @@ import (
 	"strings"
 
 	"emperror.dev/errors"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
 )
 
 type Converter func(interface{}) (string, error)
diff --git a/pkg/model/types/types.go b/pkg/sdk/model/types/types.go
similarity index 98%
rename from pkg/model/types/types.go
rename to pkg/sdk/model/types/types.go
index 13c1997b..81accd77 100644
--- a/pkg/model/types/types.go
+++ b/pkg/sdk/model/types/types.go
@@ -18,7 +18,7 @@ import (
 	"fmt"
 
 	"emperror.dev/errors"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
 )
 
 type Directive interface {
diff --git a/pkg/plugins/plugin.go b/pkg/sdk/plugins/plugin.go
similarity index 91%
rename from pkg/plugins/plugin.go
rename to pkg/sdk/plugins/plugin.go
index ea0833d7..09bc90e7 100644
--- a/pkg/plugins/plugin.go
+++ b/pkg/sdk/plugins/plugin.go
@@ -18,9 +18,9 @@ import (
 	"reflect"
 
 	"emperror.dev/errors"
-	"github.com/banzaicloud/logging-operator/api/v1beta1"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 type DirectiveConverter interface {
diff --git a/pkg/util/cache.go b/pkg/sdk/util/cache.go
similarity index 100%
rename from pkg/util/cache.go
rename to pkg/sdk/util/cache.go
diff --git a/pkg/util/util.go b/pkg/sdk/util/util.go
similarity index 100%
rename from pkg/util/util.go
rename to pkg/sdk/util/util.go
diff --git a/scripts/check-header.sh b/scripts/check-header.sh
index 2084de57..eed34b34 100755
--- a/scripts/check-header.sh
+++ b/scripts/check-header.sh
@@ -17,7 +17,7 @@ read -r -d '' EXPECTED <<EOF
 EOF
 
 STATUS=0
-FILES=$(find . -name "*.go" -not -path ./pkg/util/cache.go)
+FILES=$(find . -name "*.go" -not -path ./pkg/sdk/util/cache.go)
 
 for FILE in $FILES; do
     # Skip check for autogenerated files


Test patch:
diff --git a/controllers/logging_controller_test.go b/controllers/logging_controller_test.go
index 2e4b2b87..a0507794 100644
--- a/controllers/logging_controller_test.go
+++ b/controllers/logging_controller_test.go
@@ -22,11 +22,11 @@ import (
 	"time"
 
 	"emperror.dev/errors"
-	"github.com/banzaicloud/logging-operator/api/v1beta1"
 	"github.com/banzaicloud/logging-operator/controllers"
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
 	"github.com/banzaicloud/logging-operator/pkg/resources/fluentd"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
 	"github.com/onsi/gomega"
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
diff --git a/controllers/suite_test.go b/controllers/suite_test.go
index c01b7865..cbf33d13 100644
--- a/controllers/suite_test.go
+++ b/controllers/suite_test.go
@@ -22,7 +22,7 @@ import (
 	"sync"
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/api/v1beta1"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/api/v1beta1"
 	"github.com/pborman/uuid"
 	v12 "k8s.io/api/core/v1"
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/model/output/azurestore_test.go b/pkg/sdk/model/output/azurestore_test.go
similarity index 91%
rename from pkg/model/output/azurestore_test.go
rename to pkg/sdk/model/output/azurestore_test.go
index 9ca31846..3edd7316 100644
--- a/pkg/model/output/azurestore_test.go
+++ b/pkg/sdk/model/output/azurestore_test.go
@@ -17,8 +17,8 @@ package output_test
 import (
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
 	"github.com/ghodss/yaml"
 )
 
diff --git a/pkg/model/output/cloudwatch_test.go b/pkg/sdk/model/output/cloudwatch_test.go
similarity index 91%
rename from pkg/model/output/cloudwatch_test.go
rename to pkg/sdk/model/output/cloudwatch_test.go
index b50b7664..3e5d11e3 100644
--- a/pkg/model/output/cloudwatch_test.go
+++ b/pkg/sdk/model/output/cloudwatch_test.go
@@ -17,8 +17,8 @@ package output_test
 import (
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
 	"github.com/ghodss/yaml"
 )
 
diff --git a/pkg/model/output/elasticsearch_test.go b/pkg/sdk/model/output/elasticsearch_test.go
similarity index 92%
rename from pkg/model/output/elasticsearch_test.go
rename to pkg/sdk/model/output/elasticsearch_test.go
index b0290c16..f9b72407 100644
--- a/pkg/model/output/elasticsearch_test.go
+++ b/pkg/sdk/model/output/elasticsearch_test.go
@@ -17,8 +17,8 @@ package output_test
 import (
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
 	"github.com/ghodss/yaml"
 )
 
diff --git a/pkg/model/output/gcs_test.go b/pkg/sdk/model/output/gcs_test.go
similarity index 91%
rename from pkg/model/output/gcs_test.go
rename to pkg/sdk/model/output/gcs_test.go
index 03fb64de..864e8b90 100644
--- a/pkg/model/output/gcs_test.go
+++ b/pkg/sdk/model/output/gcs_test.go
@@ -17,8 +17,8 @@ package output_test
 import (
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
 	"github.com/ghodss/yaml"
 )
 
diff --git a/pkg/model/output/kafka_test.go b/pkg/sdk/model/output/kafka_test.go
similarity index 91%
rename from pkg/model/output/kafka_test.go
rename to pkg/sdk/model/output/kafka_test.go
index 6e9c71d5..5d2a9aa3 100644
--- a/pkg/model/output/kafka_test.go
+++ b/pkg/sdk/model/output/kafka_test.go
@@ -17,8 +17,8 @@ package output_test
 import (
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
 	"github.com/ghodss/yaml"
 )
 
diff --git a/pkg/model/output/loki_test.go b/pkg/sdk/model/output/loki_test.go
similarity index 93%
rename from pkg/model/output/loki_test.go
rename to pkg/sdk/model/output/loki_test.go
index 8b05140f..deffca07 100644
--- a/pkg/model/output/loki_test.go
+++ b/pkg/sdk/model/output/loki_test.go
@@ -17,8 +17,8 @@ package output_test
 import (
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
 	"github.com/ghodss/yaml"
 )
 
diff --git a/pkg/model/output/oss_test.go b/pkg/sdk/model/output/oss_test.go
similarity index 91%
rename from pkg/model/output/oss_test.go
rename to pkg/sdk/model/output/oss_test.go
index 63f8ce2f..815ccf83 100644
--- a/pkg/model/output/oss_test.go
+++ b/pkg/sdk/model/output/oss_test.go
@@ -17,8 +17,8 @@ package output_test
 import (
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
 	"github.com/ghodss/yaml"
 )
 
diff --git a/pkg/model/output/s3_test.go b/pkg/sdk/model/output/s3_test.go
similarity index 92%
rename from pkg/model/output/s3_test.go
rename to pkg/sdk/model/output/s3_test.go
index 430e44eb..cdd39da8 100644
--- a/pkg/model/output/s3_test.go
+++ b/pkg/sdk/model/output/s3_test.go
@@ -17,8 +17,8 @@ package output_test
 import (
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
 	"github.com/ghodss/yaml"
 )
 
diff --git a/pkg/model/output/sumologic_test.go b/pkg/sdk/model/output/sumologic_test.go
similarity index 90%
rename from pkg/model/output/sumologic_test.go
rename to pkg/sdk/model/output/sumologic_test.go
index 8044fd34..fb6ce791 100644
--- a/pkg/model/output/sumologic_test.go
+++ b/pkg/sdk/model/output/sumologic_test.go
@@ -17,8 +17,8 @@ package output_test
 import (
 	"testing"
 
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
 	"github.com/ghodss/yaml"
 )
 
diff --git a/pkg/model/render/fluent_test.go b/pkg/sdk/model/render/fluent_test.go
similarity index 96%
rename from pkg/model/render/fluent_test.go
rename to pkg/sdk/model/render/fluent_test.go
index f100abc2..2b41ebe2 100644
--- a/pkg/model/render/fluent_test.go
+++ b/pkg/sdk/model/render/fluent_test.go
@@ -21,13 +21,13 @@ import (
 
 	"github.com/MakeNowJust/heredoc"
 	"github.com/andreyvit/diff"
-	"github.com/banzaicloud/logging-operator/pkg/model/filter"
-	"github.com/banzaicloud/logging-operator/pkg/model/input"
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/render"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
-	"github.com/banzaicloud/logging-operator/pkg/plugins"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/filter"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/input"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/render"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/plugins"
 )
 
 func TestRenderDirective(t *testing.T) {
diff --git a/pkg/model/render/json_test.go b/pkg/sdk/model/render/json_test.go
similarity index 90%
rename from pkg/model/render/json_test.go
rename to pkg/sdk/model/render/json_test.go
index ceda7f35..e341d748 100644
--- a/pkg/model/render/json_test.go
+++ b/pkg/sdk/model/render/json_test.go
@@ -19,11 +19,11 @@ import (
 	"testing"
 
 	"github.com/andreyvit/diff"
-	"github.com/banzaicloud/logging-operator/pkg/model/filter"
-	"github.com/banzaicloud/logging-operator/pkg/model/input"
-	"github.com/banzaicloud/logging-operator/pkg/model/output"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/filter"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/input"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/output"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
 )
 
 func TestJsonRender(t *testing.T) {
diff --git a/pkg/model/render/test_helper.go b/pkg/sdk/model/render/test_helper.go
similarity index 90%
rename from pkg/model/render/test_helper.go
rename to pkg/sdk/model/render/test_helper.go
index a278e606..dc0ddffb 100644
--- a/pkg/model/render/test_helper.go
+++ b/pkg/sdk/model/render/test_helper.go
@@ -19,10 +19,10 @@ import (
 	"testing"
 
 	"github.com/andreyvit/diff"
-	"github.com/banzaicloud/logging-operator/pkg/model/input"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
-	"github.com/banzaicloud/logging-operator/pkg/model/types"
-	"github.com/banzaicloud/logging-operator/pkg/plugins"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/input"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/types"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/plugins"
 )
 
 func toDirective(t *testing.T, converter plugins.DirectiveConverter) types.Directive {
diff --git a/pkg/model/types/stringmaps_test.go b/pkg/sdk/model/types/stringmaps_test.go
similarity index 99%
rename from pkg/model/types/stringmaps_test.go
rename to pkg/sdk/model/types/stringmaps_test.go
index 9f569bc3..f9517ecb 100644
--- a/pkg/model/types/stringmaps_test.go
+++ b/pkg/sdk/model/types/stringmaps_test.go
@@ -21,7 +21,7 @@ import (
 	"testing"
 
 	"emperror.dev/errors"
-	"github.com/banzaicloud/logging-operator/pkg/model/secret"
+	"github.com/banzaicloud/logging-operator/pkg/sdk/model/secret"
 )
 
 func TestRequired(t *testing.T) {