Installs components in Kubernetes with Helm, creates one or multiple CronJob resources.
Make sure to create a secret for sensitive variables (like passwords and keys). Copy the default values.yaml somewhere, edit the new file accordingly, and proceed with installation. You can always use --set directive for helm upgrade or helm install commands to avoid storing values files in a repository.
Make the charts discoverable by adding the repository to your list:
shellhelm repo add corewide https://solutions.corewide.com/helm/
Chart values (see the table below) can be passed one by one using --set argument or via
a configuration file. You can create one based on the defaults using the following command:
shellhelm show values corewide/docr-cleanup > values.yaml
Install the chart after editing your values.yaml:
shellhelm repo update
helm install docr-cleanup corewide/docr-cleanup --version 1.0.2 -f values.yaml
Define Helm provider configuration in your project code, then:
hclresource "helm_release" "docr_cleanup" {
name = "docr-cleanup"
repository = "oci://oci.corewide.com/helm"
chart = "docr-cleanup"
version = "1.0.2"
# define your values as set blocks:
set {
...
}
}
|
Chart
85% off
|
€50
|
| TOTAL | €230 |
| DOCR Image Cleanup | €190 |
Installs components in Kubernetes with Helm, creates one or multiple CronJob resources.
Make sure to create a secret for sensitive variables (like passwords and keys). Copy the default values.yaml somewhere, edit the new file accordingly, and proceed with installation. You can always use --set directive for helm upgrade or helm install commands to avoid storing values files in a repository.
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.1.21.1.1Initial version:
1.1.0 of the DOCR cleanup imagePrepare a Kubernetes Secret with DigitalOcean Access Token which allows access to DigitalOcean Container Registry:
yaml# access-token-secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: api-key
data:
DIGITALOCEAN_ACCESS_TOKEN: <base64-encoded-access-token>
Deploy the secret:
bashkubectl create namespace cleanups
kubectl -n cleanups apply -f access-token-secret.yaml
Define cleanup configuration in values.yaml and use it to install Helm release:
yamlimagePullSecrets:
- "corewide"
cleanupRegistry: myregistry
cleanupRepositories:
- "myapp"
cleanupKeepTags: 50
cleanupRetentionDays: 7
secretNamesForEnvFrom:
- "api-key"
schedule: "0 0 * * *"
| Parameter | Type | Description | Default | Required |
|---|---|---|---|---|
image |
map |
A block that describes Docker image pod configuration | ||
image.repository |
string |
Address of Docker image repository | oci.corewide.com/docker/docr-cleanup |
no |
image.tag |
string |
Docker image tag. Defaults to Helm chart's AppVersion |
no | |
image.pullPolicy |
string |
Conditions for pulling new container images | Always |
no |
imagePullSecrets |
list |
Reference to secret with access credentials of Docker image Container Registry | [] |
no |
podAnnotations |
map |
Annotations to attach to pods deployed by the chart | {} |
no |
podSecurityContext |
map |
Security context parameters to pass to pods deployed by the chart | {} |
no |
podLabels |
map |
Provide custom labels to created pod | {} |
no |
securityContext |
map |
Security context parameters to pass to containers in pods deployed by the chart | {} |
no |
resources |
map |
Container resource parameters to pass to application pods | {} |
no |
nodeSelector |
map |
Node selector to attach to pods deployed by the chart | {} |
no |
tolerations |
list(map) |
List of toleration policies to attach to pods deployed by the chart | [] |
no |
affinity |
map |
Set of node affinity parameters for pods deployed by the chart | {} |
no |
successfulJobsHistoryLimit |
int |
How many completed jobs will be kept | 7 |
no |
failedJobsHistoryLimit |
int |
How many failed jobs will be kept | 3 |
no |
cleanupRegistry |
string |
DOCR registry name | yes | |
cleanupRepositories |
list(string) |
List of DOCR repository names to cleanup | yes | |
cleanupKeepTags |
int |
Number of recent tags (starting from the newest) to keep during the cleanup | 50 |
no |
cleanupRetentionDays |
int |
Number of days to retain images | 7 |
no |
secretNamesForEnvFrom |
list(string) |
List of secrets to populate container environment with | [] |
no |
schedule |
string |
A schedule to run cleanup | "0 0 * * *" |
no |