This repository contains the Helmfile and Kubernetes configurations for deploying the StackClass platform, including its core services and dependencies. The charts used come from the helm charts repository and external providers.
Before deploying, ensure you have the following tools installed:
kubectl- configured to access your Kubernetes cluster.helm- package manager for Kubernetes applications.helmfile- declarative spec for deploying Helm charts.yq- YAML processor for command-line operations. (optional)jq- Lightweight command-line JSON processor. (optional)
-
Clone the repository:
git clone https://github.com/stackclass/infra.git cd infra -
Initialize Helmfile:
helmfile init
This will install the required plugins and set up the Helmfile environment.
Helmfile uses environments (such as development and production) to
manage deployments for different environments. These environments are specified
using the --environments flag when running helmfile apply or sync.
To configure services for your deployment, edit the YAML files in the values/
directory. Key files include:
values/global.yaml: Controls which services are enabled globally. - Service-specific files likevalues/gitea/values.yaml: Configure settings for individual services.
For environment-specific overrides, edit the corresponding files under
values/<service>/{{ .Environment.Name }}.yaml. For example:
values/cert-manager/development.yamlfor thedevelopmentprofile.values/cert-manager/production.yamlfor theproductionprofile.
-
Install all services for an environment (e.g.,
developmentorproduction): This will sync all releases defined inhelmfile.yamlfor the specified environment.just install development # or `just install production` -
Uninstall all services for an environment: This will destroy all releases for the specified environment.
just uninstall development # or `just uninstall production`
Use the tier and environment positional arguments to target specific
tiers (common, deps, or app) for granular control.
-
Apply changes for a tier (e.g.,
commoninfrastructure components): This will apply changes (create/update) for the specified tier in the given environment.just apply common development # tier=common, environment=development -
Sync a tier (e.g.,
depsdependencies): This will synchronize the state of the specified tier in the given environment.just sync deps production # tier=deps, environment=production -
Destroy a tier (e.g.,
appmain application): This will uninstall all releases in the specified tier for the given environment.just destroy app development # tier=app, environment=development
-
Dry Run: Preview changes for a tier without applying them:
helmfile --environment <env> --selector tier=<tier> apply --dry-run
This task is intended for maintainers to fetch the default values of Helm
charts. It should be run whenever the Helm chart versions are updated in
helmfile.yaml.
just fetch-default-valuesRun linting to validate configurations:
just lintThe repository includes a GitHub Actions workflow (ci.yml) for linting and
validation on pull requests and pushes.
Contributions are welcome! Please open an issue or submit a pull request.
Copyright (c) The StackClass Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.