Managing the Git Configuration Repository
The Git Config Repository is where the cluster configuration is stored. It contains the cluster definition and your application manifests.
Flux is used to sync the Git Config Repository and the cluster so its important to have it configured correctly. WKP supports GitHub and GitLab (Cloud or self-hosted).
wk setup
#
Initial configuration during In order to create a cluster, we first need to define and configure its properties. To do that, we run wk setup install
which generates a set of files in the current directory, that will be used for the configuration of our new cluster. The directory also includes a new local git repository that tracks the newly generated files.
The generated files include:
/bin
eksctl
: used when creating an EKS clusterfootloose
: used when creating a Footloose clusterhub
: used to interact with GitHubignite
: used to run a Footloose cluster with an ignite backendjk
: used to generate configurationkubeseal
: used to interact with sealed secrets
/cluster
/manifests
: manifests for user-defined workloads that need to run on the cluster will live here/platform
: additional WKP runtime configuration files
/doc
: creation guides/setup
config.yaml
: main configuration file used when creating a cluster
After running wk setup install
we configure WKP by editing config.yaml
. WKP needs to know a little bit about how and where you're hosting your git repository. The main parameter in config.yaml
is the gitProvider
and can be set either to github
or gitlab
.
A detailed documentation for config.yaml
can be found in config.yaml
file itself.
#
GitHubWhen hosting your config repository on GitHub:.
- In config.yaml set
gitProvider
togithub
- In config.yaml set
gitProviderOrg
to the Github organization or user WKP should create the repository under. - Continue following the instructions in one of the Cluster Creation guides.
#
GitLabNote: For this document, replace:
gitlab.example.com
with your company's gitlab host addressmy-example-repo
with your desired repo namemy-user
with your GitLab username or groupname
When hosting the repository on GitLab:
- In
config.yaml
setgitProvider
togitlab
- visit gitlab.example.com/projects/new and create a new repo,
my-example-repo
Note: WKP does not support repo creation on Gitlab currently, so this is a required step. - In
config.yaml
setgitUrl
to your newly created repository. e.g.git@gitlab.example.com:my-user/my-example-repo
- Continue following the instructions in one of the Cluster Creation guides until you are prompted to run
wk setup run
. When you runwk setup run
a deploy key that gives the cluster read/write access to the git repository will be generated. This deploy key needs to be installed in the GitLab UI: - visit gitlab.example.com/my-user/my-example-repo/settings/repository:
- navigate to the
Deploy Keys
section, andExpand
the section - create a
Title
, it can be anything - Paste the deploy key provided in the command line output into the
Key
section. - [IMPORTANT] ensure
Write access allowed
is checked - click
Add key
- navigate to the
- Re-run
wk setup run
again and continue the Cluster Creation instructions.
#
SSH configurationWKP requires using SSH to sync the git config repo and the cluster. To provide additional security WKP enables StrictHostKeyChecking
and checks that the server providing the git config repo matches a public key that we have stored. For popular git providers like GitHub we include the public key with WKP and no further configuration is needed. For self hosted repositories like Gitlab we need to retrieve and store the server's public key. We save it in a file called known_hosts
.
known_hosts
#
Customizing During wk setup run
your gitProvider
and gitUrl
are checked. If we determine a custom domain is being used we will automatically connect to the server, retrieve the public keys and save them to cluster/platform/ssh_config/known_hosts
. This known_hosts
file will then be loaded into the flux
and gitops-repo-broker
and any other pod that needs to talk to the git config repo.
If you change the keys on your ssh server you may need to regenerate known_hosts
.
Test that the new known_hosts
file works
Commit and push to update the cluster