mchirico / kbt

kubebuilder -- my development lab
0 stars 0 forks source link

Getting Started Instructions #1

Open mchirico opened 3 years ago

mchirico commented 3 years ago

Install kubebuilder

Use the master branch for linux

os=$(go env GOOS)
arch=$(go env GOARCH)
curl -L https://go.kubebuilder.io/dl/latest/${os}/${arch}| tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.1_master_${arch} /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin

kubebuilder init --domain dev.cwxstat.io
kubebuilder create api --group webapp --version v1 --kind Dev

Port 8080 is used, so kill whatever is running on that port. To see what's running, if anything, issue the following command:

lsof -n -i4TCP:8080

Now view: http://localhost:8080/metrics

Note

The above doesn't work with batch cronjobs..

export CRD_OPTIONS="crd:crdVersions=v1"
kubebuilder init --domain tutorial.kubebuilder.io
kubebuilder create api --group batch --version v1 --kind CronJob

If you run into start issues, you may need to do a make install. The following problem was fixed with a make install

image

Need following workaround

sed -i -r 's/^( +)  or SCTP\. Defaults to "TCP"\./\0\n\1default: TCP/' \
      config/crd/bases/*.yaml

This won't work on mac... address this with yq

tacomonkautobot[bot] commented 3 years ago

mchirico, Thanks for opening this issue!