Custom
Custom Application Stack
The Custom SCALE AppStack is a flexible toolkit and CI/CD workflow that allows teams to build and deploy any containerized application to the SCALE environment. Unlike pre-built stacks (such as Node.js, Nginx, or Envoy), the Custom stack does not enforce a specific runtime or framework. Instead, it provides a template Dockerfile and Helm chart that you can replace or modify to suit your application's needs.
The Custom stack ships with a working sample application based on Nginx. This sample is intended as a starting point - you can completely replace the Dockerfile and source code with your own while retaining the CI/CD pipeline integration and Helm-based deployment.
The containers produced in this application stack share common requirements with other application stacks deployed to the SCALE environment.
For details on getting started, see getting started.
Repository Directory Structure
The Custom stack repository contains the following key files and directories:
- Dockerfile - A template Dockerfile at the root of the repository. The default sample builds an Nginx-based container. You can replace this entirely with your own Dockerfile.
- source/ - Contains the sample application source files (HTML content and Nginx configuration). Replace these with your own application source code.
- Helm chart directory (e.g.
dxp-myapp/) - Contains the Helm chart used for deploying your application to Kubernetes. The name of this directory is chosen by your team. It includes:- Chart.yaml - Helm chart metadata
- templates/ - Kubernetes resource templates (deployment, service, gateway-api, HPA, configmap, cyberark-secrets, volume)
- values.yaml - Default Helm values for your application
- values.workspace.yaml, values.dnt.yaml, values.stg.yaml, values.prd.yaml - Environment-specific value overrides
- azure-pipelines.yml - Pipeline definition referencing
devops/custom.yml@spaces
Also at the top of the repository is a file called azure-pipelines.yml. This file contains reference to the appropriate version of the CI/CD pipeline logic, some variables unique to the application (e.g. container version) as well as YAML data structures providing key information about the environments into which to deploy the application and the sequence of events to complete the deployment.
For details on application configuration, see application configuration.
Customizing the Dockerfile
The included Dockerfile is a working sample that builds an Nginx-based container. You are expected to replace it with your own Dockerfile that builds your application.
When writing your own Dockerfile, keep the following requirements in mind:
- Use NetApp's Artifactory as your base image source. Instead of pulling directly from Docker Hub (e.g.
alpine:latest), use the Artifactory mirror:docker-ngdc.artifactory.devops.netapp.com/alpine:latest. For details on generating an Artifactory identity token for authentication, see Artifactory Token. - Update the Helm chart with your application's port. Remember to update the
service.portvalue in the helm chartvalues.yamlfile to match the port your container exposes. - Run as a non-root user Our Rancher environment enforces that applications run as a non-root user. You will need to make sure your image and app is designed to run as any uid/gid.
Customizing the Helm Chart
The Helm chart directory contains a complete Helm chart that you can modify to match your application's deployment requirements. Key files to customize:
- values.yaml - Update resource limits, replica count, service port, liveness/readiness probes, and image settings to match your application.
- templates/deployment.yaml - Modify if your application requires additional environment variables, volume mounts, or container configuration.
- templates/configmap.yaml - Add application-specific configuration data.
- templates/gateway-api.yaml - Configure ingress routing for your application.
- Environment override files (values.workspace.yaml, values.dnt.yaml, values.stg.yaml, values.prd.yaml) - Set environment-specific values for each deployment target.
For details on CI/CD pipelines, see CI/CD pipelines.
For details on pipeline definition, see pipeline definition.
Application-Specific Pipeline Configuration
The parameters YAML object is defined immediately following the template object and at the same indentation level. This is the object that requires the most attention and definition to be set up. The parameters YAML object includes multiple parameters which can be used to configure the CI/CD pipeline. A typical setting in here would be to define appVersion used to build the application, looking like the following (including all of the extends object preceding it):
parameters:
appVersion: 4.8.x
For details on defining hostspaces, see defining hostspaces.
For details on skipping deployments, see skipping deployments.
For details on Horizontal Pod Autoscaler, see Horizontal Pod Autoscaler.
For details on PVC for application stacks, see PVC for application stacks.
For details on Pod Anti-Affinity, see Pod Anti-Affinity.
For details on detailed pipeline configuration, see detailed pipeline configuration.
For details on Kubernetes deployment objects, see Kubernetes deployment objects.
For details on troubleshooting, see troubleshooting.