Kubernetes

Squash has native support for Kubernetes (k8s). Currently this option is only available through the Squash YAML file.

In order to get started you need to add the deployment_type: kubernetes field in the Squash YAML file, for all applications that are Kubernetes based. Then use our Kubernetes specific YAML file fields to customize your applications to fit your needs.

Below you will find some sample Squash YAML files illustrating some common use cases:

Example 1: Kubernetes image

For this example we are showing how to define Kubernetes images in a deployment.

deployments:
  MyAppName:
    kubernetes_build_image: nginx
    deployment_type: kubernetes
    use_kubernetes_registry: true

Example 2: Multiple apps and Helm charts

Here we are defining multiple apps based on helm charts from a single Squash YAML file.

deployments:
  odoo:
    kubernetes_helm_chart: stable/odoo
    kubernetes_helm_parameters: odooPwd=pwd,psql.pslqPwd=secret
    deployment_type: kubernetes
    kubernetes_service: odoo
  drupal:
    kubernetes_helm_chart: stable/drupal
    deployment_type: kubernetes
    kubernetes_service: drupal
  apache:
    kubernetes_helm_chart: bitnami/apache
    deployment_type: kubernetes
    kubernetes_service: apache
    kubernetes_helm_repository: bitnami https://charts.io/xyz

Example 3: Manifest and port forwarding

Here we are using a multi config scenario with  manifests and port forwarding.

deployments:
  multiconfigApp:
    kubernetes_manifest: pod.yml, pod2.yml
    deployment_type: kubernetes
    kubernetes_default_image: rss-site
    kubernetes_port_mapping: redmine:3000
    subdomain_port_mapping: redmine:3000

Example 4: Multiple helm charts and subdomain port mapping

For this example we are defining multiple helm charts for the same application and associating specific container ports with a Squash subdomain.

deployments:
  MyApp:
    kubernetes_helm_chart: 
      - stable/drupal
      - bitnami/apache
      - kiwigrid/graphite
    deployment_type: kubernetes
    kubernetes_service: drupal
    kubernetes_default_pod: drupal
    kubernetes_helm_repository: 
      - bitnami https://charts.bitnami.com/bitnami
      - kiwigrid https://kiwigrid.github.io
    kubernetes_port_mapping:
      - svc/apache:3000:80
      - svc/graphite:8080
    subdomain_port_mapping: 
      - apache:3000
      - graphite:8080

Example 5: Using a private registry

Here we are using a private registry to build the k8s cluster. You can also use Squash Environment Variables to keep the REGISTRY_PASSWORD secured.

deployments:
  MyApp:
    kubernetes_helm_chart: stable/drupal
    deployment_type: kubernetes
    kubernetes_service: odoo
    docker_registry:
      server: example.io
      username: myapp_user
      password: $REGISTRY_PASSWORD

For more information please check our Kubernetes specific YAML file fields.

Persistent Storage

Currently the Persistent Storage feature is not available for Kubernetes deployments. We will be adding this soon.