|
1 | 1 | --- |
2 | | -title: "Create resources for codefresh-guestbook" |
| 2 | +title: "Create and commit resources for application" |
3 | 3 | description: "" |
4 | 4 | group: getting-started |
5 | 5 | sub-group: quick-start |
6 | 6 | toc: true |
7 | 7 | --- |
8 | 8 |
|
9 | | -Before you can create an application in Codefresh, you need to create the resources used by the application: |
10 | | - |
11 | | -1. Install Argo Rollouts on the target cluster to which you will deploy the application |
| 9 | +Now that you have created an application, you need to deploy the application. Let's deploy the `codefresh-guestbook` application by creating and commiting resources. |
| 10 | +You will create and commit the following resources: |
| 11 | +1. A folder in Git to save resources for the application |
12 | 12 | 1. `Rollout` resource defining the deployment strategy |
13 | | -1. Service resource to expose the application to external traffic |
14 | | -1. Analysis Template resource defining the validation requirements before deployment |
15 | | - |
16 | | -### Install Argo Rollouts on the target cluster |
17 | | -To apply the `Rollout` resource for the application, you must have Argo Rollouts installed on the target cluster. If not installed, follow the steps to install Argo Rollouts. |
18 | | - |
19 | | -1. In the Codefresh UI, go to [Runtimes](https://g.codefresh.io/2.0/account-settings/runtimes){:target="\_blank"}. |
20 | | -1. Select **Topology View**. |
21 | | -1. Select the target cluster, and then select **+ Install Argo Rollouts**. |
| 13 | +1. `Service` resource to expose the application to external traffic |
22 | 14 |
|
23 | | -{% include |
24 | | - image.html |
25 | | - lightbox="true" |
26 | | - file="/images/getting-started/quick-start/cdops-app-install-rollout.png" |
27 | | - url="/images/getting-started/quick-start/cdops-app-install-rollout.png" |
28 | | - alt="Install Argo Rollouts on target cluster" |
29 | | - caption="Install Argo Rollouts on target cluster" |
30 | | - max-width="50%" |
31 | | - %} |
| 15 | +### Before you begin |
| 16 | +* [Create an application]({{site.baseurl}}/docs/getting-started/quick-start/create-app-ui) |
| 17 | +* Make sure [Argo Rollouts is installed]({{site.baseurl}}/docs/deployment/install-argo-rollouts) on the target cluster |
32 | 18 |
|
33 | 19 | ### Create folder in Git for application resources |
34 | | -Create a folder in the Git repo in which to save all the resources. |
| 20 | +Create a folder in the Git repo in which to save all the resources for the `codefresh-guestbook` application. |
35 | 21 |
|
36 | 22 | * In your Git repo, create a folder to store the resources needed to deploy the application. |
37 | | - |
38 | 23 | For example, `/quick-start/` |
39 | 24 |
|
40 | 25 | ### Create rollout.yaml |
41 | 26 |
|
42 | 27 | Create a rollout resource for the application you want to deploy. |
43 | 28 |
|
44 | 29 |
|
45 | | -To leverage Argo Rollout's deployment capabilities, we are using the Argo's Rollout resource instead of the native Kubernetes Deployment object. |
| 30 | +To leverage Argo Rollouts' deployment capabilities, we are using the Argo's `rollout` resource instead of the native Kubernetes Deployment object. |
46 | 31 | For detailed information on the fields you can define, see [Argo Rollout specification](https://argoproj.github.io/argo-rollouts/features/specification/){:target="\_blank"}. |
47 | 32 |
|
48 | 33 |
|
|
75 | 60 | minReadySeconds: 30 |
76 | 61 | strategy: |
77 | 62 | canary: |
78 | | - analysis: |
79 | | - templates: |
80 | | - - templateName: background-analysis |
81 | | - startingStep: 1 |
82 | 63 | steps: |
83 | 64 | - setWeight: 25 |
84 | 65 | - pause: {duration: 20s} |
@@ -128,48 +109,23 @@ spec: |
128 | 109 | | `spec.ports` | The internal `port`, 8080 in our example, and external `targetPort`, 80 in our example.| |
129 | 110 | | `selector.app` | The pods to select, and MUST be identical to that defined in `rollouts.yaml`, `codefresh-guestbook` in our example.| |
130 | 111 |
|
131 | | -### Create an AnalysisTemplate for rollout validation |
132 | | -Create an `AnalysisTemplate` resource to validate that your changes conform to the requirements before deployment. This is the final resource you need before you can create the application. |
133 | | - |
134 | | -The name of the `AnalysisTemplate` in the quick start example is `background-analysis`. The template interfaces with Prometheus as the third-party metric provider to validate metrics. |
135 | | - |
136 | | -You can use any third-party metric provider supported by Argo Rollouts, such as Prometheus, Datadog, Wavefront, and more. Read the official documentation on [Analysis section in Argo Rollouts](https://argoproj.github.io/argo-rollouts/){:target="\_blank"}. |
137 | | - |
138 | | - |
139 | | -* In the Git repository create the `analysisTemplate.yaml` file, as in the example below. |
140 | | - |
| 112 | +### View application resources in Codefresh |
| 113 | +Once you create and commit the `rollout` and `service` resources, return to the Applications dashboard. The Current State to see these resources. |
141 | 114 |
|
142 | | -```yaml |
143 | | -apiVersion: argoproj.io/v1alpha1 |
144 | | -kind: AnalysisTemplate |
145 | | -metadata: |
146 | | - name: background-analysis |
147 | | -spec: |
148 | | - metrics: |
149 | | - - name: prometheus-metric |
150 | | - count: 4 |
151 | | - interval: 5s |
152 | | - successCondition: result[0] >= 100 |
153 | | - failureLimit: 1 |
154 | | - provider: |
155 | | - prometheus: |
156 | | - address: http://a95910c83807a4089a2458554bf5c21e-1864259807.us-east-1.elb.amazonaws.com:9090 |
157 | | - query: | |
158 | | - sum(argocd_app_reconcile_sum) |
159 | | -``` |
160 | | - |
161 | | -#### Fields in `analysisTemplate.yaml` |
| 115 | +1. In the Codefresh UI, go to the [Applications dashboard](https://g.codefresh.io/2.0/applications-dashboard?sort=desc-lastUpdated){:target="\_blank"}. |
| 116 | +1. Select the application. |
| 117 | + The Current State tab is now populated with the `rollout` and `service` resources you added. |
162 | 118 |
|
163 | | -{: .table .table-bordered .table-hover} |
164 | | -| Analysis Template field | Notes | |
165 | | -| -------------- | -------------- | |
166 | | -| `count` | The total number of measurements taken, `4` in our example.| |
167 | | -| `interval` | The interval between measurement samplings, `5s` in our example.| |
168 | | -| `successCondition` | The requirement for the rollout to be considered a success. In our example, the resulting metric value must be equal to or greater than 100.| |
169 | | -| `failureLimit` | The maximum number of failures permitted, `1` in our example. If the metric value is below 100 more than once, the rollout is aborted.| |
170 | | -| `query` | The query submitted to the Prometheus server.| |
171 | | - |
172 | | -You are now ready to create the application in Codefresh. |
| 119 | + {% include |
| 120 | + image.html |
| 121 | + lightbox="true" |
| 122 | + file="/images/getting-started/quick-start/cdops-app-current-state.png" |
| 123 | + url="/images/getting-started/quick-start/cdops-app-current-state.png" |
| 124 | + alt="Current State with resources for application" |
| 125 | + caption="Current State with resources for application" |
| 126 | + max-width="70%" |
| 127 | + %} |
173 | 128 |
|
174 | 129 | ### What to do next |
175 | | -[Create the codefresh-guestbook application]({{site.baseurl}}/docs/getting-started/quick-start/create-app-ui) |
| 130 | +<!---[Create Jira and Docker Hub integrations ]({{site.baseurl}}/docs/getting-started/quick-start/create-app-ui)---> |
| 131 | +[(Optional) Update image tag for application]({{site.baseurl}}/docs/getting-started/quick-start/create-rollout) |
0 commit comments