A HELM Deployment toolkit
Project description
HELM Deployment Toolkit
A deployment toolkit that support:
- Build and push docker image. (Now supported container repositories:
AzureCR
) - Apply helm packages and values.
- Link to aks. (Azure kubenetes services)
And you could use it with both command-line and guiding ways.
Installation
via pip
pip install helmdt
via release
Download the latest stable release (.whl
) from the release page.
pip install helmdt-x.x.x-py3-none-any.whl
Guiding Way
This way gives you a guiding flow to deploy your service by select options and input values.
helmdt [ACTION]
The helmdt
tools will find helmdt.yaml
, helmdt.yml
or helmdt.json
and load them as the profile.
If those files are all not found, an error would displayed.
Manually specify the profile
If you want to manually specify the profile file, you could use -f
argument. Just like:
helmdt -f profile.yaml [ACTION]
helmdt -f ../profile.yaml [ACTION]
helmdt -f /home/profile.yaml [ACTION]
These arguments must before the [ACTION] section.
-f | File
Set the profile file to use.
Actions
depcheck
Check the dependencies if they were installed.
build
Build the docker image and push it.
The tag of the image would be like: build-[SHORT GIT COMMIT HASH]
, for example: build-e7f38761
.
apply
Apply the helm package and values. and some extra values would be passed to helm package:
- image.tag - The tag that the docker image used. It would first be checked if exists before applying.
- meta.* - The metadata from the profile would also passed to helm.
link
Link the kubenetes context and store it locally (into local kubenetes configuration).
Current supported service providers: Azure Kubenetes Services
.
Command Line Way
By passing the arguments to helmdt
, the helmdt
tools would not run in guiding way. If some of the arguments are missing, it would still ask you on-demand.
helmdt link -n developers-internal
helmdt build -n stripe-worker -y --no-cache
helmdt apply -n stripe-worker -e dev -y
The follow arguments must be after the [ACTION] section.
--yes | Yes
Automatically skip all the prompts and answer yes
for them. If some of the arguments are missing, and also the -y
specified, an error would be displayed and the tools would be terminated.
-n/--name | Name
- For
build
, the name of the docker profile to build and push. - For
apply
, the name of the helm package profile to apply. - For
link
, the name of the kubenetes context.
-e/--env | Environment
The environment to apply. This argument only used in the apply
action.
--no-cache | Stop using cache
bypass the --no-cache
to docker build
. This argument only used in the build
action.
Profile file structure
<root>
kubecontexts
: (Kubenetes Context Profile) The contexts could be linked.docker
: (Docker Image Profile) The profiles for docker build and push.helm
: (Helm Package Profile) The profiles for helm apply.
Kubernetes Context Profile
-
name
: (string) The short name for the kubernetes context to be link, only used in the script. -
provider
: (string) The name of the service provider. Now we only supported:-
azure
: Azure kubernetes Services.If you'd like to use Azure kubernetes Services, you should also specify the follow keys with the same level with
provider
.subscription
: (string) The subscription id in the azure portal.resource_group
: (string) The resource group that the kubernetes contained.aks_name
: (string) The name of the kubernetes service.
-
Docker Image Profile
name
: (string) The short name for the docker profile, just used in the script.image_name
: (string) The image name placed in the local and pushed to the repository.repository
: (string) The address of the repository.dockerfile
: (string) The Dockerfile used for building.contextpath
: (string) The path of building context. If not specified, the parent folder ofdockerfile
would be used by default.
HELM Package Profile
name
: (string) The short name for the helm profile, just used in the script.namespace
: (string) The namespace to apply. If not exists, it would created automatically.dpname
: (string) The name for the helm deployment, could be found in kubenetes/Deployment.package
: (string) The path of the package.environments
: (list of Helm Environment Profile) The environment entries.
Helm Environment Profile
name
: (string) The short name for the environment profile, just used in the script.values_file
: (string) The values file.kubecontext
: (string) The name of the kubenetes context where the helm package to be applied.
Helm Repository Profile
name
: (string) The name for the repository profile, will be added to helm.url
: (string) The url of the repository.
Variables
$(gitroot)
- Would be replated to the root path of the current git repository.
Example
kubecontexts:
- name: int
provider: azure
subscription: xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
resource_group: resource-group
aks_name: service1-int
helm_repos:
- name: bitnami
url: https://charts.bitnami.com/bitnami
docker:
- name: service1
image_name: service1
dockerfile: $(gitroot)/docker/service1/Dockerfile
context: $(gitroot)/src
repository: xxx.azurecr.io
helm:
- name: service1
dpname: service1
namespace: ns1
package: $(gitroot)/helm-packages
environments:
- name: dev
values_file: $(gitroot)/helm-values/dev.yaml
kubecontext: service1-dev
- name: prod
values_file: $(gitroot)/helm-values/prod.yaml
kubecontext: service1-prod
- name: service_from_repo
dpname: service_from_repo
namespace: ns1
package: mariadb
environments:
- name: dev
values_file: $(gitroot)/helm-values/dev.yaml
kubecontext: service1-dev
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file helmdt-0.6.1.tar.gz
.
File metadata
- Download URL: helmdt-0.6.1.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5bfcd534b32eda62342db04680290ad719d501ec4ff1796bb1420b2412f756e |
|
MD5 | 3a70255f55f01e05b529b70267d49163 |
|
BLAKE2b-256 | 32173003456b76977bf033e3090ec76330dbefb54c70177657ce451772a7a959 |
File details
Details for the file helmdt-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: helmdt-0.6.1-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78cbc96281f79e538655a32d8ffcc4de1728e5f64c958b84df2824682bb8561f |
|
MD5 | 25f3e3c54faf28a446d6096793468ba3 |
|
BLAKE2b-256 | 2193e5c89f2eb2f431f748026f73a9ae1cab09407d60f8d028edbe8e12e32dfe |
File details
Details for the file helmdt-0.6.1-py2.py3-none-any.whl
.
File metadata
- Download URL: helmdt-0.6.1-py2.py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae1a983e978db3baada62b119a236f8dccad6af6f3d7fb0d34d774a13e8cf103 |
|
MD5 | 2d974456bbe206e8831de523e192c31b |
|
BLAKE2b-256 | 2e252b11da3df909d52c052160db5e70d0fd572ff4a72b4b104b943d55c2d1e1 |