GithubHelp home page GithubHelp logo

alitari / vscode-kubebuilder Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8 KB

Start right away with a development environment for kubebuilder using Visual Studio Code Remote - Containers

Shell 24.47% Dockerfile 75.53%
kubebuilder kubebuilder-book vscode-remote

vscode-kubebuilder's Introduction

vscode-kubebuilder

Start right away with a development environment for kubebuilder using Visual Studio Code Remote - Containers.

Preparation steps

We assume you have a running docker daemon and a working connection to a kubernetes cluster.

  1. configure vscode in order to be able to use Visual Studio Code Remote - Containers
  2. configure connection to your k8s cluster: copy your kubernetes config file to the .devcontainer directory. e.g. cp ~/.kube/config .devcontainer
  3. use this repo as remote container: Press F1 and select the Remote-Containers: Open Folder in Container... command.

After vscode is has been setup ( can last a few minutes for the first time) check whether all tools are present:

# k8s cluster
kubectl cluster-info
# golang
go version
# docker
docker info
# kubebuilder
kubebuilder version
# kustomize
kustomize version

create a project guestbook ( see kubebuilder-book for details)

create new go module

go mod init guestbook

initialze project framework

kubebuilder init

create API artefacts

kubebuilder create api --group webapp --version v1 --kind Guestbook

install CRDs

make install

run controller

standard with make make run or press F5 for debugging with vscode

install CR

kubectl apply -f config/samples/

build controller image

make docker-build IMG=guestbook-controller:latest

push controller image

You can skip this step when using local cluster. If you have push access rights to the registry:

make docker-push IMG=<registry>/guestbook-controller:latest

Here an example for using docker hub (docker.io):

docker login
docker tag guestbook-controller:latest <dockerhub-username>/guestbook-controller:latest
make docker-push IMG=<dockerhub-username>/guestbook-controller:latest

deploy controller on cluster

make deploy IMG=<dockerhub-username>/guestbook-controller:latest

vscode-kubebuilder's People

Contributors

alitari avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.