# JHipster-generated Kubernetes Knative configuration

## Preparation

* Knative depends on Istio. In order to use the manifests generated by k8s-knative generator, you should have Istio and Knative installed
in the cluster. Follow [this link](https://knative.dev/docs/install/) for instructions.

* You will need to push your image(s) to a registry. If you have not done so, use the following commands to tag and push the images:

```
<%_ for (let i = 0; i < appsFolders.length; i++) { _%>
  <%_ if (appConfigs[i].baseName.toLowerCase() !== appConfigs[i].targetImageName) { _%>
    $ docker image tag <%= appConfigs[i].baseName.toLowerCase() %> <%= appConfigs[i].targetImageName %>
  <%_ } _%>
$ <%= dockerPushCommand %> <%= appConfigs[i].targetImageName %>
<%_ } _%>
```
* This generator uses k8s generator for most of the part, except the core microservices apps that are (k)native.

## Deployment

You can deploy all your apps by running the below terminal command:
<%_ if (generatorTypeK8s) { _%>
```
bash kubectl-knative-apply.sh (or) ./kubectl-knative-apply.sh
```
<%_ } _%>
<%_ if (generatorTypeHelm) { _%>
```
bash helm-knative-apply.sh (or) ./helm-knative-apply.sh
```

`helm-apply.sh` will always do a clean install. Any of the existing charts with the same identity gets removed first and then it does a clean install.

You can upgrade all your apps (if you have made any changes to the generated manifests) by running the following bash command:

```
bash helm-knative-upgrade.sh (or) ./helm-knative-upgrade.sh
```
<%_ } _%>

For Kubernetes specific more information, refer to the `kubernetes` sub-generator Readme instructions.
