diff --git a/pages/how-to/set-up/micro-service copy.md b/pages/how-to/set-up/micro-service copy.md new file mode 100644 index 00000000..2b039706 --- /dev/null +++ b/pages/how-to/set-up/micro-service copy.md @@ -0,0 +1,73 @@ +--- +title: Setting Up a Micro Service +description: Deploying a Micro Service with Plural +--- + + +# Set Up +This example will deploy the [Plural CD Demo](https://github.com/pluralsh/plrl-cd-demo) App + +#### Add the Application Repository +* In your _Infra_ repo, add the `GitRepository` CRD + * `/app/repositories/cd-demo.yaml` +```yaml +apiVersion: deployments.plural.sh/v1alpha1 +kind: GitRepository +metadata: + name: cd-demo +spec: + url: https://github.com/pluralsh/plrl-cd-demo.git +``` +* The Plural repositories Service Deployment watches for changes in `/app/repositories` and will sync it to the management cluster + * The status `Pullable` means the Repository is ready to be used. +![import-git-status](/images/how-to/import-git-status.png) +* Setup a Dev and Prod ServiceDeployment using the Added Repo +```yaml +apiVersion: deployments.plural.sh/v1alpha1 +kind: ServiceDeployment +metadata: + name: cd-demo-dev + namespace: infra +spec: + namespace: cd-demo + git: + folder: helm + ref: main + repositoryRef: + kind: GitRepository + name: cd-demo + namespace: infra + helm: + version: "x.x.x" + release: cd-demo-dev + values: + image: + repository: ghcr.io/pluralsh/plrl-cd-test + pullPolicy: IfNotPresent + tag: "sha-783cc0c" + ingress: + enabled: true + className: nginx + annotations: + cert-manager.io/cluster-issuer: letsencrypt-staging + hosts: + - host: cd-demo.plrl.livingroom.cloud + paths: + - path: / + pathType: ImplementationSpecific + backend: + service: + name: cd-demo-dev + port: + number: 80 + tls: + - secretName: cd-demo-tls + hosts: + - cd-demo.plrl.livingroom.cloud + clusterRef: + kind: Cluster + name: plrl-how-to-workload-00-dev + namespace: infra +``` +* You should be able to see the service and all its components running +![](/images/how-to/micro-service.png) \ No newline at end of file diff --git a/pages/how-to/set-up/micro-service.md b/pages/how-to/set-up/micro-service.md index 59778047..2b039706 100644 --- a/pages/how-to/set-up/micro-service.md +++ b/pages/how-to/set-up/micro-service.md @@ -5,7 +5,7 @@ description: Deploying a Micro Service with Plural # Set Up -For this example we will deploy the [Plural CD Demo](https://github.com/pluralsh/plrl-cd-demo) App +This example will deploy the [Plural CD Demo](https://github.com/pluralsh/plrl-cd-demo) App #### Add the Application Repository * In your _Infra_ repo, add the `GitRepository` CRD @@ -55,6 +55,11 @@ spec: paths: - path: / pathType: ImplementationSpecific + backend: + service: + name: cd-demo-dev + port: + number: 80 tls: - secretName: cd-demo-tls hosts: @@ -63,4 +68,6 @@ spec: kind: Cluster name: plrl-how-to-workload-00-dev namespace: infra -``` \ No newline at end of file +``` +* You should be able to see the service and all its components running +![](/images/how-to/micro-service.png) \ No newline at end of file diff --git a/pages/how-to/set-up/pipelines.md b/pages/how-to/set-up/pipelines.md index df9053d3..237862d0 100644 --- a/pages/how-to/set-up/pipelines.md +++ b/pages/how-to/set-up/pipelines.md @@ -7,27 +7,58 @@ description: Using Plural Deploy Pipelines #### Ensure your _[app.plural.sh](https://app.plural.sh/profile/me)_ User has `admin` permissions -```sh -plural login -``` # Set Up -Set Up a dev -> staging -> prod pipeline - -include creation of the rest of the cluster fleet with stacks +This example will setup pipelines to deploy the [Plural CD Demo](https://github.com/pluralsh/plrl-cd-demo) -include CRDs +* We'll Create a Prod Cluster to promote the _cd-demo_ application to + * We'll follow the [steps for creating a new cluster](/how-to/set-up/workload-cluster), but select the `prd` tier + * Merge the changes from the PR Automation and Approve the Stack changes + * Once the cluster is created successfully we can create the prod service deployment -use the prior microservice -# Troubleshooting -#### Get Kubeconfig for the MGMT Cluster -```sh -plural wkspace kube-init +* Create a Pipeline.yaml in your _infra_ repo: +```yaml +apiVersion: deployments.plural.sh/v1alpha1 +kind: Pipeline +metadata: + name: cd-demo + namespace: infra +spec: + stages: + - name: dev + services: + - serviceRef: + name: cd-demo-dev + namespace: cd-demo + - name: prod + services: + - serviceRef: + name: cd-demo + namespace: cd-demo + criteria: + serviceRef: + name: cd-demo + namespace: cd-demo + secrets: + - version + edges: + - from: dev + to: prod + gates: + - name: approval-gate + type: APPROVAL +--- +apiVersion: deployments.plural.sh/v1alpha1 +kind: PipelineContext +metadata: + name: cd-demo-context +spec: + pipelineRef: + name: cd-demo + namespace: infra + context: + version: 6.5.4 ``` - -Use `kubectl` with the newly added kube context -The key namespaces to check are: -* plrl-console -* plrl-deploy-operator -* plrl-runtime +* Apply the yaml to your Management Cluster + * `kubectl -n infra apply -f pipline.ymal` diff --git a/public/images/how-to/micro-service.png b/public/images/how-to/micro-service.png new file mode 100644 index 00000000..1d68f819 Binary files /dev/null and b/public/images/how-to/micro-service.png differ diff --git a/src/NavData.tsx b/src/NavData.tsx index 17e5559e..d5de51bc 100644 --- a/src/NavData.tsx +++ b/src/NavData.tsx @@ -132,6 +132,10 @@ const rootNavData: NavMenu = deepFreeze([ title: 'Micro Service', href: '/how-to/set-up/micro-service', }, + { + title: 'Pipelines', + href: '/how-to/set-up/pipelines', + }, ], }, ],