
> Kyma application template (experimental)

Sample Kyma project that demonstrate a cloud native app bounded to in memory db service instance, 
Redis from the service catalog.

## Installation

```bash
npm install -g yo
npm install -g generator-kyma
```

Then generate your new project:

```bash
yo kyma
```
## Pre-requisite 

1. Configure your dev-space/local environment against K8S Kyma cluster as it required by the generator steps.
    - `mkdir ~/.kube/config`. 
    - `vim config` - put your kyma cluster `kubeconfig` file.
    - check you are able to access to kyma cluster via `kubectl config get-contexts`
2. Using the generated `Makefile` target 'push' require `log-in` to `docker-registry`, use `img login`.
3. Use target `deploy` to `build` `push` and `update` the deployment file with the new docker image, in addition the resources applied to K8S.
     
## The generated project contain the following files:

- `k8s` folder - k8s resources
  - `app` folder  - Application code
  - `api.yaml` - API Exposure
  - `servicebindings.yaml` - Service binding and usage crd
  - `deployment.yaml` - Main deployment
  - `Dockerfile` - Application docker image
 - `Makefile` - Contain the following targets:
   - `build` - Build docker image
   - `push` - Push Docker image
   - `update-deployment` - After the docker image has pushed to the registry use this target to 
      update the deployment image 
   - `deploy` - Run build, push and update-deployment targets
 - `Dockerfile` - Suitable docker file according to the project generation technologies (node/golang/python)    
    
       
[npm-image]: https://badge.fury.io/js/generator-kyma.svg
[npm-url]: https://npmjs.org/package/generator-kyma

