Skip to content

Commit

Permalink
Merge pull request #38 from stakater/remove-docs-from-onboarding
Browse files Browse the repository at this point in the history
remove github and gitlab docs, move bot-account.md to pipeline section
  • Loading branch information
mustafaStakater authored May 10, 2023
2 parents 6b64224 + e366165 commit 912efe9
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 132 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Introduction
Original file line number Diff line number Diff line change
Expand Up @@ -218,126 +218,3 @@ Visit the OpenShift console to verify the application deployment.
Visit the application url using routes to check if application is working as expected.

![review-web-ui](./images/review-web-ui.png)

## Tekton Pipelines for Application CI

Changes required in application repository:

1. Add webhook to application repository

Changes required in `gitops config repository`:

1. Add build environment in `apps-gitops-config` repository for application.
1. Add preview environment in `apps-gitops-config` repository for application.
1. Deploy pipelines `stakater-tekton-chart` to build environment of application in `apps-gitops-config`.
1. Deploy `triggerbindings` for the pipelines.
1. Trigger Pipeline by sending webhooks to `Eventlistener Route`.

### 1. Add webhook to application repository

Add webhook to the application repository; you can find the webhook URL in the routes of the `build` namespace; for payload you need to include the `pull requests` and `pushes` with ContentType `application/json`.

### GitHub

For GitHub add following to the payload.

![GitHub](./images/github.png)

### 4. Add files to `gitops config repository`

You need to create application folder inside a tenant. Inside application folder you need to create each environment folder that application will be deployed to. Following folders will be created.

- `\<tenant>/<01-application>.gitkeep`
- `\<tenant>/<01-application>/<00-build>`
- `\<tenant>/<01-application>/<00-preview>`
- `\<tenant>/<01-application>/<01-env-name>`
- `\<tenant>/<01-application>/<02-env-name>`
- `\<tenant>/<01-application>/<0n-env-name>`

### 00-build environment

### 00-preview environment

### 01-dev environment

### 02-stage environment

### 03-prod environment

To deploy, you'll need to add Helm chart of your application in **each** environment folder.

Add values of Helm chart that are different from default values at ```deploy/values.yaml``` defined in application repository

Templates for the files:

- `<tenant>/<application>/<env>\values.yaml`:

```yaml
<application>:
application:
space:
enabled: false
deployment:
image:
repository: <nexus-repo>/<tenant>/<application>
tag: v0.0.1
```

- `<tenant>/<app>/<env>\Chart.yaml`:

```yaml
apiVersion: v2
name: <application>
description: A Helm chart for Kubernetes
dependencies:
- name: <application>
version: 0.0.*
repository: <nexus-url>
type: application
version: 0.1.0
appVersion: 1.0.0
```

- `<tenant>/configs/<env>/argocd/<application>.yaml`:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: <tenant>-<env>-<application>
namespace: openshift-stakater-argocd
spec:
destination:
namespace: <tenant>-<env>
server: 'https://kubernetes.default.svc'
source:
path: <tenant>/<application>/<env>
repoURL: '<gitops-config>'
targetRevision: HEAD
project: <tenant>-<env>
syncPolicy:
automated:
prune: true
selfHeal: true
```

## 4. Deploy Pipelines

Deploy Pipelines `stakater-tekton-chart` to build environment of application in `apps-gitops-config`

## 5. Deploy TriggerBindings for the pipelines

## 6. Trigger Pipeline by sending webhooks to `Eventlistener Route`

## Junkyard

SAAP ships with few generic Tekton pipelines for quick jump start; all those pipelines expect to have Dockerfile in the root of the repository. Dockerfile should handle both build and package part; we typically use multi-stage Dockerfiles with 2 steps; one for build and another for run e.g.

The idea is to avoid having different pipelines for different applications and if possible do stuff in dockerfiles, but there can be use cases where users might need language specific pipelines.

Customers can do the way they like; as we ship few generic Tekton pipelines just for the sake of jump start.

We do have a separate offering `Pipeline as a Service`; in which we completely manage all sorts (generic and specific) of Tekton pipelines; reach out to [`sales@stakater.com`](mailto:sales@stakater.com) for more information.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ To make things easier, we have created a [template](https://github.com/stakater/
Team Stakater will create a root [Tenant](https://docs.stakater.com/mto/main/customresources.html#2-tenant), which will then create a root AppProject.
This AppProject will be used to sync all the Applications in `Infra Gitops Config` and it will provide visibility of these Applications in ArgoCD UI to customer cluster admins.

1. Open up your SCM and create any empty repository
1. Open up your SCM and create any empty repository.

> Follow along GitHub/GitLab documentation for configuring other organization specific requirements set for source code repositories.
1. Create a secret with read permissions over this repository. Navigate to following section for more info [Configure Repository Secret for ArgoCD](gitops-argocd-secrets.md). Provide this secret to stakater-admin for it to be deployed with your ArgoCD instance.
1. Now let's copy the structure that we saw in the [template](https://github.com/stakater/infra-gitops-config.git). Add a folder bearing your cluster's name say `dev` at the root of the repository that you just created.
> If you plan on using this repository for multiple clusters, add a folder for each cluster.
Expand Down Expand Up @@ -139,6 +142,9 @@ This GitOps structure supports:
### Create the repository

1. Open up your SCM and create any empty repository named `apps-gitops-config`.

> Follow along GitHub/GitLab documentation for configuring other organization specific requirements set for source code repositories.

1. Create a secret with read permissions over this repository. Navigate to following section for more info [Configure Repository Secret for ArgoCD](gitops-argocd-secrets.md). We'll use this secret later in [Linking Apps GitOps with Infra GitOps
](#linking-apps-gitops-with-infra-gitops).

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,18 @@ nav:
- for-delivery-engineers/gitops/structure.md
- for-delivery-engineers/gitops/creating-gitops-structure.md
- for-delivery-engineers/gitops/gitops-argocd-secrets.md
- for-delivery-engineers/gitops/application-onboarding.md
- for-delivery-engineers/gitops/environments.md
- for-delivery-engineers/gitops/github.md
- for-delivery-engineers/gitops/gitlab.md
- for-delivery-engineers/gitops/bot-account.md
- for-delivery-engineers/gitops/faq.md
- Pipelines:
- Tekton:
- for-delivery-engineers/ci-pipelines/tekton/intro.md
- GitHub Actions:
- for-delivery-engineers/ci-pipelines/github-actions/intro.md
- Continous Integration:
- Tekton:
- for-delivery-engineers/ci-pipelines/tekton/intro.md
- for-delivery-engineers/ci-pipelines/tekton/bot-account.md
- GitHub Actions:
- for-delivery-engineers/ci-pipelines/github-actions/intro.md
- Continous Delivery:
- ArgoCD:
- for-delivery-engineers/cd-pipelines/argocd/intro.md
- For Developers:
- for-developers/overview.md
- Onboarding:
Expand Down

0 comments on commit 912efe9

Please sign in to comment.