From 7672f22888f78d42396fd3b7562ecd8bb7e63c00 Mon Sep 17 00:00:00 2001 From: Charlie Drage Date: Thu, 18 Jan 2018 08:18:41 -0500 Subject: [PATCH] New Kedge structure = new documentation This reorganizes and rewrites many parts of the file reference to reflect the new format of Kedge (separate keys for each controller). Tables are now correctly formatted as well as some minor reoganizational / structural changes to the documentation. --- docs/file-reference.md | 795 ++++++++++++++++++++--------------------- docs/quickstart.md | 5 +- 2 files changed, 395 insertions(+), 405 deletions(-) diff --git a/docs/file-reference.md b/docs/file-reference.md index c14bcfb70..8780d33b1 100644 --- a/docs/file-reference.md +++ b/docs/file-reference.md @@ -5,8 +5,9 @@ ```yaml name: httpd -containers: -- image: centos/httpd +deployments: +- containers: + - image: centos/httpd services: - name: httpd @@ -36,21 +37,38 @@ Endpoints: 172.17.0.4:80 ... ``` +__Note:__ This markdown file is best viewed at [kedgeproject.org/file-reference/](http://kedgeproject.org/file-reference/). + +Kedge is a simple, easy and declarative way to define and deploy applications to Kubernetes by writing very concise application definitions. + +It's an **extension** of Kubernetes constructs and extends many concepts of Kubernetes you're familiar with, such as PodSpec. + +**Installation and Quick Start** + +Installing Kedge can be found at [kedgeproject.org](http://kedgeproject.org) or alternatively, the [GitHub release page](https://github.com/kedgeproject/kedge/releases). + +If you haven't used Kedge yet, we recommend using the [Quick Start](http://kedgeproject.org/quickstart/) guide, or follow the instructions within the side-bar. + + +## Extending Kubernetes + > Extending Kedge as well as using a shortcut ```yaml name: web -containers: -- image: nginx - # Extending the Kedge file using: - # https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#container-v1-core - livenessProbe: - httpGet: - path: / - port: 80 - initialDelaySeconds: 20 - timeoutSeconds: 5 +deployments: +- name: web + containers: + - image: nginx + # Extending the Kedge file using: + # https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#container-v1-core + livenessProbe: + httpGet: + path: / + port: 80 + initialDelaySeconds: 20 + timeoutSeconds: 5 services: - name: nginx @@ -60,20 +78,6 @@ services: - 8080:80 ``` -__Note:__ This markdown file is best viewed at [kedgeproject.org/file-reference/](http://kedgeproject.org/file-reference/). - -Kedge is a simple, easy and declarative way to define and deploy applications to Kubernetes by writing very concise application definitions. - -It's an **extension** of Kubernetes constructs and extends many concepts of Kubernetes you're familiar with, such as PodSpec. - -**Installation and Quick Start** - -Installing Kedge can be found at [kedgeproject.org](http://kedgeproject.org) or alternatively, the [GitHub release page](https://github.com/kedgeproject/kedge/releases). - -If you haven't used Kedge yet, we recommend using the [Quick Start](http://kedgeproject.org/quickstart/) guide, or follow the instructions within the side-bar. - -**Extending Kubernetes** - Kedge introduces a simplification of Kubernetes constructs in order to make application development simple and easy to modify/deploy. However, in many parts of Kedge, you're able to use the standard Kubernetes constructs you may already know. @@ -89,52 +93,58 @@ name: appversion: controller: labels: -containers: - - +deployments: +- +jobs: +- +deploymentConfigs: +- volumeClaims: - - +- configMaps: - - +- services: - - +- ingresses: - - +- routes: - - +- secrets: - - +- imageStreams: - - +- buildConfigs: - - +- includeResources: - - +- ``` -#### Kedge specific - -| Field | Type | Required | Description | -|----------|----------|--------------|--------------| -| name | string | yes | The name of the app or microservice this particular file defines. | -| appversion | string | no | The version of the app or microservice this particular file defines. | -| controller | string | no | The Kubernetes controller of the app or microservice this particular file (default: "deployment") | -| labels | object | no | Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. | -| containers | array of [containerObject](#containerobject) | yes | [containerObject](#containerobject) | -| volumeClaims | array of [persistentVolumeObject](#persistentvolumeobject) | no | [persistentVolumeObject](#persistentvolumeobject) | -| configMap | array of [configMapObject](#configmapobject) | no | [configMapObject](#configmapobject) | -| services | array of [serviceObject](#serviceobject) | no | [serviceObject](#serviceobject) | -| ingresses | array of [ingressObject](#ingressobject) | no | [ingressObject](#ingressobject) | -| routes | array of [routeObject](#routeobject) | no | [routeObject](#routeobject) | -| secrets | array of [secretObject](#secretobject) | no | [secretObject](#secretobject) | -| imageStreams | array of [imageStreamObject](#imagestreamobject) | no | [imageStreamObject](#imagestreamobject) | -| buildConfigs | array of [buildConfigObject](#buildconfigobject) | no | [buildConfigObject](#buildconfigobject) | -| includeResources | array of [includeResourceObject](#includeresourceobject) | no | [includeResourceObject](#includeresourceobject) | - +#### Kedge Root Keys + +Root keys are definable in the innermost section of a YAML file. + +| Field | Type | Required | Description | +|-------------------|------------------------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| name | string | yes | The name of the app or microservice this particular file defines. | +| appversion | string | no | The version of the app or microservice this particular file defines. | +| labels | object | no | Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. | +| deployments | array of [deploymentObject](#deploymentobject) | no | [deploymentObject](#deploymentobject) | +| jobs | array of [jobObject](#jobobject) | no | [jobObject](#jobobject) | +| volumeClaims | array of [persistentVolumeObject](#persistentvolumeobject) | no | [persistentVolumeObject](#persistentvolumeobject) | +| configMap | array of [configMapObject](#configmapobject) | no | [configMapObject](#configmapobject) | +| services | array of [serviceObject](#serviceobject) | no | [serviceObject](#serviceobject) | +| ingresses | array of [ingressObject](#ingressobject) | no | [ingressObject](#ingressobject) | +| secrets | array of [secretObject](#secretobject) | no | [secretObject](#secretobject) | +| deploymentConfigs | array of [deploymentconfigobject](#deploymentconfigobject) | no | [deploymentconfigobject](#deploymentconfigobject) | +| routes | array of [routeObject](#routeobject) | no | [routeObject](#routeobject) | +| imageStreams | array of [imageStreamObject](#imagestreamobject) | no | [imageStreamObject](#imagestreamobject) | +| buildConfigs | array of [buildConfigObject](#buildconfigobject) | no | [buildConfigObject](#buildconfigobject) | +| includeResources | array of [includeResourceObject](#includeresourceobject) | no | [includeResourceObject](#includeresourceobject) | ## name @@ -142,9 +152,9 @@ Depending on the controller key selected. Each "app" (Kedge file) is an extensio name: mariadb ``` -| Type | Required | Description | -|----------|--------------|--------------| -| string | yes | The name of the app or microservice this particular file defines. | +| Type | Required | Description | +|--------|----------|-------------------------------------------------------------------| +| string | yes | The name of the app or microservice this particular file defines. | ## appversion @@ -153,102 +163,60 @@ name: mariadb appversion: 5.0.0-alpha ``` -| Type | Required | Description | -|----------|--------------|--------------| -| string | no | The version of the app or microservice this particular file defines. | +| Type | Required | Description | +|--------|----------|----------------------------------------------------------------------| +| string | no | The version of the app or microservice this particular file defines. | -## controller +## labels ```yaml -controller: deployment +labels: + env: dev + department: middle-tier ``` -> Example using DeploymentConfig for OpenShift - -```yaml -controller: deploymentconfig -name: httpd +| Type | Required | Description | +|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| object | no | Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. | -containers: -- image: bitnami/nginx -services: -- name: httpd - type: NodePort - ports: - - port: 8080 - targetPort: 8080 +All the configuration created will have this label applied. +More info [kubernetes.io/docs/user-guide/labels](http://kubernetes.io/docs/user-guide/labels) -# DeploymentConfig related definitions -replicas: 2 -``` -> Example using Job +## deployments ```yaml -controller: job -name: pival -containers: -- image: perl - command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] - -# Job-related definitions -restartPolicy: Never -parallelism: 3 +deployments: +- ``` -| Type | Required | Description | -|----------|--------------|-------------| -| string | no | The Kubernetes controller of the app or microservice this particular file defines (default: "deployment") | - -Supported controllers: - -| Name | Container Orchestrator | Extension | -|----------------------|------------------------|------------------------------------------------------------------------------------------------------------------------------------| -| Deployment (default) | Kubernetes | An extension of [DeploymentSpec](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#deployment-v1beta1-apps) | -| Job | Kubernetes | An extension of [JobSpec](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#job-v1-batch) | -| DeploymentConfig | OpenShift | An extension of [DeploymentConfigSpec](https://docs.openshift.org/latest/rest_api/apis-apps/v1beta1.Deployment.html#object-schema) | - - -__Note on conflicting fields:__ +| Type | Required | Description | +|------------------------------------------------------------|----------|---------------------------------------------------| +| array of [deploymentObject](#deploymentobject) | no | [deploymentObject](#deploymentobject) | -A conflicting field may exist both within the "root" of the file as well as within the specification. - -For example, `activeDeadlineSeconds` is a conflicting field which exists in both, PodSpec and as well as JobSpec, and both of these fields may be defined at the top level of the Kedge file specification - -So, whenever `activeDeadlineSeconds` field is set, only JobSpec is populated, which means that `activeDeadlineSeconds` is set only for the Job and not for the Pod. - -To populate a Pod's `activeDeadlineSeconds`, the user will have to pass this field the long way by defining the pod exclusively under `job.spec.template.spec.activeDeadlineSeconds`. - - -## labels +## jobs ```yaml -labels: - env: dev - department: middle-tier +jobs: +- ``` -| Type | Required | Description | -|----------|--------------|-----| -| object | no | Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. | - +| Type | Required | Description | +|----------------------------------|----------|-------------------------| +| array of [jobObject](#jobobject) | no | [jobObject](#jobobject) | -All the configuration created will have this label applied. -More info: [http://kubernetes.io/docs/user-guide/labels](http://kubernetes.io/docs/user-guide/labels) - -## containers +## deploymentConfigs ```yaml -containers: -- +deploymentConfigs: +- ``` -| Type | Required | Description | -|------------------------------------------|--------------|-------| -| array of [containerObject](#containerobject) | yes | [containerObject](#containerobject) | - +| Type | Required | Description | +|------------------------------------------------------------|----------|---------------------------------------------------| +| array of [deploymentConfigObject](#deploymentconfigobject) | no | [deploymentConfigObject](#deploymentconfigobject) | ## volumeClaims @@ -257,9 +225,9 @@ volumeClaims: - ``` -| Type | Required | Description | -|------------------------------------------------|--------------|---| -| array of [persistentVolumeObject](#persistentvolumeobject) | no | [persistentVolumeObject](#persistentvolumeobject)| +| Type | Required | Description | +|------------------------------------------------------------|----------|---------------------------------------------------| +| array of [persistentVolumeObject](#persistentvolumeobject) | no | [persistentVolumeObject](#persistentvolumeobject) | ## configMaps @@ -269,9 +237,9 @@ configMaps: - ``` -| Type | Required | Description | -|----------------------------------|--------------|----| -| array of [configMapObject](#configmapobject) | no | [configMapObject](#configmapobject) | +| Type | Required | Description | +|----------------------------------------------|----------|-------------------------------------| +| array of [configMapObject](#configmapobject) | no | [configMapObject](#configmapobject) | ## services @@ -281,9 +249,9 @@ services: - ``` -| Type | Required | Description | -|------------------------------|--------------|------| -| array of [serviceObject](#serviceobject) | no | [serviceObject](#serviceobject) | +| Type | Required | Description | +|------------------------------------------|----------|---------------------------------| +| array of [serviceObject](#serviceobject) | no | [serviceObject](#serviceobject) | ## ingresses @@ -293,9 +261,9 @@ ingresses: - ``` -| Type | Required | Description | -|-------------------------------------------|--------------|------| -| array of [ingressObject](#ingressobject) | no | [ingressObject](#ingressobject) | +| Type | Required | Description | +|------------------------------------------|----------|---------------------------------| +| array of [ingressObject](#ingressobject) | no | [ingressObject](#ingressobject) | @@ -306,9 +274,9 @@ routes: - ``` -| Type | Required | Description | -|-------------------------------------------|--------------|------| -| array of [routeObject](#routeobject) | no | [routeObject](#routeobject) | +| Type | Required | Description | +|--------------------------------------|----------|-----------------------------| +| array of [routeObject](#routeobject) | no | [routeObject](#routeobject) | @@ -319,9 +287,9 @@ secrets: - ``` -| Type | Required | Description | -|----------------------------------|--------------|------| -| array of [secretObject](#secretobject) | no | [secretObject](#secretobject) | +| Type | Required | Description | +|----------------------------------------|----------|-------------------------------| +| array of [secretObject](#secretobject) | no | [secretObject](#secretobject) | ## buildConfigs @@ -330,9 +298,9 @@ buildConfigs: - ``` -| Type | Required | Description | -|----------------------------------|--------------|------| -| array of [buildConfig Object](#buildconfigobject) | no | [buildConfig Object](#buildconfigobject) object | +| Type | Required | Description | +|---------------------------------------------------|----------|-------------------------------------------------| +| array of [buildConfig Object](#buildconfigobject) | no | [buildConfig Object](#buildconfigobject) object | ## imageStreams @@ -341,9 +309,9 @@ imageStreams: - ``` -| Type | Required | Description | -|----------------------------------|--------------|------| -| array of [imageStream Object](#imagestreamobject) | no | [imageStream Object](#imagestreamobject) object | +| Type | Required | Description | +|---------------------------------------------------|----------|-------------------------------------------------| +| array of [imageStream Object](#imagestreamobject) | no | [imageStream Object](#imagestreamobject) object | ## includeResources @@ -362,9 +330,9 @@ includeResources: This is list of files that are Kubernetes specific that can be passed to Kubernetes directly. Of these files, Kedge will not do any processing, but simply pass it to the container orchestrator. -| Type | Required | Description | -|----------------------------------|--------------|------| -| array of [includeResourceObject](#includeresourceobject) | no | [includeResourceObject](#includeresourceobject) | +| Type | Required | Description | +|----------------------------------------------------------|----------|-------------------------------------------------| +| array of [includeResourceObject](#includeresourceobject) | no | [includeResourceObject](#includeresourceobject) | The file path are relative to the kedge application file. @@ -374,39 +342,123 @@ anything in the Kubernetes land. # Objects +Some objects are extension(s) of their Kubernetes / OpenShift counterparts. Below is a chart that lists each extension: + +| Key | Field | Extension of | +|---------------------|------------------------|---------------------------------------------------------------------------------------------------------------------------------| +| `deployments` | deploymentObject | [Kubernetes Deployment](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#deployment-v1beta1-apps) | +| `jobs` | jobObject | [Kubernetes Job](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#job-v1-batch) | +| `containers` | containerObject | [Kubernetes Container](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#container-v1-core) | +| `volumeClaims` | persistentVolumeObject | [Kubernetes PersistentVolumeClaim](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#persistentvolumeclaim-v1-core) | +| `services` | serviceObject | [Kubernetes Service](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#service-v1-core) | +| `ingresses` | ingressObject | [Kubernetes Ingress](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#ingressspec-v1beta1-extensions) | +| `secrets` | secretObject | [Kubernetes EnvVarSource](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#envvarsource-v1-core) | +| `deploymentConfigs` | deploymentConfigObject | [OpenShift DeploymentConfig](https://docs.openshift.org/latest/rest_api/apis-apps/v1beta1.Deployment.html#object-schema) | +| `routes` | routeObject | [OpenShift Route](https://docs.openshift.com/container-platform/3.7/rest_api/apis-route.openshift.io/v1.Route.html) | +| `buildConfigs` | buildConfigObject | [OpenShift BuildConfig](https://docs.openshift.com/container-platform/3.7/rest_api/apis-build.openshift.io/v1.BuildConfig.html) | +| `imageStreams` | imageStreamObject | [OpenShift ImageStream](https://docs.openshift.com/container-platform/3.7/rest_api/apis-image.openshift.io/v1.ImageStream.html) | +| `includeResourcs` | includeResourceObject | N/A | + + +## deploymentObject + +> Example using the Kubernetes Deployment controller + +```yaml +name: httpd + +deployments: +- containers: + - image: centos/httpd + +services: +- name: httpd + type: LoadBalancer + portMappings: + - 8080:80 +``` + + + + +| Field | Type | Required | Description | +|------------|----------------------------------------------|----------|-------------------------------------| +| containers | array of [containerObject](#containerobject) | yes | [containerObject](#containerobject) | + + +## jobObject + +> Example using the Kubernetes Jobs controller + +```yaml +name: pival + +jobs: +- containers: + - image: perl + command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] + # Job-related definitions + restartPolicy: Never + parallelism: 3 +``` + + + + +| Field | Type | Required | Description | +|------------|----------------------------------------------|----------|-------------------------------------| +| containers | array of [containerObject](#containerobject) | yes | [containerObject](#containerobject) | + + ## containerObject +> Using the deployments controller + ```yaml -containers: +deployments: +- containers: - ``` +> Using the deploymentConfigs controller with name. + +```yaml +deploymentConfigs: +- name: foo + containers: + - +``` + +The `containers` key is used with **every** type of controller (deployments, jobs, deploymentConfigs). + List of containers -| Field | Type | Required | Description | -|-------|----------|--------------|--------------| -| health | string | yes | The name of the app or microservice this particular file defines. | +| Field | Type | Required | Description | +|--------|--------|----------|-------------------------------------------------------------------| +| health | string | yes | The name of the app or microservice this particular file defines. | ### health ```yaml containers: - - image: foobar - health: +- image: foobar + health: ``` -| Type | Required | Description | -|----------|--------------|--------------| -| string | yes | The name of the app or microservice this particular file defines. | +| Type | Required | Description | +|--------|----------|-------------------------------------------------------------------| +| string | yes | The name of the app or microservice this particular file defines. | -This is `probe` spec. Rather than defining `livenessProbe` and `readinessProbe`, -define only `health`. And then it gets copied in both in the resultant spec. -But if `health` and `livenessProbe` or `readinessProbe` are defined -simultaneously then the tool will error out. +This is `probe` spec. Rather than defining `livenessProbe` and `readinessProbe`, define only `health`. And then it gets copied in both in the resultant spec. +But if `health` and `livenessProbe` or `readinessProbe` are defined simultaneously then the tool will error out. ### Kubernetes extension @@ -414,17 +466,19 @@ simultaneously then the tool will error out. ```yaml name: web -containers: -- image: nginx - # https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#container-v1-core - env: - - name: WORDPRESS_DB_PASSWORD - value: wordpress - - name: WORDPRESS_DB_USER - value: wordpress - envFrom: - - configMapRef: - name: web +deployments: +- containers: + - name: nginx + image: nginx + # https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#container-v1-core + env: + - name: WORDPRESS_DB_PASSWORD + value: wordpress + - name: WORDPRESS_DB_USER + value: wordpress + envFrom: + - configMapRef: + name: web services: - name: nginx type: NodePort @@ -441,40 +495,40 @@ For example, keys such as `env` and `envFrom` are commonly used. ```yaml volumeClaims: - - +- ``` > An example of deploying a volume ```yaml volumeClaims: - - name: database - size: 500Mi +- name: database + size: 500Mi ``` > Or further specifically defining it ```yaml volumeClaims: - - name: database - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 500Mi +- name: database + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 500Mi ``` -| Field | Type | Required | Description | -|-------|----------|--------------|--------------| -| name | string | yes | The name of the volume. This should match with the `volumeMount` defined in the `container`. | -| size | string | yes | Size of persistent volume claim to be created. Conflicts with [resources](#resources) field so define either of those. | -| resources | ResourceRequirements | yes | Resources represents the minimum resources the volume should have. Conflicts with [size](#size) field so define either of those. | -| accessModes | array of string | no | AccessModes contains the desired access modes the volume should have. Defaults to `ReadWriteOnce`. | +| Field | Type | Required | Description | +|-------------|----------------------|----------|----------------------------------------------------------------------------------------------------------------------------------| +| name | string | yes | The name of the volume. This should match with the `volumeMount` defined in the `container`. | +| size | string | yes | Size of persistent volume claim to be created. Conflicts with [resources](#resources) field so define either of those. | +| resources | ResourceRequirements | yes | Resources represents the minimum resources the volume should have. Conflicts with [size](#size) field so define either of those. | +| accessModes | array of string | no | AccessModes contains the desired access modes the volume should have. Defaults to `ReadWriteOnce`. | A user needs to define this list of volumes and then use it in the `volumeMounts` field in `containers`. In the resultant output the `volumes` in `podSpec` will be populated automatically by the tool. @@ -484,9 +538,9 @@ A user needs to define this list of volumes and then use it in the `volumeMounts name: database ``` -| Type | Required | Description | -|----------|--------------|-----| -| string | yes | The name of the volume. This should match with the `volumeMount` defined in the `container`. | +| Type | Required | Description | +|--------|----------|----------------------------------------------------------------------------------------------| +| string | yes | The name of the volume. This should match with the `volumeMount` defined in the `container`. | ### size @@ -495,9 +549,9 @@ name: database size: 700Mi ``` -| Type | Required | Description | -|----------|--------------|-----| -| string | yes | Size of persistent volume claim to be created. Conflicts with [resources](#resources) field so define either of those. | +| Type | Required | Description | +|--------|----------|------------------------------------------------------------------------------------------------------------------------| +| string | yes | Size of persistent volume claim to be created. Conflicts with [resources](#resources) field so define either of those. | ### resources @@ -507,9 +561,9 @@ resources: storage: 500Mi ``` -| Type | Required | Description | -|------------------------|--------------|-----| -| ResourceRequirements | yes | Resources represents the minimum resources the volume should have. Conflicts with [size](#size) field so define either of those. | +| Type | Required | Description | +|----------------------|----------|----------------------------------------------------------------------------------------------------------------------------------| +| ResourceRequirements | yes | Resources represents the minimum resources the volume should have. Conflicts with [size](#size) field so define either of those. | More info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources @@ -520,9 +574,9 @@ accessModes: - ReadWriteOnce ``` -| Type | Required | Description -|-----------------|--------------|------| -| array of string | no | AccessModes contains the desired access modes the volume should have. Defaults to `ReadWriteOnce`. | +| Type | Required | Description +|-----------------|----------|----------------------------------------------------------------------------------------------------| +| array of string | no | AccessModes contains the desired access modes the volume should have. Defaults to `ReadWriteOnce`. | The access modes are: @@ -573,7 +627,7 @@ Anything [PersistentVolumeClaim Spec](https://v1-6.docs.kubernetes.io/docs/api-r ```yaml configMaps: - - +- ``` > Example @@ -590,10 +644,10 @@ configMaps: Each "configMapObject" is a Kubernetes ConfigMap Spec with additional Kedge-specific keys. -| Field | Type | Required | Description | -|-------|----------|--------------|--------------| -| name | string | yes | The name of the configMapObject. This is optional field if only one configMapObject is defined, the default name will be the app name. | -| data | object | yes | Data contains the configuration data. Each key must be a valid DNS_SUBDOMAIN with an optional leading dot. | +| Field | Type | Required | Description | +|-------|--------|----------|----------------------------------------------------------------------------------------------------------------------------------------| +| name | string | yes | The name of the configMapObject. This is optional field if only one configMapObject is defined, the default name will be the app name. | +| data | object | yes | Data contains the configuration data. Each key must be a valid DNS_SUBDOMAIN with an optional leading dot. | ### Name @@ -601,9 +655,9 @@ Each "configMapObject" is a Kubernetes Service Spec with additional Kedge-specific keys. -| Field | Type | Required | Description | -|-------|----------|--------------|--------------| -| name | string | yes | The name of the service. | -| endpoint | string | no | The endpoint of the service. | -| portMappings | array of "port" | no | Array of ports. Ex. `80:8080/tcp` | +| Field | Type | Required | Description | +|--------------|-----------------|----------|-----------------------------------| +| name | string | yes | The name of the service. | +| endpoint | string | no | The endpoint of the service. | +| portMappings | array of "port" | no | Array of ports. Ex. `80:8080/tcp` | -More info: [https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#servicespec-v1-core](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#servicespec-v1-core) +More info: [v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#servicespec-v1-core](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#servicespec-v1-core) Each service gets converted into a Kubernetes `service` and `ingress` respectively. @@ -689,9 +743,9 @@ Each service gets converted into a Kubernetes `service` and `ingress` respective name: wordpress ``` -| Type | Required | Description | -|----------|--------------|------| -| string | yes | The name of the service. | +| Type | Required | Description | +|--------|----------|--------------------------| +| string | yes | The name of the service. | ### endpoint @@ -699,9 +753,9 @@ name: wordpress endpoint: www.mycoolapp.com/admin ``` -| Type | Required | Description | -|----------|--------------|------| -| string | yes | The endpoint of the service. | +| Type | Required | Description | +|--------|----------|------------------------------| +| string | yes | The endpoint of the service. | This is an added field in the Service port, which if specified an `ingress` resource is created. The `ingress` resource name will be the same as the name @@ -717,9 +771,9 @@ portMappings: - 8081:81/UDP ``` -| Type | Required | Description | -|----------|--------------|------| -| array of "port" | yes | Array of ports. Ex. `80:8080/tcp` | +| Type | Required | Description | +|-----------------|----------|-----------------------------------| +| array of "port" | yes | Array of ports. Ex. `80:8080/tcp` | `portMappings` is an added field to ServiceSpec. @@ -776,9 +830,9 @@ Each "ingress" is a Kubernetes +Each "secret" is a Kubernetes EnvVarSource Spec with additional Kedge-specific keys. + + +### Name + +```yaml +name: wordpress +``` + +| Type | Required | Description | +|--------|----------|------------------------| +| string | no | The name of the secret | + +### Kubernetes extension + +> Example extending `service` with Kubernetes Service Spec + +```yaml +secrets: +- name: wordpress + data: + # https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#envvarsource-v1-core + # Encoded in base64 + MYSQL_ROOT_PASSWORD: YWRtaW4= + MYSQL_PASSWORD: cGFzc3dvcmQ= +``` + +Anything [EnvVarSource Spec](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#envvarsource-v1-core) from Kubernetes can be included within the Kedge file. + +## deploymentConfigObject + +> Example using the OpenShift DeploymentConfig controller + +```yaml +name: httpd + +deploymentConfigs: +- containers: + - image: bitnami/nginx + # DeploymentConfig related definitions + replicas: 2 + +services: +- name: httpd + type: NodePort + ports: + - port: 8080 + targetPort: 8080 +``` + + + + +| Field | Type | Required | Description | +|------------|----------------------------------------------|----------|-------------------------------------| +| containers | array of [containerObject](#containerobject) | yes | [containerObject](#containerobject) | + ## routeObject ```yaml @@ -833,9 +954,9 @@ to: Each "route" is an OpenShift Route Spec with additional Kedge-specific keys. -| Type | Required | Description | -|----------------------------------|--------------|------| -| name | string | yes | The name of the Route | +| Type | Required | Description | +|------|----------|-----------------------| +| name | yes | The name of the Route | ### name @@ -843,9 +964,9 @@ Each "route" is an OpenShift -Each "secret" is a Kubernetes EnvVarSource Spec with additional Kedge-specific keys. - - -### Name - -```yaml -name: wordpress -``` - -| Type | Required | Description | -|----------|--------------|-----| -| string | no | The name of the secret | - -### Kubernetes extension - -> Example extending `service` with Kubernetes Service Spec - -```yaml -secrets: -- name: wordpress - data: - # https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#envvarsource-v1-core - # Encoded in base64 - MYSQL_ROOT_PASSWORD: YWRtaW4= - MYSQL_PASSWORD: cGFzc3dvcmQ= -``` - -Anything [EnvVarSource Spec](https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#envvarsource-v1-core) from Kubernetes can be included within the Kedge file. - ## buildConfigObject ```yaml @@ -933,9 +1017,9 @@ Each "buildConfigObject" is an OpenShift