Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Latest commit

 

History

History
178 lines (148 loc) · 9.16 KB

project_descriptor.md

File metadata and controls

178 lines (148 loc) · 9.16 KB

Project Descriptor data model

ProjectDescriptor Structur:

Toplevel ProjectDescriptor

Field Description
api_version The <major>.<minor> version used for this descriptor.
kind The kind of descriptor in this file (Project)
metadata Metainformation about this descriptor e.g.: name and cluster_name
namespaces List of namespaces to be part of this project
resources List of resources to be part of this project
storage_classes List of storage classes on cluster level required for this project
persistent_volumes List of persistent volumes on cluster level required for this project
apps List of rancher apps to be deployed to this project

metadata

  • In the descriptor only name should be set.
  • All other fields are read from configuration or rancher
Field Description
name The name of the project REQUIRED
id Rancher internal ID of this project (read from rancher)
rancher_url The URL to reach the rancher (placed from cattleclt configuration)
access_key The access key to access rancher with (placed from cattleclt configuration)
secret_key The secret key to access rancher with (placed from cattleclt configuration)
token_key The token key to access rancher with (placed from cattleclt configuration)
cluster_name The name of the cluster the project is part of (placed from cattleclt configuration)
cluster_id The ID of the cluster the project is part of (read from rancher)
includes A list of includes containing project descriptors OPTIONAL

include

Field Description
file The file (relative of absolute) to include
files The files pattern (relative of absolute) to include all matching files
directory The directory (relative of absolute) to include all YAML files from

namespaces

Field Description
name The name of the namespace

resources

Field Description
certificates Array of certificates to deploy
config_maps Array of config maps to deploy
docker_credentials Array of docker credential to deploy
secrets Array of secrets to deploy

certificate

Field Description
name The name of the certificate resource
key Private key to the certificate
certs One string with all certs
namespace if empty the certificate is deployed to all namespaces of the project

config_map

Field Description
name The name of the config map
data map[string]string structure representing the config map payload

docker_credential

Field Description
name The name of the docker credential
namespace if empty the certificate is deployed to all namespaces of the project
registries Array of registry credentials for this resource

registry

Field Description
name The name of the registry
username The username of the registry
password The password of the registry

secret

Field Description
name The name of the secret
data map[string]string structure representing the config map payload

storage classes

Field Description
name The name of the storage class
provisioner The provisioner used by this storage class
reclaim_policy The reclaim policy of this storage class
volume_bind_mode The volume bind mode of this storage class
parameters key value map of parameters
mount_options array of options to mount the volumes of this storage class

persistent volume

Field Description
name The name of the persistent volume
path For local persistent volumes the path pattern to use
node For local persistent volumes the node to bound.
storage_class_name Name of the storage class this pv is available for.
access_modes Array of access modes for this pv.
capacity Capacity of this pv.
init_script For log informations the hint how to create the required directories.

apps

Field Description
name The name of the app/deployment
catalog The catalog to find the rancher chart in
catalog_type The type of the catalog (projectCatalog or clusterCatalog) - empty for global catalogs
template The name of the rancher chart to be used
version The version of the rancher chart
namespace The namespace to deploy the app in
answers The answers to the rancher questions as key-value map
valuesYaml The values to apply with the template

Example:

---
api_version: v1.0
kind: Project
metadata:
  name: my-wordpress-blog
namespaces:
  - name: my-wordpress-blog-web
storage_classes:
  - name: my-wordpress-blog-local-mariadb
    provisioner: kubernetes.io/no-provisioner
    reclaim_policy: Delete
    volume_bind_mode: WaitForFirstConsumer
persistent_volumes:
  - name: my-wordpress-blog-mariadb-node-1
    type: local
    node: node-1
    path: /var/data/my-wordpress-blog-mariadb
    capacity: "3Gi"
    access_modes:
      - "ReadWriteOnce"
    create_script: ssh ${node} sudo mkdir -p ${path}
apps:
- name: editorial-namespace
  catalog: library
  chart: wordpress
  version: "2.1.10"
  namespace: my-wordpress-blog-web
  answers:
    wordpressUsername: user
    wordpressPassword: ""
    wordpressEmail: user@example.com
    mariadb.enabled: true
    mariadb.db.name: wordpress
    mariadb.db.user: wordpress
    mariadb.master.persistence.enabled: 'true'
    mariadb.master.persistence.size: 8Gi
    mariadb.master.persistence.storageClass: "my-wordpress-blog-local-mariadb"
    ingress.enabled: false
    serviceType: ClusterIP