Setting up your project
The first step in starting a fresh Operator project is to initialize an empty project structure. First, create an empty project directory with mkdir nginx-operator
and cd
into it. Now, initialize a boilerplate project structure with the following:
operator-sdk init --domain example.com --repo github.com/example/nginx-operator
Note
This command may take a few moments to complete the first time it is run.
This command sets up a lot of different files and folders that will be filled in with the custom APIs and logic for the Operator we are building. The once-empty project directory should now contain the following files:
~/nginx-operator$ ls total 112K drwxr-xr-x 12 mdame staff 384 Dec 22 21:07 . drwxr-xr-x+ 282 mdame staff 8.9K Dec 22 21:06 .. drwx------ 8 mdame staff 256 Dec 22 21:07 config drwx------ 3 mdame staff 96 Dec 22 21:06 hack -rw--...