Skip to content

Commit 88106f0

Browse files
committed
Add GitOps quick start topics and images
1 parent 4386859 commit 88106f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+978
-1
lines changed

_data/nav.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,26 @@
2626
- title: Kubernetes deployment quick start
2727
url: "/deploy-to-kubernetes"
2828
- title: Helm quick start
29-
localurl: "/deploy-with-helm"
29+
url: "/deploy-with-helm"
30+
- title: GitOps quick start
31+
url: "/gitops-quickstart"
32+
sub-pages:
33+
- title: Provision a hosted runtime
34+
url: "/install-hosted"
35+
- title: Prepare for hybrid runtime installation
36+
url: "/verify-requirements"
37+
- title: Install a hybrid runtime
38+
url: "/runtime"
39+
- title: Create an application
40+
url: "/create-app-ui"
41+
- title: Create and commit resources for application
42+
url: "/create-app-specs"
43+
- title: Update the image tag for application
44+
url: "/create-rollout"
45+
- title: Trigger the Hello World example pipeline
46+
url: "/hello-world"
47+
- title: Create a basic CI delivery pipeline
48+
url: "/create-ci-pipeline"
3049

3150

3251

File renamed without changes.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: "Quick start"
3+
description: ""
4+
group: getting-started
5+
toc: true
6+
---
7+
8+
Check out our quick start tutorial to get up and running in the Codefresh platform with hosted or hybrid runtimes.
9+
10+
The tutorial is divided into these sections:
11+
* Provisioning runtimes
12+
* Creating and deploying an application
13+
* Triggering and creating a Delivery Pipeline
14+
15+
Each section indicates the runtime environment it is relevant to.
16+
17+
### Provision runtimes
18+
Based on your deployment model, start by provisioning the hosted or hybrid runtime. Hosted and hybrid runtimes can co-exist with each other.
19+
20+
21+
#### Hosted
22+
Hosted runtimes are hosted on a Codefresh cluster and managed by Codefresh. You need to provision your hosted runtime once for your account.
23+
24+
1. [Provision a hosted runtime]({{site.baseurl}}/docs/getting-started/quick-start/install-hosted)
25+
Provision the hosted runtime with a single click, and complete the setup for your hosted environment.
26+
27+
{::nomarkdown}
28+
<br>
29+
{:/}
30+
31+
#### Hybrid
32+
Hybrid runtimes: Hosted on a customer cluster and managed by the customer. You can provision multiple hybrid runtimes in the same account.
33+
34+
1. [Prepare for hosted runtime installation]({{site.baseurl}}/docs/getting-started/quick-start/verify-requirements)
35+
Verify your environment matches the requirements for installing Codefresh runtime.
36+
1. [Install hybrid runtime]({{site.baseurl}}/docs/getting-started/quick-start/runtime)
37+
Install the Codefresh runtime by downloading the CLI, installing the runtime, and validate successful installation in the UI
38+
39+
### Deploy an application
40+
41+
1. [Create an application]({{site.baseurl}}/docs/getting-started/quick-start/create-app-ui)
42+
Create the `codefresh-guestbook` application in the Codefresh UI.
43+
1. [Create and commit resources for application]({{site.baseurl}}/docs/getting-started/quick-start/create-app-specs)
44+
Create rollout and service resources, and commit these resources to deploy the `codefresh-guestbook` application.
45+
1. [Update the image tag for application]({{site.baseurl}}/docs/getting-started/quick-start/create-rollout)
46+
Update the image for the `codefresh-guestbook` application to trigger a rollout.
47+
48+
### Trigger/create a Delivery Pipeline
49+
> Available for hybrid deployments.
50+
51+
1. [Trigger the Hello World example pipeline]({{site.baseurl}}/docs/getting-started/quick-start/hello-world)
52+
Configure the Git event to trigger the demo pipeline.
53+
1. [Create a basic CI delivery pipeline]({{site.baseurl}}/docs/getting-started/quick-start/create-ci-pipeline)
54+
Create a new CI delivery pipeline in Codefresh.
55+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: "Quick start"
3+
description: ""
4+
group: getting-started
5+
toc: true
6+
---
7+
8+
Check out our quick start tutorial to get up and running in the Codefresh platform with hosted or hybrid runtimes.
9+
10+
The tutorial is divided into these sections:
11+
* Provisioning runtimes
12+
* Creating and deploying an application
13+
* Triggering and creating a Delivery Pipeline
14+
15+
Each section indicates the runtime environment it is relevant to.
16+
17+
### Provision runtimes
18+
Based on your deployment model, start by provisioning the hosted or hybrid runtime. Hosted and hybrid runtimes can co-exist with each other.
19+
20+
21+
#### Hosted
22+
Hosted runtimes are hosted on a Codefresh cluster and managed by Codefresh. You need to provision your hosted runtime once for your account.
23+
24+
1. [Provision a hosted runtime]({{site.baseurl}}/docs/getting-started/quick-start/install-hosted)
25+
Provision the hosted runtime with a single click, and complete the setup for your hosted environment.
26+
27+
{::nomarkdown}
28+
<br>
29+
{:/}
30+
31+
#### Hybrid
32+
Hybrid runtimes: Hosted on a customer cluster and managed by the customer. You can provision multiple hybrid runtimes in the same account.
33+
34+
1. [Prepare for hosted runtime installation]({{site.baseurl}}/docs/getting-started/quick-start/verify-requirements)
35+
Verify your environment matches the requirements for installing Codefresh runtime.
36+
1. [Install hybrid runtime]({{site.baseurl}}/docs/getting-started/quick-start/runtime)
37+
Install the Codefresh runtime by downloading the CLI, installing the runtime, and validate successful installation in the UI
38+
39+
### Deploy an application
40+
41+
1. [Create an application]({{site.baseurl}}/docs/getting-started/quick-start/create-app-ui)
42+
Create the `codefresh-guestbook` application in the Codefresh UI.
43+
1. [Create and commit resources for application]({{site.baseurl}}/docs/getting-started/quick-start/create-app-specs)
44+
Create rollout and service resources, and commit these resources to deploy the `codefresh-guestbook` application.
45+
1. [Update the image tag for application]({{site.baseurl}}/docs/getting-started/quick-start/create-rollout)
46+
Update the image for the `codefresh-guestbook` application to trigger a rollout.
47+
48+
### Trigger/create a Delivery Pipeline
49+
> Available for hybrid deployments.
50+
51+
1. [Trigger the Hello World example pipeline]({{site.baseurl}}/docs/getting-started/quick-start/hello-world)
52+
Configure the Git event to trigger the demo pipeline.
53+
1. [Create a basic CI delivery pipeline]({{site.baseurl}}/docs/getting-started/quick-start/create-ci-pipeline)
54+
Create a new CI delivery pipeline in Codefresh.
55+
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
title: "Create and commit resources for application"
3+
description: ""
4+
group: getting-started
5+
sub-group: quick-start
6+
toc: true
7+
---
8+
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+
1. `Rollout` resource defining the deployment strategy
13+
1. `Service` resource to expose the application to external traffic
14+
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
18+
19+
### Create folder in Git for application resources
20+
Create a folder in the Git repo in which to save all the resources for the `codefresh-guestbook` application.
21+
22+
* In your Git repo, create a folder to store the resources needed to deploy the application.
23+
For example, `/quick-start/`
24+
25+
### Create rollout.yaml
26+
27+
Create a rollout resource for the application you want to deploy.
28+
29+
30+
To leverage Argo Rollouts' deployment capabilities, we are using the Argo's `rollout` resource instead of the native Kubernetes Deployment object.
31+
For detailed information on the fields you can define, see [Argo Rollout specification](https://argoproj.github.io/argo-rollouts/features/specification/){:target="\_blank"}.
32+
33+
34+
* In the Git repository create the `rollout.yaml` file, as in the example below.
35+
36+
37+
```yaml
38+
apiVersion: argoproj.io/v1alpha1
39+
kind: Rollout
40+
metadata:
41+
name: codefresh-guestbook-rollout
42+
spec:
43+
replicas: 4
44+
revisionHistoryLimit: 2
45+
selector:
46+
matchLabels:
47+
app: codefresh-guestbook
48+
template:
49+
metadata:
50+
labels:
51+
app: codefresh-guestbook
52+
spec:
53+
containers:
54+
- image: gcr.io/heptio-images/ks-guestbook-demo:0.1
55+
name: codefresh-guestbook
56+
ports:
57+
- name: http
58+
containerPort: 80
59+
protocol: TCP
60+
minReadySeconds: 30
61+
strategy:
62+
canary:
63+
steps:
64+
- setWeight: 25
65+
- pause: {duration: 20s}
66+
- setWeight: 75
67+
- pause: {duration: 15s}
68+
```
69+
70+
#### Fields in `rollout.yaml`
71+
72+
{: .table .table-bordered .table-hover}
73+
| Rollout Field | Notes |
74+
| -------------- | -------------|
75+
| `replicas` | When deployed, the rollout creates four replicas of the `codefresh-guestbook` application.|
76+
| `revisionHistoryLimit` | The number of replica sets to retain. |
77+
| `matchLabels` | The pods to select for this rollout. In our example, all pods with the label `codefresh-guestbook` are selected.|
78+
| `image` | The container image for the application with the version tag, `gcr.io/heptio-images/ks-guestbook-demo:0.1` in our example.|
79+
| `name` | The name of the application, `codefresh-guestbook` in our example. |
80+
| `canary` | The deployment strategy, `canary` meaning that the traffic is gradually routed to the new application. Starting with `setWeight` of `25%` followed by a `pause` of 20 seconds, and the remaining `75%` after verification.|
81+
| `templateName` | The analysis template used to validate the application metrics. Our example has the `background-analysis` template, and interfaces with Prometheus to monitor and validate metric thresholds.|
82+
83+
84+
### Create a service resource
85+
Create a service resource to expose your application to external traffic.
86+
87+
* Create a `service.yaml` resource for the application you want to deploy, as in the example below.
88+
> Create it in the same folder in which you saved `rollout.yaml`.
89+
90+
```yaml
91+
apiVersion: v1
92+
kind: Service
93+
metadata:
94+
name: codefresh-guestbook-svc
95+
spec:
96+
ports:
97+
- port: 8080
98+
targetPort: 80
99+
selector:
100+
app: codefresh-guestbook # must be the same as the selector defined in rollouts.yaml
101+
type: LoadBalancer
102+
```
103+
104+
#### Fields in `service.yaml`
105+
106+
{: .table .table-bordered .table-hover}
107+
| Service field | Notes |
108+
| -------------- | -------------- |
109+
| `spec.ports` | The internal `port`, 8080 in our example, and external `targetPort`, 80 in our example.|
110+
| `selector.app` | The pods to select, and MUST be identical to that defined in `rollouts.yaml`, `codefresh-guestbook` in our example.|
111+
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.
114+
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.
118+
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+
%}
128+
129+
### What to do next
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)
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: "Create an application"
3+
description: ""
4+
group: getting-started
5+
sub-group: quick-start
6+
toc: true
7+
---
8+
9+
Let's start by creating a simple application, the `codefresh-guestbook` application in the Codefresh UI.
10+
We'll create the application without resources and then define/add resources in the next step.
11+
12+
13+
For detailed information, see [Create an application]({{site.baseurl}}/docs/deployment/create-application).
14+
15+
16+
**How to**
17+
18+
19+
1. In the Codefresh UI, go to the [Applications](https://g.codefresh.io/2.0/applications-dashboard?sort=desc-lastUpdated){:target="\_blank"} dashboard.
20+
1. Select **Add Application** on the top-right.
21+
1. In the Add Application panel, add definitions for the application:
22+
* **Application name**: `codefresh-guestbook` for the quick start.
23+
* **Runtime**: The runtime to associate with the application, `hosted-runtime` for the quick start.
24+
* **Name for YAML file**: The name of the application's configuration manifest, assigned on commit to Git. By default, the manifest is assigned the application name.
25+
You can click the Edit icon and change the name, if needed.
26+
27+
>You cannot change the application definitions once you continue to the Configuration settings.
28+
29+
{% include
30+
image.html
31+
lightbox="true"
32+
file="/images/getting-started/quick-start/cdops-add-app-settings.png"
33+
url="/images/getting-started/quick-start/cdops-add-app-settings.png"
34+
alt="Add Application panel"
35+
caption="Add Application panel"
36+
max-width="50%"
37+
%}
38+
39+
{:start="4"}
40+
1. Select **Next** to go to the Configuration tab.
41+
By default you are in Form mode. You can toggle between the Form and YAML modes as you define the application's configuration settings.
42+
1. Define the **General** settings for the application:
43+
* **Repository URL**: The URL to the repo in Git where you created the YAML resource files for the application.
44+
* **Revision**: The branch in Git with the resource files.
45+
* **Path**: The folder in Git with the resource files.
46+
* **Namespace**: Optional. For the quick start, we'll create a namespace for the application, entitled `quick-start`.
47+
* **Sync Policy**: Change to **Automatic**, and select **Prune resources** to automatically remove unused resources.
48+
* **Sync Options**: If you defined a namespace, select **Auto-create namespace** to ensure that the namespace is created if it doesn't exist.
49+
50+
{% include
51+
image.html
52+
lightbox="true"
53+
file="/images/getting-started/quick-start/cdops-add-app-configuration.png"
54+
url="/images/getting-started/quick-start/cdops-add-app-configuration.png"
55+
alt="Add Application Quick Start: General settings"
56+
caption="Add Application Quick Start: General settings"
57+
max-width="70%"
58+
%}
59+
60+
61+
{:start="6"}
62+
1. Retain the default **Advanced Settings**.
63+
1. To commit all your changes, select **Commit**.
64+
The Commit form is displayed with the application's definitions on the left, and the read-only version of the manifest with the configuration settings you defined on the right.
65+
1. Select the **Git Source** to which to commit.
66+
67+
{% include
68+
image.html
69+
lightbox="true"
70+
file="/images/getting-started/quick-start/cdops-add-app-commit.png"
71+
url="/images/getting-started/quick-start/cdops-add-app-commit.png"
72+
alt="Add Application Quick Start: Commit to Git"
73+
caption="Add Application Quick Start: Commit to Git"
74+
max-width="70%"
75+
%}
76+
77+
{:start="9"}
78+
1. Add a commit message and then select **Commit** at the bottom-right of the panel.
79+
You are directed to the [Applications dashboard](https://g.codefresh.io/2.0/applications-dashboard?sort=desc-lastUpdated){:target="\_blank"}.
80+
You may have to wait for a few seconds until the application is synced to the cluster.
81+
82+
{% include
83+
image.html
84+
lightbox="true"
85+
file="/images/getting-started/quick-start/cdops-add-app-dashboard.png"
86+
url="/images/getting-started/quick-start/cdops-add-app-dashboard.png"
87+
alt="Application dashboard with new application"
88+
caption="Application dashboard with new application"
89+
max-width="70%"
90+
%}
91+
92+
{:start="10"}
93+
1. Select the application. The Current State tab does not display any resources as we have not created any resources for the application.
94+
95+
{% include
96+
image.html
97+
lightbox="true"
98+
file="/images/getting-started/quick-start/cdops-app-empty-current-state.png"
99+
url="/images/getting-started/quick-start/cdops-app-empty-current-state.png"
100+
alt="Empty Current State for new application"
101+
caption="Empty Current State for new application"
102+
max-width="70%"
103+
%}
104+
105+
106+
In the next task, you will create and commit resources for the `codefresh-guestbook` application and deploy the application.
107+
108+
109+
### What to do next
110+
[Create and commit resources for application]({{site.baseurl}}/docs/getting-started/quick-start/create-app-specs/)

0 commit comments

Comments
 (0)