This tool can help you manage the yaml (JSON) files in Git and automatically deploy them to the k8s cluster, so as to realize file to version control, facilitate team management and avoid manual deployment.
- Make sure that you can access the k8s cluster network
- you can operate the k8s cluster by serviceaccount in pod
- Clone the code
- In the project root catalog, run mvn clean package
- Run docker build -t [imageName]:[imageTag] .
then you can run this image in your local or in k8s cluster.These methods are described below.
- deploy this image to your k8s cluster as a deployment
- create a service for the deployment
- Run docker run -e [some envs] [imageName]:[imageTag]
- Run docker exec -it [container id] bash
- Configure the config file to $HOME/.kube/
- Test whether the kubectl command can obtain the k8s cluster information
- Configure the config file to $HOME/.kube/
- Test whether the kubectl command can obtain the k8s cluster information
- Run java -jar [your jar]
- Git webhook: through the web hook function of git, the modification request is sent to the specified URL.
- Timing git pull: set the pull interval to realize automatic deployment
Name | Required | Settable Value | Mode | Description |
---|---|---|---|---|
REMOTE_REPO_URL | Y | repo http address | ||
BRANCH | Y | your branch name(master is recommended) | ||
LOCAL_PATH | Y | git file path in your local or pod | ||
USERNAME | Y | repo username | ||
PASSWORD | Y | repo password | ||
AUTODEPLOY_TYPE | Y | webhook/timing | use mode | |
TIME_INTERVAL_OF_PULL | N | timing | time interval of pull | |
NEED_PROXY | N | if need proxy | ||
HTTP_PROXY | N | proxy address | ||
HTTP_PORT | N | proxy port |
For git modification, only add, modify and delete are supported now, because I consider that rename and copy are not very necessary for managing files.
- add deployment.yaml and service.yaml
- retry