Skip to content

Commit

Permalink
Merge pull request #45 from SomtochiAma/update-docs-kubebuilder2
Browse files Browse the repository at this point in the history
Updates CoreDNS readme for kubebuilder 2.0
  • Loading branch information
k8s-ci-robot committed Mar 4, 2020
2 parents adedb89 + 9cab4bd commit 98d267f
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions coredns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,17 @@ A few differences so we can use go modules and [crane](https://github.com/google
Created with kubebuilder:

```bash
kubebuilder init --dep=false --domain=k8s.io --license apache2
export KUBEBUILDER_ENABLE_PLUGINS=1
kubebuilder init --fetch-dep=false --domain=k8s.io --license=apache2

kubebuilder create api --controller=true --example=false --group=addons --kind=CoreDNS --make=false --namespaced=true --resource=true --version=v1alpha1
kubebuilder create api --pattern addon --controller=true --example=false --group=addons --kind=CoreDNS --make=false --namespaced=true --resource=true --version=v1alpha1

```

Switched to go modules:
Run go mod vendor:

```bash
export GO111MODULE=on
go mod init sigs.k8s.io/cluster-addons/coredns

# Insert our tools.go for extra dependencies
cp ../tools.go tools.go

go get -m k8s.io/client-go@v10.0.0
go get -m k8s.io/api@kubernetes-1.13.5
go get -m k8s.io/apimachinery@kubernetes-1.13.5
go get -m k8s.io/apiserver@kubernetes-1.13.5
go get -m k8s.io/apiextensions-apiserver@kubernetes-1.13.5

go mod vendor

rm Gopkg.toml
```

Delete the test suites that are more checking that kubebuilder is working:
Expand Down Expand Up @@ -73,12 +60,8 @@ EOF
Running the operator locally:

```bash
export GOPATH=<go-path>
go mod vendor
make
go build -o bin/manager sigs.k8s.io/cluster-addons/coredns/cmd/manager
make install
bin/manager
make run
```
We can see logs from the operator!

Expand Down

0 comments on commit 98d267f

Please sign in to comment.