From f7fe00e9100f394ea31aa47392e97589e790e88d Mon Sep 17 00:00:00 2001 From: Sandy Koh Date: Wed, 8 Apr 2020 11:55:53 +0100 Subject: [PATCH 1/7] docs: restructure deploy doc --- content/docs/faq.md | 8 ++- content/docs/using-appsody/deploying.md | 72 +++++++++++-------------- 2 files changed, 38 insertions(+), 42 deletions(-) diff --git a/content/docs/faq.md b/content/docs/faq.md index 5a2575d21..be7a394a6 100644 --- a/content/docs/faq.md +++ b/content/docs/faq.md @@ -159,4 +159,10 @@ The `project.yaml` file is validated when a new Appsody project is initialized. * moved to a different directory * are being initialized into the same directory as a previous project -Their entry is removed from the `project.yaml` file and the associated volumes are deleted. This validation ensures that volumes exist for current projects only and that volumes are not reused between different projects of the same name. \ No newline at end of file +Their entry is removed from the `project.yaml` file and the associated volumes are deleted. This validation ensures that volumes exist for current projects only and that volumes are not reused between different projects of the same name. + +## 12. How do I deploy my application to a local Minikube cluster? + +Currently, Appsody only supports using a local Docker daemon. If you use the Minikube docker daemon, issuing `eval $(minikube docker-env)` , [appsody extract](docs/cli-commands/#appsody-extract) and [appsody build](docs/cli-commands/#appsody-build) commands will not work as expected. + +To workaround this issue, use your local Docker daemon. You can do this by unsetting the `DOCKER_HOST`, `DOCKER_CERT_PATH` and `DOCKER_TLS_VERIFY` environment variables. Then use [appsody deploy --push](docs/cli-commands/#appsody-deploy) to push your image to an external Docker registry, and configure Minikube to pull from this registry. \ No newline at end of file diff --git a/content/docs/using-appsody/deploying.md b/content/docs/using-appsody/deploying.md index 02269dec9..74d4540d1 100644 --- a/content/docs/using-appsody/deploying.md +++ b/content/docs/using-appsody/deploying.md @@ -9,24 +9,42 @@ The Appsody CLI provides the [appsody deploy](/docs/cli-commands/#appsody-deploy You can delegate the build and deployment steps to an external pipeline, such as a Tekton pipeline that consumes the source code of your Appsody project after you push it to a GitHub repository. Within the pipeline, you can run [appsody build](/docs/using-appsody/building), which builds the application image and generates a deployment manifest. You can use the manifest to deploy your application to a Kubernetes environment where the Appsody operator is installed. +> Currently we only support a local Docker daemon. To workaround this, see the [FAQ](/docs/faq/#12-how-do-i-deploy-my-application-to-a-local-minikube-cluster). + These deployment options are covered in more detail in the following sections. -## Deploying your app directly to a Kubernetes cluster +## Deploying your application to a Kubernetes cluster There are many options to deploy your Appsody applications to a Kubernetes cluster. The best approach depends on the specific scenario: -- If you are testing your app on a locally installed cluster, using `appsody deploy` is your best bet -- If you intend to have your app deployed on a shared cluster for integration testing or production, you are probably going to rely on CI/CD pipelines, and have the app built and deployed from its source. +- If you intend to have your application deployed on a shared cluster for integration testing or production, you are probably going to rely on CI/CD pipelines, and have the application built and deployed from its source. +- If you are testing your application on a locally installed cluster, you would want to use [appsody deploy](/docs/cli-commands/#appsody-deploy). -The `appsody deploy` command provides a way for you to deploy your application directly to a Kubernetes cluster. The stack contains a deployment manifest that can be consumed by the [Appsody operator](https://operatorhub.io/operator/appsody-operator). `appsody deploy` will install the operator, if necessary, and deploy your application to the cluster using that deployment manifest. +If you have installed a Kubernetes cluster on your development workstation and want to use your local Docker image cache instead of pushing the image to Docker Hub, make sure you set up your Kubernetes cluster to consume images from the local Docker cache. -If you want to deploy your application without rebuilding the application image, or modifying the deployment manifest, you can run +To deploy your Appsody project locally, run: ``` -appsody deploy --no-build +appsody deploy ``` +This command completes the following actions: + +- Calls `appsody build` and creates a *deployment* Docker image and a deployment manifest file named `app-deploy.yaml`. +- If you specified the `--knative` flag, or if Knative is the only deployment option for your stack, the command tags the image with the prefix `dev.local`, making it accessible to your Kubernetes cluster (assuming you followed [these directions](/docs/using-appsody/installing-knative-locally)). +- The deployment manifest issues a `kubectl apply -f` command against the target Kubernetes cluster so that the application can be deployed by the [Appsody operator](https://operatorhub.io/operator/appsody-operator). + +> To deploy your application without rebuilding the application image, or modifying the deployment manifest, run `appsody deploy --no-build`. + +### Ensuring the latest application code changes get deployed +Some users have noticed that their code changes do not seem to be published to the target Kubernetes cluster after an initial deployment of the Appsody project through `appsody deploy`. + +If you issue `appsody deploy` without explicitly tagging the image, you end up with an identical deployment manifest (`app-deploy.yaml` file) to the one that was initially used to deploy the application. Therefore, Kubernetes will detect no differences in the deployment manifest, and will not update your application. + +To ensure the latest version of your application is pushed to the cluster, use the `-t` flag to add a unique tag every time you redeploy your application. Kubernetes then detects a change in the deployment manifest, and pushes your application to the cluster again. For example: `appsody deploy -t dev.local/my-image:0.x`, where x is a number that you increment every time you redeploy. + +> If you are running multiple Appsody projects on your workstation, you can use the `appsody deploy` and `appsody operator` commands to get them deployed to a Kubernetes cluster. However, do not run these commands concurrently as they create temporary files that may lead to conflicts. ### Deployment via the Appsody Operator Kubernetes operators offer a powerful way to provide full lifecycle maintenance of a wide range of resources on Kubernetes clusters. In particular, they can install, upgrade, remove, and monitor application deployments. The recently published [Appsody operator](https://operatorhub.io/operator/appsody-operator) automates the installation and maintenance of a special type of Custom Resource Definitions (CRDs), called **AppsodyApplication**. -The Appsody stacks that are currently available include a template of such a CRD manifest. When you run `appsody deploy` on a project created from one of the stacks enabled with those manifests, the CLI customizes the manifest with information that is specific to the deployment (such as namespace and project name), and submits the manifest to the Appsody operator on the Kubernetes cluster. +The currently available Appsody stacks include a template of such a CRD manifest. When you run `appsody deploy` on a project created from one of the stacks enabled with those manifests, the CLI customizes the manifest with information that is specific to the deployment (e.g. namespace and project name), and submits the manifest to the Appsody operator on the Kubernetes cluster. In fact, if your cluster does not already provide an operator, `appsody deploy` will install one for you. You can also use the Appsody CLI to install an instance of the Appsody operator, without installing any applications. This can be achieved by running the `appsody operator install` command. @@ -34,9 +52,9 @@ To find out more about the Appsody operator, see [here](/docs/reference/appsody- ### Deployment as a Knative Service -You can deploy your application as a Knative service on your target Kubernetes cluster by using the `--knative` flag with the `appsody build` or `appsody deploy` commands. This action sets the flag `createKnativeService` in the deployment manifest to `true`. +You can deploy your application as a Knative service on your target Kubernetes cluster by using the `--knative` flag. This flag is available to the `appsody build` or `appsody deploy` commands. This action sets the `createKnativeService` value in the deployment manifest to `true`. -For your app to work as a Knative service, the following **pre-requisites** apply: +To deploy your application as a Knative service, the following **pre-requisites** apply: - You must have access to a Kubernetes cluster, with Knative Serving installed and running. To install Knative locally, use the Kubernetes feature in Docker for Desktop, see [Installing Knative Locally](/docs/faq#10-how-do-i-set-up-knative-serving-for-local-kubernetes-development). To install Knative on other Kubernetes clusters, see the [Knative Install Documentation](https://knative.dev/docs/install/). - You must configure your `kubectl` CLI to point to your Kubernetes cluster. @@ -44,20 +62,6 @@ For your app to work as a Knative service, the following **pre-requisites** appl Once the `appsody deploy --knative` command completes successfully, the Knative Service is operable at the URL specified in the command output. -### Deploying your application to a local Kubernetes cluster - -If you have installed a Kubernetes cluster on your development workstation and want to use your local Docker image cache instead of pushing the image to Docker Hub, make sure you set up your Kubernetes cluster to consume images from the local Docker cache. - -To deploy your Appsody project locally, run: -``` -appsody deploy -``` -This command completes the following actions: - -- Calls `appsody build` and creates a *deployment* Docker image and a manifest file named `app-deploy.yaml`, as described in the previous section. -- If you specified the `--knative` flag, or if Knative is the only deployment option for your stack, the command tags the image with the special prefix `dev.local`, making it accessible to your Kubernetes cluster (assuming you followed [these directions](/docs/using-appsody/installing-knative-locally)) -- The deployment manifest, `app-deploy.yaml`, is used to issue a `kubectl apply -f` command against the target Kubernetes cluster so that the application can be deployed by the Appsody Operator. - ### Deploying your application through Docker Hub If your cluster is configured to pull images from Docker Hub, use the following command to deploy your application: @@ -87,26 +91,12 @@ appsody deploy -t --push-url Note: The pull registry url gets injected into the deployment manifest for Kubernetes to pull the correct image. -### Deploying multiple projects -If you are running multiple Appsody projects on your workstation, you can use `appsody deploy` and `appsody operator` commands to get them deployed to a Kubernetes cluster. However, make sure that you run these commands one at a time, because those commands create temporary files that might lead to conflicts if created concurrently. - -### Ensuring the latest application code changes get deployed -Some users have noticed that their code changes do not seem to be published to the target Kubernetes cluster after an initial deployment of the Appsody project through `appsody deploy`. -The sequence of actions that leads to this behavior is as follows: -1. You create an initial version of your app, and then use `appsody deploy` to publish it to your test Kubernetes cluster. -1. You test your app, and make code changes. The code changes appear as you re-test your app using `appsody run`. -1. You decide to re-publish your app to your target cluster, and run `appsody deploy` again. -1. The command succeeds, yet nothing seems to change on the Kubernetes cluster: you still observe the older version of your app. - -This behavior can be explained by the fact that - if you simply issue `appsody deploy` without explicitly tagging the image - you end up with a deployment manifest (the `app-deploy.yaml` file) that is identical to the one that was used to deploy the application the first time. Therefore, Kubernetes will detect no differences in the deployment yaml, and will do nothing to update your app. - -To ensure that the latest version of your app is pushed to the cluster, use the -t flag to add a unique tag every time you redeploy your app. Kubernetes then detects a change in the deployment manifest, and pushes your app to the cluster again. For example: appsody deploy -t dev.local/my-image:0.x, where x is a number that you increment every time you redeploy. -## Deploying your app through a Tekton pipeline +## Deploying your application through a Tekton pipeline > This deployment option is under development -Most likely, the deployment of apps created with the Appsody CLI is going to occur through the invocation of a CI/CD build pipeline. +Most likely, the deployment of applications created with the Appsody CLI is going to occur through the invocation of a CI/CD build pipeline. -As a developer, you develop your app using the Appsody CLI, and when you are ready to deploy, you push your code to a repo or create a pull request on GitHub. +As a developer, you develop your application using the Appsody CLI, and when you are ready to deploy, you push your code to a repository or create a pull request on GitHub. -This [example](https://github.com/appsody/tekton-example) shows you how to use Tekton pipelines to deploy your app to a Kubernetes cluster. More details on running the Tekton pipeline example for Appsody can be found in the repo [readme file] (https://github.com/appsody/tekton-example/blob/master/README.md). The example uses a [customized Buildah image with the Appsody CLI installed](https://github.com/appsody/appsody-buildah). For more information on using Appsody with Buildah, see the [FAQ](/docs/faq#9-can-i-use-appsody-without-docker). +This [example](https://github.com/appsody/tekton-example) shows you how to use Tekton pipelines to deploy your application to a Kubernetes cluster. More details on running the Tekton pipeline example for Appsody can be found in the repository [README](https://github.com/appsody/tekton-example/blob/master/README.md). The example uses a [customized Buildah image](https://github.com/appsody/appsody-buildah) with the Appsody CLI installed. For more information on using Appsody with Buildah, see the [FAQ](/docs/faq#9-can-i-use-appsody-without-docker). From 61685db2a0a4382181e8a96bfed1d49d2222d175 Mon Sep 17 00:00:00 2001 From: Sandy Koh Date: Wed, 8 Apr 2020 13:06:47 +0100 Subject: [PATCH 2/7] requested rewording --- content/docs/faq.md | 11 ++++++++--- content/docs/using-appsody/deploying.md | 10 +++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/content/docs/faq.md b/content/docs/faq.md index be7a394a6..2a0f4ad1e 100644 --- a/content/docs/faq.md +++ b/content/docs/faq.md @@ -163,6 +163,11 @@ Their entry is removed from the `project.yaml` file and the associated volumes a ## 12. How do I deploy my application to a local Minikube cluster? -Currently, Appsody only supports using a local Docker daemon. If you use the Minikube docker daemon, issuing `eval $(minikube docker-env)` , [appsody extract](docs/cli-commands/#appsody-extract) and [appsody build](docs/cli-commands/#appsody-build) commands will not work as expected. - -To workaround this issue, use your local Docker daemon. You can do this by unsetting the `DOCKER_HOST`, `DOCKER_CERT_PATH` and `DOCKER_TLS_VERIFY` environment variables. Then use [appsody deploy --push](docs/cli-commands/#appsody-deploy) to push your image to an external Docker registry, and configure Minikube to pull from this registry. \ No newline at end of file +Currently, Appsody supports you using a local Docker daemon only. If you use the Minikube Docker daemon, the following commands do not work as expected: + - `eval $(minikube docker-env)` + - [appsody extract](docs/cli-commands/#appsody-extract) + - [appsody build](docs/cli-commands/#appsody-build) + + To work around this issue, you can use your local Docker daemon as follows: + 1. Unset the `DOCKER_HOST`, `DOCKER_CERT_PATH` and `DOCKER_TLS_VERIFY` environment variables. + 2. Use [appsody deploy --push](docs/cli-commands/#appsody-deploy) to push your image to an external Docker registry, and configure Minikube to pull from this registry. \ No newline at end of file diff --git a/content/docs/using-appsody/deploying.md b/content/docs/using-appsody/deploying.md index 74d4540d1..3b3726b0b 100644 --- a/content/docs/using-appsody/deploying.md +++ b/content/docs/using-appsody/deploying.md @@ -9,16 +9,16 @@ The Appsody CLI provides the [appsody deploy](/docs/cli-commands/#appsody-deploy You can delegate the build and deployment steps to an external pipeline, such as a Tekton pipeline that consumes the source code of your Appsody project after you push it to a GitHub repository. Within the pipeline, you can run [appsody build](/docs/using-appsody/building), which builds the application image and generates a deployment manifest. You can use the manifest to deploy your application to a Kubernetes environment where the Appsody operator is installed. -> Currently we only support a local Docker daemon. To workaround this, see the [FAQ](/docs/faq/#12-how-do-i-deploy-my-application-to-a-local-minikube-cluster). +> Currently, Appsody supports you using a local Docker daemon only. To work around this, see the [FAQ](/docs/faq/#12-how-do-i-deploy-my-application-to-a-local-minikube-cluster). These deployment options are covered in more detail in the following sections. ## Deploying your application to a Kubernetes cluster There are many options to deploy your Appsody applications to a Kubernetes cluster. The best approach depends on the specific scenario: -- If you intend to have your application deployed on a shared cluster for integration testing or production, you are probably going to rely on CI/CD pipelines, and have the application built and deployed from its source. +- If you intend to deploy your application on a shared cluster for integration testing or production, you are probably going to rely on CI/CD pipelines. In this case, the application is built and deployed from its source. - If you are testing your application on a locally installed cluster, you would want to use [appsody deploy](/docs/cli-commands/#appsody-deploy). -If you have installed a Kubernetes cluster on your development workstation and want to use your local Docker image cache instead of pushing the image to Docker Hub, make sure you set up your Kubernetes cluster to consume images from the local Docker cache. +If your development workstation has a Kubernetes cluster installed, you can use your local Docker image cache instead of pushing the image to Docker Hub. To do this, you need to configure your Kubernetes cluster to use images from the local Docker [cache](https://kubernetes.io/docs/concepts/containers/images/#pre-pulled-images). To deploy your Appsody project locally, run: ``` @@ -39,7 +39,7 @@ If you issue `appsody deploy` without explicitly tagging the image, you end up w To ensure the latest version of your application is pushed to the cluster, use the `-t` flag to add a unique tag every time you redeploy your application. Kubernetes then detects a change in the deployment manifest, and pushes your application to the cluster again. For example: `appsody deploy -t dev.local/my-image:0.x`, where x is a number that you increment every time you redeploy. -> If you are running multiple Appsody projects on your workstation, you can use the `appsody deploy` and `appsody operator` commands to get them deployed to a Kubernetes cluster. However, do not run these commands concurrently as they create temporary files that may lead to conflicts. +> If you are running multiple Appsody projects on your workstation, you can use the [appsody deploy](/docs/cli-commands/#appsody-deploy) and [appsody operator](/docs/cli-commands/#appsody-operator) commands to deploy them to a Kubernetes cluster. However, do not run these commands concurrently as they create temporary files that might lead to conflicts. ### Deployment via the Appsody Operator Kubernetes operators offer a powerful way to provide full lifecycle maintenance of a wide range of resources on Kubernetes clusters. In particular, they can install, upgrade, remove, and monitor application deployments. The recently published [Appsody operator](https://operatorhub.io/operator/appsody-operator) automates the installation and maintenance of a special type of Custom Resource Definitions (CRDs), called **AppsodyApplication**. @@ -95,7 +95,7 @@ appsody deploy -t --push-url This deployment option is under development -Most likely, the deployment of applications created with the Appsody CLI is going to occur through the invocation of a CI/CD build pipeline. +Most likely, the deployment of applications that are created with the Appsody CLI is going to occur through the invocation of a CI/CD build pipeline. As a developer, you develop your application using the Appsody CLI, and when you are ready to deploy, you push your code to a repository or create a pull request on GitHub. From c30c3998f06d8fd23351941c5f6750918ef457d1 Mon Sep 17 00:00:00 2001 From: Sandy Koh Date: Tue, 14 Apr 2020 13:59:09 +0100 Subject: [PATCH 3/7] requested rewording --- content/docs/faq.md | 10 +++------- content/docs/installing/installing-appsody.md | 6 +++++- content/docs/using-appsody/deploying.md | 2 -- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/content/docs/faq.md b/content/docs/faq.md index 2a0f4ad1e..ecff59726 100644 --- a/content/docs/faq.md +++ b/content/docs/faq.md @@ -161,13 +161,9 @@ The `project.yaml` file is validated when a new Appsody project is initialized. Their entry is removed from the `project.yaml` file and the associated volumes are deleted. This validation ensures that volumes exist for current projects only and that volumes are not reused between different projects of the same name. -## 12. How do I deploy my application to a local Minikube cluster? +## 12. Can I use the Minikube docker daemon for development? -Currently, Appsody supports you using a local Docker daemon only. If you use the Minikube Docker daemon, the following commands do not work as expected: - - `eval $(minikube docker-env)` +Currently, Appsody supports using a local Docker daemon only. If you use the Minikube Docker daemon, the following commands do not work as expected: - [appsody extract](docs/cli-commands/#appsody-extract) - [appsody build](docs/cli-commands/#appsody-build) - - To work around this issue, you can use your local Docker daemon as follows: - 1. Unset the `DOCKER_HOST`, `DOCKER_CERT_PATH` and `DOCKER_TLS_VERIFY` environment variables. - 2. Use [appsody deploy --push](docs/cli-commands/#appsody-deploy) to push your image to an external Docker registry, and configure Minikube to pull from this registry. \ No newline at end of file + - [appsody deploy](docs/cli-commands/#appsody-deploy) \ No newline at end of file diff --git a/content/docs/installing/installing-appsody.md b/content/docs/installing/installing-appsody.md index d4027a218..2c1e3e1e8 100644 --- a/content/docs/installing/installing-appsody.md +++ b/content/docs/installing/installing-appsody.md @@ -17,7 +17,11 @@ Appsody supports the following operating systems on x86 hardware: ## Requirements -To use all of Appsody's functions, you need to install [Docker](https://docs.docker.com/get-started/) and start the Docker daemon on your system. In environments where Docker is not available, a subset of Appsody commands can be used with Buildah as detailed in the [FAQ](/docs/faq#9-can-i-use-appsody-without-docker). Prerequisites specific to each operating system are provided within the links in the following section. +To use all of Appsody's functions, you need to install [Docker](https://docs.docker.com/get-started/) and start the Docker daemon on your system. + +> Currently, Appsody supports using a local Docker daemon only. See the [FAQ](/docs/faq/#12-can-i-use-the-minikube-docker-daemon-for-development). + +In environments where Docker is not available, a subset of Appsody commands can be used with Buildah as detailed in the [FAQ](/docs/faq#9-can-i-use-appsody-without-docker). Prerequisites specific to each operating system are provided within the links in the following section. ## Using installers diff --git a/content/docs/using-appsody/deploying.md b/content/docs/using-appsody/deploying.md index 3b3726b0b..7624b6a0f 100644 --- a/content/docs/using-appsody/deploying.md +++ b/content/docs/using-appsody/deploying.md @@ -9,8 +9,6 @@ The Appsody CLI provides the [appsody deploy](/docs/cli-commands/#appsody-deploy You can delegate the build and deployment steps to an external pipeline, such as a Tekton pipeline that consumes the source code of your Appsody project after you push it to a GitHub repository. Within the pipeline, you can run [appsody build](/docs/using-appsody/building), which builds the application image and generates a deployment manifest. You can use the manifest to deploy your application to a Kubernetes environment where the Appsody operator is installed. -> Currently, Appsody supports you using a local Docker daemon only. To work around this, see the [FAQ](/docs/faq/#12-how-do-i-deploy-my-application-to-a-local-minikube-cluster). - These deployment options are covered in more detail in the following sections. ## Deploying your application to a Kubernetes cluster From 1505d5cbb7d471ae7e092019405817f25a0946db Mon Sep 17 00:00:00 2001 From: Sandy Koh Date: Wed, 15 Apr 2020 12:56:25 +0100 Subject: [PATCH 4/7] clarify this affects all appsody commands --- content/docs/faq.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/content/docs/faq.md b/content/docs/faq.md index ecff59726..39e9b388e 100644 --- a/content/docs/faq.md +++ b/content/docs/faq.md @@ -163,7 +163,4 @@ Their entry is removed from the `project.yaml` file and the associated volumes a ## 12. Can I use the Minikube docker daemon for development? -Currently, Appsody supports using a local Docker daemon only. If you use the Minikube Docker daemon, the following commands do not work as expected: - - [appsody extract](docs/cli-commands/#appsody-extract) - - [appsody build](docs/cli-commands/#appsody-build) - - [appsody deploy](docs/cli-commands/#appsody-deploy) \ No newline at end of file +Currently, Appsody supports using a local Docker daemon only. If you use the Minikube Docker daemon, Appsody commands will not work as expected. \ No newline at end of file From 0961f1df73463a14908e0de5cdf8a69a2a67fce9 Mon Sep 17 00:00:00 2001 From: Sandy Koh Date: Mon, 20 Apr 2020 14:56:49 +0100 Subject: [PATCH 5/7] reduce repetition --- content/docs/using-appsody/deploying.md | 33 ++++++++----------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/content/docs/using-appsody/deploying.md b/content/docs/using-appsody/deploying.md index 7624b6a0f..56a272757 100644 --- a/content/docs/using-appsody/deploying.md +++ b/content/docs/using-appsody/deploying.md @@ -10,6 +10,7 @@ The Appsody CLI provides the [appsody deploy](/docs/cli-commands/#appsody-deploy You can delegate the build and deployment steps to an external pipeline, such as a Tekton pipeline that consumes the source code of your Appsody project after you push it to a GitHub repository. Within the pipeline, you can run [appsody build](/docs/using-appsody/building), which builds the application image and generates a deployment manifest. You can use the manifest to deploy your application to a Kubernetes environment where the Appsody operator is installed. These deployment options are covered in more detail in the following sections. +> Options available to the `build` command, such as tagging and pushing images, are also available to the `deploy` command. For more details, see [here](/docs/using-appsody/building/#tagging-your-application-image). ## Deploying your application to a Kubernetes cluster There are many options to deploy your Appsody applications to a Kubernetes cluster. The best approach depends on the specific scenario: @@ -60,34 +61,20 @@ To deploy your application as a Knative service, the following **pre-requisites* Once the `appsody deploy --knative` command completes successfully, the Knative Service is operable at the URL specified in the command output. -### Deploying your application through Docker Hub +### Deploying to a private registry -If your cluster is configured to pull images from Docker Hub, use the following command to deploy your application: -``` -appsody deploy -t --push --namespace mynamespace [--knative] -``` -The command completes the following actions: - -- Calls `appsody build` and creates a deployment image, as described in the previous section. -- The `-t mynamespace/myrepository[:tag]` flag tags the image. -- The `--push` flag tells the Appsody CLI to push the image to Docker Hub. -- Creates a deployment manifest file named `app-deploy.yaml` in the project directory, if one doesn’t exist already. If a deployment manifest file exists, this command updates the following entries within it: application image, labels, and annotations. In addition, the `createKnativeService` entry is set to true if you specified the `--knative` flag. -- The Yaml file is used to issue a `kubectl apply -f` command against the target Kubernetes cluster. The Yaml file is set to use the Appsody operator. -- The `--namespace mynamespace` option provisions the deployment under the specified Kubernetes namespace within your cluster. - -> If you don't specify `--push`, the image is available only on your local Docker registry and the target Kubernetes cluster must be configured to have access to your local Docker registry. - -### Deploying your application to a custom registry -If your cluster is configured to pull images from a custom registry, use the following command to deploy your application: -``` -appsody deploy -t --push-url -``` +If you are pulling your image from a registry within your cluster, the registry may only be accessed by using a different name from outside your cluster, and a different name from within your cluster. To specify different push and pull registries, use the `--push-url ` and `--pull-url ` flags along with the `build` command. -If you are specifying different push and pull registries, for example, you might want to push to an external registry and pull from an internal registry, use the following command: +For example: ``` appsody deploy -t --push-url --pull-url ``` -> Note: The pull registry url gets injected into the deployment manifest for Kubernetes to pull the correct image. + +This command completes the following actions: +- The application image built by `appsody build` will be tagged with the name `mynamespace/myrepository[:tag]`, and pushed to the registry at the URL that you specify with ``. +- The `--pull-url` flag injects `` into the deployment manifest for Kubernetes to pull the correct image and your image is deployed to your Kubernetes cluster via the [Appsody operator](/docs/reference/appsody-operator) + +> If an [Appsody operator](/docs/reference/appsody-operator) cannot be found, one will be installed on your cluster. ## Deploying your application through a Tekton pipeline From 5f4d59c47c412aa3a1ec2aa29a73dd8fa992c6e4 Mon Sep 17 00:00:00 2001 From: Sandy Koh Date: Thu, 4 Jun 2020 14:47:13 +0100 Subject: [PATCH 6/7] add generate-only flag --- content/docs/using-appsody/deploying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/using-appsody/deploying.md b/content/docs/using-appsody/deploying.md index 56a272757..5d85facf5 100644 --- a/content/docs/using-appsody/deploying.md +++ b/content/docs/using-appsody/deploying.md @@ -43,7 +43,7 @@ To ensure the latest version of your application is pushed to the cluster, use t ### Deployment via the Appsody Operator Kubernetes operators offer a powerful way to provide full lifecycle maintenance of a wide range of resources on Kubernetes clusters. In particular, they can install, upgrade, remove, and monitor application deployments. The recently published [Appsody operator](https://operatorhub.io/operator/appsody-operator) automates the installation and maintenance of a special type of Custom Resource Definitions (CRDs), called **AppsodyApplication**. -The currently available Appsody stacks include a template of such a CRD manifest. When you run `appsody deploy` on a project created from one of the stacks enabled with those manifests, the CLI customizes the manifest with information that is specific to the deployment (e.g. namespace and project name), and submits the manifest to the Appsody operator on the Kubernetes cluster. +The currently available Appsody stacks include a template of such a CRD manifest. When you run `appsody deploy` on a project created from one of the stacks enabled with those manifests, the CLI customizes the manifest with information that is specific to the deployment (e.g. namespace and project name), and submits the manifest to the Appsody operator on the Kubernetes cluster. If you would like to generate the deployment manifest without having to deploy your Appsody project, use the `--generate-only` flag. In fact, if your cluster does not already provide an operator, `appsody deploy` will install one for you. You can also use the Appsody CLI to install an instance of the Appsody operator, without installing any applications. This can be achieved by running the `appsody operator install` command. From 4f746faf800a4f714a4cf4a35ed6dbdb58dfa562 Mon Sep 17 00:00:00 2001 From: Sandy Koh Date: Thu, 4 Jun 2020 16:03:37 +0100 Subject: [PATCH 7/7] reword --- content/docs/installing/installing-appsody.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/installing/installing-appsody.md b/content/docs/installing/installing-appsody.md index fc4cb5bb6..f814ffcd5 100644 --- a/content/docs/installing/installing-appsody.md +++ b/content/docs/installing/installing-appsody.md @@ -21,7 +21,7 @@ To use all of Appsody's functions, you need to install [Docker](https://docs.doc > Currently, Appsody supports using a local Docker daemon only. See the [FAQ](/docs/faq/#13-can-i-use-the-minikube-docker-daemon-for-development). -In environments where Docker is not available, a subset of Appsody commands can be used with Buildah as detailed in the [FAQ](/docs/faq#9-can-i-use-appsody-without-docker). Prerequisites specific to each operating system are provided within the links in the following section. +In environments where Docker is not available, a subset of Appsody commands can be used with Buildah as detailed in the [FAQ](/docs/faq#9-can-i-use-appsody-without-docker). Prerequisites specific to each operating system are provided within the links of the following section. ## Using installers