** For Atlassian Internal Use Only **
This pipe converts archetype descriptor or a service descriptor to KITT Helm values.
The CONFIG variable should contain the conversion configuration in YAML format. The configuration can include the
following fields:
kushi: [required] all available arguments for kushi migrate command, you need figure out by run
atlas kushi migrate --help locally
archetype-descriptor: [required] the path to the archetype descriptor fileoutput-dir: [required] the output directory for the Helm chartsvalues-overrides Schema, a list of values overrides to be applied to the Helm
chartsvalues-removals Schema, a list of values fields to be removed from Helm valuesvalues-overrides Schemafile: [required] the path to the values overrides file, relative to kushi.output-dir e.g. values.yaml,
stg-east/values.yamlvalues: [required] a map of values to be overridden in the Helm charts, e.g. {"image.tag": "latest"}values-removals Schemafile: [required] the path to the values removals file, relative to kushi.output-dir e.g. values.yaml,
stg-east/values.yamlvalues: [required] a list of values fields to be removed from the Helm charts.Examples,
values-overrides:
- file: values.yaml
values:
kitt-application:
secrets:
vault: { }
- file: stg-east/values.yaml
values:
kitt-application:
secrets:
vault:
static:
shard-purpose: ""
listFields: [ "a" ]
kushi:
service: confluence-dev-us-11
environment: stg-east,649535320606
archetype-descriptor: ./tests/fixtures/archetype-descriptor.yaml
output-dir: ./helm/confluence-dev-us-11
main-container: confluence
request-cpu: 5000m
request-memory: 16Gi
limit-cpu: 5000m
limit-memory: 16Gi
worker:
- AmqWorker,5000m,16Gi,5000m,16Gi
sidecar:
- cc-nginx-sidecar,500m,100Mi,500m,350Mi
- hofund,500m,100Mi,500m,350Mi
ignore-error:
- multiple-load-balancers
- sidecar-poco
- unsupported-characters
debug: "" # set an options with empty string to use it as a flag, similar to --debug in CLI
skip-docker-distributor-generation: ""
skip-kitt-descriptor-generation: ""
values-overrides: config/values-overrides.yaml # we could use a file to override values, but it's not flexible enough and cannot completely remove a field, that's why we have this pipe
values-removals:
- file: values.yaml
values:
kitt-application:
secrets:
vault:
static:
shard-purpose: { } # remove the field completely
values-overrides:
- file: blah/values.yaml # it will skip, if the file does not exist
values: { } # it does nothing, if no values are provided
- file: stg-east/values.yaml
values:
kitt-application:
global:
kitt:
v1alpha2:
cluster:
cloud_type: gcp # add the field if does not exist, or modify the value if it differs
- file: values.yaml # it will override the values in the file
values: { }
archetype-removals:
definitions:
serviceDescriptor:
definitions:
isolatedCloudServiceDescriptor: { } # ic conversion throws too many errors, so we need to remove it completely for now
archetype-overrides:
definitions:
serviceDescriptor:
compose:
upp-sidecar:
ports:
- 8181:8484 # origin was 8181:8181 which conflicts with poco-sidecar
For the above example, for values.yaml, it will completely remove the kitt-application.secrets.vault field, and for
stg-east/values.yaml, it will remove the kitt-application.secrets.vault.static.shard-purpose field. In addition, it
will remove the kitt-application.listFields.a field from the list.
Please be noted,
CONFIG variable, which contains the conversion configuration.SERVICE_DESCRIPTOR variable is provided, it will convert the service descriptor to an archetype descriptor.atlas kushi migrate command to convert the archetype descriptor to Helm charts.GIT_ENABLED is set to true, it will commit the changes to the git repository.PULL_REQUEST_ENABLED is set to true, it will create a pull request with the changes.| Variable | Required | Default | Description |
|---|---|---|---|
CONFIG | Yes | The conversion config. | |
SERVICE_DESCRIPTOR | No | The service descriptor file path. This only applies to monolith, as we need to convert SD to archetype descriptor first. | |
DEBUG_MODE | No | "false" | Enable debug logging mode. |
ARTIFACTORY_USERNAME | Yes | Username for Artifactory authentication. Use artifactory-sidekick exported env var. | |
ARTIFACTORY_PASSWORD | Yes | Password for Artifactory authentication. Use artifactory-sidekick exported env var. | |
GIT_ENABLED | No | "false" | Enable git operations for committing changes. If there is no changes, nothing will be committed. |
GIT_EMAIL | No | Email address for git commits. | |
GIT_USERNAME | No | "x-token-auth" | Username for git authentication. |
GIT_PASSWORD | No | Password or access token for git authentication. | |
GIT_PROJECT | No | "atlassian" | Git project/organization name. |
COMMIT_MESSAGE | No | "noissue: Convert Helm values" | Commit message for changes. |
PULL_REQUEST_ENABLED | No | "false" | Enable automatic pull request creation. |
PULL_REQUEST_PREFIX | No | "NOISSUE: convert archetype descriptor to helm values" | Prefix for pull request titles. |
PULL_REQUEST_BRANCH_PREFIX | No | "NOISSEUE/convert-helm-values" | Prefix for pull request branch names. |
PULL_REQUEST_DESTINATION_BRANCH | No | Target branch for pull requests. If not provided, repo default branch will be used. |
The artifactory credentials are expected and will be used to log into Helm repository to generate Helm charts.
This can be obtained by using the atlassian/artifactory-sidekick:v1 pipe, the pipe will export the following
environment variables:
ARTIFACTORY_USERNAMEARTIFACTORY_PASSWORDTo use Bitbucket for git operations, you need to provide a repository access token with the required permissions. This
can be set in the GIT_PASSWORD variable.
Repository settings in Bitbucket.Access tokens in the left sidebar.Create access token, the token name will be the Bot name, so choose a meaningful name.GIT_PASSWORD variable.GIT_EMAIL variable.x-token-auth) as GIT_USERNAME variable.Please be noted that the username is always x-token-auth for Bitbucket, therefore you could rely on the default value
for GIT_USERNAME.
Once you have obtained the access token, you can set it in the GIT_PASSWORD pipeline variable.
Repository settings in Bitbucket.Repository variables in the left sidebar.GIT_PASSWORD and paste the access token (secret).GIT_EMAIL and paste the email address you used to create the access token.In your bitbucket-pipelines.yml file, you can use the pipe as follows:
pipelines:
custom:
convert-helm-values:
- step:
name: Convert Helm Values
script:
- pipe: atlassian/artifactory-sidekick:v1 # must have this to prepare for artifactory authentication
- source .artifactory/activate.sh
- pipe: docker://atlassian/convert-helm-values:latest
variables:
CONFIG: 'convert-helm-values.yaml'
SERVICE_DESCRIPTOR: 'path/to/service-descriptor.yaml' # optional, ONLY FOR MONOLITH, if you want to convert SD to Archetype descriptor first
ARTIFACTORY_USERNAME: ${ARTIFACTORY_USERNAME} # required for Helm repository authentication, exported by artifactory-sidekick
ARTIFACTORY_PASSWORD: ${ARTIFACTORY_PASSWORD} # required for Helm repository authentication, exported by artifactory-sidekick
DEBUG_MODE: 'true' # optional, set to true to enable debug mode
GIT_ENABLED: 'true' # optional, set to true to enable git operations
GIT_EMAIL: ${GIT_EMAIL} # optional, set the git email address in pipeline variables
GIT_USERNAME: ${GIT_USERNAME} # optional, set the git username in pipeline variables
GIT_PASSWORD: ${GIT_PASSWORD} # optional, set the git access token in pipeline variables
PULL_REQUEST_ENABLED: 'true' # optional, set to true to enable pull request creation
Content type
Image
Digest
sha256:3e43f958f…
Size
317.7 MB
Last updated
about 1 year ago
docker pull atlassian/convert-helm-valuesPulls:
44
Last week