├── .gitignore ├── plugins ├── kasane │ ├── .gitignore │ ├── Kasanefile │ ├── patch.jsonnet │ └── README.md ├── kustomized-helm │ ├── .gitignore │ ├── kustomization.yaml │ ├── overlays │ │ └── guestbook-deployment.yaml │ ├── README.md │ └── Chart.yaml └── README.md ├── ksonnet-guestbook ├── environments │ ├── default │ │ ├── globals.libsonnet │ │ ├── main.jsonnet │ │ └── params.libsonnet │ ├── dev │ │ ├── globals.libsonnet │ │ ├── main.jsonnet │ │ └── params.libsonnet │ ├── prod │ │ ├── globals.libsonnet │ │ ├── main.jsonnet │ │ └── params.libsonnet │ └── base.libsonnet ├── .gitignore ├── app.yaml └── components │ ├── params.libsonnet │ └── guestbook-ui.jsonnet ├── helm-guestbook ├── values-production.yaml ├── harnesscd-pipeline │ ├── k8s-environment.yml │ ├── nativehelm-environment.yml │ ├── kubernetes-connector.yml │ ├── README.md │ ├── k8s-infrastructure-definition.yml │ ├── nativehelm-infrastructure-definition.yml │ ├── github-connector.yml │ ├── k8s-service.yml │ ├── nativehelm-service.yml │ ├── nativehelm-rolling-pipeline.yml │ └── k8s-rolling-pipeline.yml ├── harness-gitops │ ├── cluster.yml │ ├── repository.yml │ └── application.yml ├── .helmignore ├── templates │ ├── service.yaml │ ├── _helpers.tpl │ ├── NOTES.txt │ └── deployment.yaml ├── Chart.yaml └── values.yaml ├── aws-lambda ├── hello_world.zip ├── function-definition.json └── harnesscd-pipeline │ ├── environment.yml │ ├── infrastructure-definition.yml │ ├── aws-connector.yml │ ├── service.yml │ └── pipeline.yml ├── google_cloud_function ├── helloHttp.zip ├── hello_world.zip ├── hello_world.yaml ├── hello_http.yaml ├── environment.yml ├── gcp-connector.yml ├── infrastructure-definition.yml ├── github-connector.yml ├── 2nd_gen │ ├── service.yml │ └── basic-pipeline.yml └── 1st_gen │ └── service.yml ├── serverless-lambda ├── backend │ ├── .gitignore │ ├── package.json │ ├── index.js │ └── serverless.yml ├── frontend │ ├── public │ │ ├── favicon.ico │ │ ├── manifest.json │ │ └── index.html │ ├── src │ │ ├── images │ │ │ └── logo.png │ │ ├── index.js │ │ └── index.css │ ├── .gitignore │ └── package.json └── harnesscd-pipeline │ ├── environment.yml │ ├── infrastructure-definition.yml │ ├── service.yml │ ├── aws-connector.yml │ ├── github-connector.yml │ └── serverless-deployment.yml ├── custom-usecases ├── static │ ├── jfrog-repo.png │ └── tfe-workspaces.png ├── Multi-Tenant Architecture │ └── config-files │ │ ├── tenant_ip_config.xml │ │ ├── master_config.xml │ │ └── tenant_config │ │ ├── tenant_project_1.xml │ │ ├── tenant_project_2.xml │ │ └── tenant_project_3.xml ├── Dynamic-deployment-for-Multi-env-usecase-2 │ ├── Description.md │ ├── stage-template.yaml │ └── chained-pipeline.yaml ├── Git Clone Functionality for Run Step │ └── pipeline.yaml ├── terraform-workspace-jfrog-remote-backend │ ├── pipeline.yaml │ └── template.yaml ├── Custom-deployment-for-Lambda-Functions │ ├── Pipeline-using-template │ │ ├── infrastructure.yaml │ │ └── pipeline.yaml │ └── Pipeline-using-custom-stage │ │ └── Description.md └── terraform-create-workspace │ └── Description.md ├── cd-features ├── static │ └── slack-notify-step.png ├── last-successful-artifact-tag │ ├── static │ │ ├── runtime-input.png │ │ └── setting-artifact.png │ ├── enviornment.yaml │ ├── infrastructureDefinition.yaml │ └── service.yaml └── slack-notify-step │ └── pipeline.yaml ├── helm-dependency ├── values.yaml ├── values-nomaria.yaml ├── Chart.yaml └── README.md ├── kubernetes-steps ├── static │ ├── k8s-traffic-routing.png │ └── k8s-traffic-routing-2.png └── diff-step │ └── pipeline.yaml ├── podinfo ├── apps │ └── podinfo │ │ ├── kustomization.yaml │ │ └── service.yaml ├── harness-gitops │ ├── environment-dev.yml │ ├── environment-prod.yml │ ├── cluster.yml │ ├── repository.yml │ ├── github-connector.yml │ ├── application.yml │ ├── trigger.yml │ └── service.yml ├── configs │ └── git-generator-files-discovery │ │ ├── cluster-config │ │ └── engineering │ │ │ ├── dev │ │ │ └── config.json │ │ │ └── prod │ │ │ └── config.json │ │ └── git-generator-files.yaml └── podinfo-svc.yaml ├── pre-post-sync ├── kustomization.yaml ├── post-sync-job.yaml └── pre-sync-job.yaml ├── helm-native-canary-blue-green ├── Chart.yaml ├── harnesscd-pipeline │ ├── environment.yaml │ ├── infrastructureDefinition.yaml │ ├── helm_service_native.yaml │ └── Build_and_push_Dockerhub.yaml ├── templates │ ├── service.yaml │ ├── ingress.yaml │ └── deployment.yaml └── values.yaml ├── apps ├── values.yaml ├── templates │ ├── sync-waves.yaml │ ├── helm-hooks.yaml │ ├── helm-guestbook.yaml │ ├── kustomize-guestbook.yaml │ └── namespaces.yaml └── Chart.yaml ├── azure-function-deployment ├── static │ ├── Screenshot 2024-12-03 at 2.53.05 PM.png │ └── Screenshot 2024-12-03 at 3.31.06 PM.png └── harness-cd-pipelines │ ├── environment.yaml │ ├── infrastructureDefinition.yaml │ └── service.yaml ├── guestbook ├── guestbook-ui-svc.yaml ├── harnesscd-pipeline │ ├── environment.yml │ ├── kubernetes-connector.yml │ ├── README.md │ ├── infrastructure-definition.yml │ ├── github-connector.yml │ ├── service.yml │ ├── rolling-pipeline.yml │ └── bluegreen-pipeline.yml ├── harness-gitops │ ├── cluster.yml │ ├── repository.yml │ └── application.yml └── guestbook-ui-deployment.yaml ├── kustomize-guestbook ├── kustomization.yaml ├── guestbook-ui-svc.yaml ├── harnesscd-pipeline │ ├── environment.yml │ ├── kubernetes-connector.yml │ ├── README.md │ ├── infrastructure-definition.yml │ ├── github-connector.yml │ ├── service.yml │ └── rolling-pipeline.yml ├── harness-gitops │ ├── cluster.yml │ ├── repository.yml │ └── application.yml └── guestbook-ui-deployment.yaml ├── workshop-guestbook ├── kustomization.yaml ├── guestbook-ui-svc.yaml └── guestbook-ui-deployment.yaml ├── jsonnet-guestbook ├── params.libsonnet └── guestbook-ui.jsonnet ├── vm-pdc ├── ssh │ ├── environment.yml │ ├── pdc-connector.yml │ ├── artifactory-connector.yml │ ├── infrastructure-definition.yml │ └── service.yml └── winrm │ ├── environment.yml │ ├── pdc-connector.yml │ ├── artifactory-connector.yml │ ├── infrastructure-definition.yml │ └── service.yml ├── deploy-own-app ├── cd-pipeline │ ├── environment.yml │ ├── kubernetes-connector.yml │ ├── infrastructure-definition.yml │ ├── github-connector.yml │ ├── service.yml │ ├── rolling-pipeline.yml │ └── bluegreen-pipeline.yml └── gitops │ ├── cluster.yml │ ├── repository.yml │ └── application.yml ├── vm-aws ├── ssh │ ├── environment.yml │ ├── artifactory-connector.yml │ ├── aws-connector.yml │ ├── service.yml │ └── infrastructure-definition.yml └── winrm │ ├── environment.yml │ ├── artifactory-connector.yml │ ├── aws-connector.yml │ ├── service.yml │ └── infrastructure-definition.yml ├── vm-azure ├── ssh │ ├── environment.yml │ ├── artifactory-connector.yml │ ├── azure-connector.yml │ ├── service.yml │ └── infrastructure-definition.yml └── winrm │ ├── environment.yml │ ├── artifactory-connector.yml │ ├── azure-connector.yml │ ├── service.yml │ └── infrastructure-definition.yml ├── google-cloud-run └── harness-cd-pipeline │ ├── environment.yaml │ ├── infrastructureDefinition.yaml │ ├── manifest.yaml │ └── service.yaml ├── sock-shop ├── base │ ├── orders-svc.yaml │ ├── user-svc.yaml │ ├── payment-svc.yaml │ ├── catalogue-svc.yaml │ ├── front-end-svc.yaml │ ├── carts-db-svc.yaml │ ├── shipping-svc.yaml │ ├── user-db-svc.yaml │ ├── orders-db-svc.yaml │ ├── session-db-svc.yaml │ ├── catalogue-db-svc.yaml │ ├── queue-master-svc.yaml │ ├── rabbitmq-svc.yaml │ ├── catalogue-db-dep.yaml │ ├── session-db-dep.yaml │ ├── carts-db-dep.yaml │ ├── orders-db-dep.yaml │ ├── user-db-dep.yaml │ ├── rabbitmq-dep.yaml │ ├── front-end-dep.yaml │ ├── payment-dep.yaml │ ├── catalogue-dep.yaml │ ├── queue-master-dep.yaml │ ├── user-dep.yaml │ ├── carts-dep.yaml │ ├── orders-dep.yaml │ └── shipping-dep.yaml └── kustomization.yaml ├── harness-platform ├── secrets │ ├── gcp-secret-manager-connector.yaml │ ├── gcp-kms-connector.yaml │ ├── aws-kms-connector.yaml │ ├── aws-secret-manager-connector.yaml │ ├── hashicorp_vault_connector.yaml │ └── secret-sanitization.yaml ├── triggers │ ├── custom-trigger.yml │ ├── gitlab-trigger.yml │ ├── github-trigger.yml │ └── docker-trigger.yml └── approval │ └── jira-connector.yml ├── blue-green ├── .helmignore ├── Chart.yaml ├── templates │ ├── _helpers.tpl │ ├── services.yaml │ ├── NOTES.txt │ └── rollout.yaml ├── values.yaml └── README.md ├── event-relay-triggers └── trigger.yaml ├── cloudformation ├── git-connector.yaml └── aws-connector.yml ├── README.md ├── jsonnet-guestbook-tla └── guestbook-ui.jsonnet └── helm-hooks └── manifests.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /plugins/kasane/.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | Kasanefile.lock 3 | -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/default/globals.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/dev/globals.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/prod/globals.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /helm-guestbook/values-production.yaml: -------------------------------------------------------------------------------- 1 | service: 2 | type: LoadBalancer 3 | -------------------------------------------------------------------------------- /plugins/kustomized-helm/.gitignore: -------------------------------------------------------------------------------- 1 | all.yaml 2 | charts 3 | requirements.lock 4 | -------------------------------------------------------------------------------- /ksonnet-guestbook/.gitignore: -------------------------------------------------------------------------------- 1 | /lib 2 | /.ksonnet/registries 3 | /app.override.yaml 4 | /.ks_environment 5 | -------------------------------------------------------------------------------- /aws-lambda/hello_world.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/aws-lambda/hello_world.zip -------------------------------------------------------------------------------- /google_cloud_function/helloHttp.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/google_cloud_function/helloHttp.zip -------------------------------------------------------------------------------- /serverless-lambda/backend/.gitignore: -------------------------------------------------------------------------------- 1 | # package directories 2 | node_modules 3 | jspm_packages 4 | 5 | # Serverless directories 6 | .serverless 7 | -------------------------------------------------------------------------------- /custom-usecases/static/jfrog-repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/custom-usecases/static/jfrog-repo.png -------------------------------------------------------------------------------- /google_cloud_function/hello_world.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/google_cloud_function/hello_world.zip -------------------------------------------------------------------------------- /cd-features/static/slack-notify-step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/cd-features/static/slack-notify-step.png -------------------------------------------------------------------------------- /custom-usecases/static/tfe-workspaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/custom-usecases/static/tfe-workspaces.png -------------------------------------------------------------------------------- /plugins/kasane/Kasanefile: -------------------------------------------------------------------------------- 1 | layers: 2 | - ../../guestbook/guestbook-ui-deployment.yaml 3 | - patch.jsonnet 4 | - ../../guestbook/guestbook-ui-svc.yaml 5 | 6 | -------------------------------------------------------------------------------- /plugins/kasane/patch.jsonnet: -------------------------------------------------------------------------------- 1 | function (layers) 2 | 3 | [ 4 | layers[0] { 5 | spec+: { 6 | replicas: 2, 7 | }, 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /helm-dependency/values.yaml: -------------------------------------------------------------------------------- 1 | wordpress: 2 | wordpressPassword: foo 3 | mariadb: 4 | db: 5 | password: bar 6 | rootUser: 7 | password: baz 8 | -------------------------------------------------------------------------------- /plugins/kustomized-helm/kustomization.yaml: -------------------------------------------------------------------------------- 1 | namePrefix: kustomize- 2 | 3 | resources: 4 | - ./all.yaml 5 | 6 | patches: 7 | - overlays/guestbook-deployment.yaml 8 | -------------------------------------------------------------------------------- /serverless-lambda/frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/serverless-lambda/frontend/public/favicon.ico -------------------------------------------------------------------------------- /serverless-lambda/frontend/src/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/serverless-lambda/frontend/src/images/logo.png -------------------------------------------------------------------------------- /kubernetes-steps/static/k8s-traffic-routing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/kubernetes-steps/static/k8s-traffic-routing.png -------------------------------------------------------------------------------- /podinfo/apps/podinfo/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | resources: 4 | - deployment.yaml 5 | - service.yaml 6 | -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/base.libsonnet: -------------------------------------------------------------------------------- 1 | local components = std.extVar("__ksonnet/components"); 2 | components + { 3 | // Insert user-specified overrides here. 4 | } 5 | -------------------------------------------------------------------------------- /kubernetes-steps/static/k8s-traffic-routing-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/kubernetes-steps/static/k8s-traffic-routing-2.png -------------------------------------------------------------------------------- /pre-post-sync/kustomization.yaml: -------------------------------------------------------------------------------- 1 | namePrefix: pre-post-sync- 2 | 3 | bases: 4 | - ../kustomize-guestbook 5 | 6 | resources: 7 | - pre-sync-job.yaml 8 | - post-sync-job.yaml 9 | -------------------------------------------------------------------------------- /aws-lambda/function-definition.json: -------------------------------------------------------------------------------- 1 | { 2 | "functionName": "helloworld", 3 | "runtime": "python3.10", 4 | "handler": "handler.hello", 5 | "role": "" 6 | } 7 | -------------------------------------------------------------------------------- /google_cloud_function/hello_world.yaml: -------------------------------------------------------------------------------- 1 | function: 2 | name: hello_world 3 | runtime: python311 4 | entryPoint: hello_world 5 | httpsTrigger: 6 | securityLevel: SECURE_OPTIONAL 7 | -------------------------------------------------------------------------------- /helm-native-canary-blue-green/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: helm-native-canary-bg-deploy 3 | description: Helm chart for deploying a python sample app 4 | version: 1.0.0 5 | appVersion: 1.0.0 -------------------------------------------------------------------------------- /apps/values.yaml: -------------------------------------------------------------------------------- 1 | spec: 2 | destination: 3 | server: https://kubernetes.default.svc 4 | source: 5 | repoURL: https://github.com/harnessproj/harnesscd-example-apps 6 | targetRevision: HEAD -------------------------------------------------------------------------------- /cd-features/last-successful-artifact-tag/static/runtime-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/cd-features/last-successful-artifact-tag/static/runtime-input.png -------------------------------------------------------------------------------- /google_cloud_function/hello_http.yaml: -------------------------------------------------------------------------------- 1 | function: 2 | name: hello_http 3 | buildConfig: 4 | runtime: python311 5 | entryPoint: hello_http 6 | environment: GEN_2 7 | function_id: hello_http 8 | -------------------------------------------------------------------------------- /cd-features/last-successful-artifact-tag/static/setting-artifact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/cd-features/last-successful-artifact-tag/static/setting-artifact.png -------------------------------------------------------------------------------- /azure-function-deployment/static/Screenshot 2024-12-03 at 2.53.05 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/azure-function-deployment/static/Screenshot 2024-12-03 at 2.53.05 PM.png -------------------------------------------------------------------------------- /azure-function-deployment/static/Screenshot 2024-12-03 at 3.31.06 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harness-community/harnesscd-example-apps/HEAD/azure-function-deployment/static/Screenshot 2024-12-03 at 3.31.06 PM.png -------------------------------------------------------------------------------- /guestbook/guestbook-ui-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: guestbook-ui 5 | spec: 6 | ports: 7 | - port: 80 8 | targetPort: 80 9 | selector: 10 | app: guestbook-ui 11 | -------------------------------------------------------------------------------- /kustomize-guestbook/kustomization.yaml: -------------------------------------------------------------------------------- 1 | namePrefix: kustomize- 2 | 3 | resources: 4 | - guestbook-ui-deployment.yaml 5 | - guestbook-ui-svc.yaml 6 | apiVersion: kustomize.config.k8s.io/v1beta1 7 | kind: Kustomization 8 | -------------------------------------------------------------------------------- /workshop-guestbook/kustomization.yaml: -------------------------------------------------------------------------------- 1 | namePrefix: kustomize- 2 | 3 | resources: 4 | - guestbook-ui-deployment.yaml 5 | - guestbook-ui-svc.yaml 6 | apiVersion: kustomize.config.k8s.io/v1beta1 7 | kind: Kustomization 8 | -------------------------------------------------------------------------------- /podinfo/harness-gitops/environment-dev.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: dev 3 | identifier: dev 4 | tags: {} 5 | type: PreProduction 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | variables: [] 9 | -------------------------------------------------------------------------------- /podinfo/harness-gitops/environment-prod.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: prod 3 | identifier: prod 4 | tags: {} 5 | type: Production 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | variables: [] 9 | -------------------------------------------------------------------------------- /jsonnet-guestbook/params.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | containerPort: 80, 3 | image: "gcr.io/heptio-images/ks-guestbook-demo:0.1", 4 | name: "jsonnet-guestbook-ui", 5 | replicas: 3, 6 | servicePort: 80, 7 | type: "LoadBalancer", 8 | } 9 | -------------------------------------------------------------------------------- /kustomize-guestbook/guestbook-ui-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: guestbook-ui 5 | spec: 6 | ports: 7 | - port: 80 8 | targetPort: 80 9 | selector: 10 | app: guestbook-ui 11 | -------------------------------------------------------------------------------- /aws-lambda/harnesscd-pipeline/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: lambda_env 3 | identifier: lambda_env 4 | description: "" 5 | tags: {} 6 | type: Production 7 | orgIdentifier: your_org_id 8 | projectIdentifier: your_project_id 9 | -------------------------------------------------------------------------------- /cd-features/last-successful-artifact-tag/enviornment.yaml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: k8s-demo-env 3 | identifier: k8sdemoenv 4 | tags: {} 5 | type: PreProduction 6 | orgIdentifier: default 7 | projectIdentifier: YOUR_PROJECT_IDENTIFIER 8 | -------------------------------------------------------------------------------- /vm-pdc/ssh/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] -------------------------------------------------------------------------------- /vm-pdc/winrm/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] -------------------------------------------------------------------------------- /azure-function-deployment/harness-cd-pipelines/environment.yaml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: Azure 3 | identifier: Azure 4 | description: "" 5 | tags: {} 6 | type: Pre-Production 7 | orgIdentifier: Ng_Pipelines_K8s 8 | projectIdentifier: TestProject 9 | -------------------------------------------------------------------------------- /deploy-own-app/cd-pipeline/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: ownappdevenv 3 | identifier: ownappdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/k8s-environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenvdep 3 | identifier: harnessdevenvdep 4 | tags: {} 5 | type: PreProduction 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | variables: [] 9 | -------------------------------------------------------------------------------- /serverless-lambda/frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import DemoApp from './DemoApp' 4 | import './index.css' 5 | 6 | window.demoapp = {} 7 | 8 | ReactDOM.render(, document.getElementById('root')) 9 | -------------------------------------------------------------------------------- /vm-aws/ssh/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] 10 | -------------------------------------------------------------------------------- /vm-aws/winrm/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] 10 | -------------------------------------------------------------------------------- /vm-azure/ssh/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] 10 | -------------------------------------------------------------------------------- /vm-azure/winrm/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] 10 | -------------------------------------------------------------------------------- /google-cloud-run/harness-cd-pipeline/environment.yaml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: gcr_test 3 | identifier: gcr_test 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: lbtest 9 | variables: [] 10 | -------------------------------------------------------------------------------- /helm-native-canary-blue-green/harnesscd-pipeline/environment.yaml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: helm_native_env 3 | identifier: helm_native_env 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: CD_Samples 9 | -------------------------------------------------------------------------------- /workshop-guestbook/guestbook-ui-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: guestbook-ui 5 | namespace: guestbook 6 | spec: 7 | ports: 8 | - port: 80 9 | targetPort: 80 10 | selector: 11 | app: guestbook-ui 12 | -------------------------------------------------------------------------------- /google_cloud_function/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] 10 | -------------------------------------------------------------------------------- /serverless-lambda/harnesscd-pipeline/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: serverless-env 3 | identifier: serverlessenv 4 | description: "" 5 | tags: {} 6 | type: Production 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] 10 | -------------------------------------------------------------------------------- /guestbook/harnesscd-pipeline/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] 10 | 11 | -------------------------------------------------------------------------------- /kustomize-guestbook/harnesscd-pipeline/environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] 10 | -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/nativehelm-environment.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | name: harnessdevenv 3 | identifier: harnessdevenv 4 | description: "" 5 | tags: {} 6 | type: PreProduction 7 | orgIdentifier: default 8 | projectIdentifier: default_project 9 | variables: [] 10 | -------------------------------------------------------------------------------- /sock-shop/base/orders-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: orders 6 | labels: 7 | name: orders 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 80 12 | targetPort: 80 13 | selector: 14 | name: orders 15 | -------------------------------------------------------------------------------- /sock-shop/base/user-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: user 6 | labels: 7 | name: user 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 80 12 | targetPort: 80 13 | selector: 14 | name: user 15 | 16 | -------------------------------------------------------------------------------- /helm-dependency/values-nomaria.yaml: -------------------------------------------------------------------------------- 1 | mariadb: 2 | enabled: false 3 | 4 | wordpress: 5 | wordpressPassword: foo 6 | mariadb: 7 | enabled: false 8 | externalDatabase: 9 | host: localhost 10 | user: bn_wordpress 11 | password: "" 12 | database: bitnami_wordpress 13 | port: 3306 -------------------------------------------------------------------------------- /sock-shop/base/payment-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: payment 6 | labels: 7 | name: payment 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 80 12 | targetPort: 80 13 | selector: 14 | name: payment 15 | -------------------------------------------------------------------------------- /sock-shop/base/catalogue-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: catalogue 6 | labels: 7 | name: catalogue 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 80 12 | targetPort: 80 13 | selector: 14 | name: catalogue 15 | -------------------------------------------------------------------------------- /sock-shop/base/front-end-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: front-end 6 | labels: 7 | name: front-end 8 | spec: 9 | type: LoadBalancer 10 | ports: 11 | - port: 80 12 | targetPort: 8079 13 | nodePort: 30001 14 | selector: 15 | name: front-end 16 | -------------------------------------------------------------------------------- /plugins/README.md: -------------------------------------------------------------------------------- 1 | # Config Management Plugins Examples 2 | 3 | | Application | Description | 4 | |-------------|-------------| 5 | | [kasane](kasane/) | The guestbook application as a `kasane` package. | 6 | | [kustomized-helm](kustomized-helm/) | Application comprised of a `helm` chart and customized using `kustomize` | 7 | -------------------------------------------------------------------------------- /sock-shop/base/carts-db-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: carts-db 6 | labels: 7 | name: carts-db 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 27017 12 | targetPort: 27017 13 | selector: 14 | name: carts-db 15 | -------------------------------------------------------------------------------- /sock-shop/base/shipping-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: shipping 6 | labels: 7 | name: shipping 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 80 12 | targetPort: 80 13 | selector: 14 | name: shipping 15 | 16 | -------------------------------------------------------------------------------- /sock-shop/base/user-db-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: user-db 6 | labels: 7 | name: user-db 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 27017 12 | targetPort: 27017 13 | selector: 14 | name: user-db 15 | 16 | -------------------------------------------------------------------------------- /plugins/kustomized-helm/overlays/guestbook-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: release-name-helm-guestbook 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: helm-guestbook 10 | image: "gcr.io/heptio-images/ks-guestbook-demo:0.2" 11 | -------------------------------------------------------------------------------- /sock-shop/base/orders-db-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: orders-db 6 | labels: 7 | name: orders-db 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 27017 12 | targetPort: 27017 13 | selector: 14 | name: orders-db 15 | -------------------------------------------------------------------------------- /sock-shop/base/session-db-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: session-db 6 | labels: 7 | name: session-db 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 6379 12 | targetPort: 6379 13 | selector: 14 | name: session-db 15 | -------------------------------------------------------------------------------- /vm-pdc/ssh/pdc-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_pdc 3 | identifier: harness_pdc 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Pdc 8 | spec: 9 | hosts: 10 | - hostname: HOST_IP_OR_FQDN 11 | delegateSelectors: 12 | - DELEGATE_NAME -------------------------------------------------------------------------------- /sock-shop/base/catalogue-db-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: catalogue-db 6 | labels: 7 | name: catalogue-db 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 3306 12 | targetPort: 3306 13 | selector: 14 | name: catalogue-db 15 | -------------------------------------------------------------------------------- /vm-pdc/winrm/pdc-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_pdc 3 | identifier: harness_pdc 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Pdc 8 | spec: 9 | hosts: 10 | - hostname: HOST_IP_OR_FQDN:PORT 11 | delegateSelectors: 12 | - DELEGATE_NAME 13 | -------------------------------------------------------------------------------- /deploy-own-app/gitops/cluster.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: ownapp_cluster 3 | identifier: ownappcluster 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: cluster 7 | cluster: 8 | server: https://kubernetes.default.svc 9 | config: 10 | clusterConnectionType: IN_CLUSTER 11 | agentIdentifier: AGENT_NAME -------------------------------------------------------------------------------- /harness-platform/secrets/gcp-secret-manager-connector.yaml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: gcp_secret_manager 3 | identifier: gcp_secret_manager 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: GcpSecretManager 8 | spec: 9 | credentialsRef: gcp_secret_secret_key 10 | default: false 11 | -------------------------------------------------------------------------------- /podinfo/harness-gitops/cluster.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops_cluster 3 | identifier: gitopscluster 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: cluster 7 | cluster: 8 | server: https://kubernetes.default.svc 9 | config: 10 | clusterConnectionType: IN_CLUSTER 11 | agentIdentifier: AGENT_NAME -------------------------------------------------------------------------------- /guestbook/harness-gitops/cluster.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops_cluster 3 | identifier: gitopscluster 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: cluster 7 | cluster: 8 | server: https://kubernetes.default.svc 9 | config: 10 | clusterConnectionType: IN_CLUSTER 11 | agentIdentifier: AGENT_NAME -------------------------------------------------------------------------------- /helm-guestbook/harness-gitops/cluster.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops_cluster 3 | identifier: gitopscluster 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: cluster 7 | cluster: 8 | server: https://kubernetes.default.svc 9 | config: 10 | clusterConnectionType: IN_CLUSTER 11 | agentIdentifier: AGENT_NAME -------------------------------------------------------------------------------- /podinfo/configs/git-generator-files-discovery/cluster-config/engineering/dev/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "cluster" : { 3 | "owner" : "cluster-admin@company.com", 4 | "address" : "https://kubernetes.default.svc", 5 | "name" : "gitopscluster", 6 | "namespace" : "dev" 7 | }, 8 | "asset_id" : "12345678", 9 | "aws_account" : "654321" 10 | } 11 | -------------------------------------------------------------------------------- /podinfo/configs/git-generator-files-discovery/cluster-config/engineering/prod/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "cluster" : { 3 | "owner" : "cluster-admin@company.com", 4 | "address" : "https://kubernetes.default.svc", 5 | "name" : "gitopscluster", 6 | "namespace" : "prod" 7 | }, 8 | "asset_id" : "12345678", 9 | "aws_account" : "123456" 10 | } 11 | -------------------------------------------------------------------------------- /kustomize-guestbook/harness-gitops/cluster.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops_cluster 3 | identifier: gitopscluster 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: cluster 7 | cluster: 8 | server: https://kubernetes.default.svc 9 | config: 10 | clusterConnectionType: IN_CLUSTER 11 | agentIdentifier: AGENT_NAME -------------------------------------------------------------------------------- /deploy-own-app/cd-pipeline/kubernetes-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: ownapp_k8sconnector 3 | identifier: ownappk8sconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: K8sCluster 8 | spec: 9 | credential: 10 | type: InheritFromDelegate 11 | delegateSelectors: 12 | - DELEGATE_NAME -------------------------------------------------------------------------------- /google_cloud_function/gcp-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: gcpconnector 3 | identifier: gcpconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Gcp 8 | spec: 9 | credential: 10 | type: ManualConfig 11 | spec: 12 | secretKeyRef: gcpsecret 13 | executeOnDelegate: false 14 | -------------------------------------------------------------------------------- /vm-aws/ssh/artifactory-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_artifactrepo 3 | identifier: harness_artifactrepo 4 | orgIdentifier: default 5 | projectIdentifier: default_project 6 | type: Artifactory 7 | spec: 8 | artifactoryServerUrl: https://harness.jfrog.io/artifactory 9 | auth: 10 | type: Anonymous 11 | executeOnDelegate: false 12 | -------------------------------------------------------------------------------- /vm-aws/winrm/artifactory-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_artifactrepo 3 | identifier: harness_artifactrepo 4 | orgIdentifier: default 5 | projectIdentifier: default_project 6 | type: Artifactory 7 | spec: 8 | artifactoryServerUrl: https://harness.jfrog.io/artifactory 9 | auth: 10 | type: Anonymous 11 | executeOnDelegate: false 12 | -------------------------------------------------------------------------------- /vm-azure/ssh/artifactory-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_artifactrepo 3 | identifier: harness_artifactrepo 4 | orgIdentifier: default 5 | projectIdentifier: default_project 6 | type: Artifactory 7 | spec: 8 | artifactoryServerUrl: https://harness.jfrog.io/artifactory 9 | auth: 10 | type: Anonymous 11 | executeOnDelegate: false 12 | -------------------------------------------------------------------------------- /vm-pdc/ssh/artifactory-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_artifactrepo 3 | identifier: harness_artifactrepo 4 | orgIdentifier: default 5 | projectIdentifier: default_project 6 | type: Artifactory 7 | spec: 8 | artifactoryServerUrl: https://harness.jfrog.io/artifactory 9 | auth: 10 | type: Anonymous 11 | executeOnDelegate: false 12 | -------------------------------------------------------------------------------- /vm-pdc/winrm/artifactory-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_artifactrepo 3 | identifier: harness_artifactrepo 4 | orgIdentifier: default 5 | projectIdentifier: default_project 6 | type: Artifactory 7 | spec: 8 | artifactoryServerUrl: https://harness.jfrog.io/artifactory 9 | auth: 10 | type: Anonymous 11 | executeOnDelegate: false 12 | -------------------------------------------------------------------------------- /guestbook/harnesscd-pipeline/kubernetes-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_k8sconnector 3 | identifier: harnessk8sconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: K8sCluster 8 | spec: 9 | credential: 10 | type: InheritFromDelegate 11 | delegateSelectors: 12 | - DELEGATE_NAME 13 | -------------------------------------------------------------------------------- /vm-azure/winrm/artifactory-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_artifactrepo 3 | identifier: harness_artifactrepo 4 | orgIdentifier: default 5 | projectIdentifier: default_project 6 | type: Artifactory 7 | spec: 8 | artifactoryServerUrl: https://harness.jfrog.io/artifactory 9 | auth: 10 | type: Anonymous 11 | executeOnDelegate: false 12 | -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/kubernetes-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_k8sconnector 3 | identifier: harnessk8sconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: K8sCluster 8 | spec: 9 | credential: 10 | type: InheritFromDelegate 11 | delegateSelectors: 12 | - DELEGATE_NAME 13 | -------------------------------------------------------------------------------- /kustomize-guestbook/harnesscd-pipeline/kubernetes-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_k8sconnector 3 | identifier: harnessk8sconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: K8sCluster 8 | spec: 9 | credential: 10 | type: InheritFromDelegate 11 | delegateSelectors: 12 | - DELEGATE_NAME -------------------------------------------------------------------------------- /podinfo/apps/podinfo/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: podinfo 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: podinfo 9 | ports: 10 | - name: http 11 | port: 9898 12 | protocol: TCP 13 | targetPort: http 14 | - port: 9999 15 | targetPort: grpc 16 | protocol: TCP 17 | name: grpc 18 | -------------------------------------------------------------------------------- /podinfo/podinfo-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: podinfo 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: podinfo 9 | ports: 10 | - name: http 11 | port: 9898 12 | protocol: TCP 13 | targetPort: http 14 | - port: 9999 15 | targetPort: grpc 16 | protocol: TCP 17 | name: grpc 18 | 19 | -------------------------------------------------------------------------------- /helm-native-canary-blue-green/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ .Release.Name }} 5 | labels: 6 | app: {{ .Chart.Name }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.port }} 11 | targetPort: {{ .Values.service.port }} 12 | selector: 13 | app: {{ .Chart.Name }} 14 | -------------------------------------------------------------------------------- /sock-shop/base/queue-master-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: queue-master 6 | labels: 7 | name: queue-master 8 | annotations: 9 | prometheus.io/path: "/prometheus" 10 | spec: 11 | ports: 12 | # the port that this service should serve on 13 | - port: 80 14 | targetPort: 80 15 | selector: 16 | name: queue-master 17 | -------------------------------------------------------------------------------- /deploy-own-app/gitops/repository.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: ownapp_repo 3 | identifier: ownapprepo 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: repository 7 | repo: 8 | repo: https://github.com/microservices-demo/microservices-demo 9 | type: git 10 | connectionType: HTTPS_ANONYMOUS 11 | agentIdentifier: AGENT_NAME 12 | -------------------------------------------------------------------------------- /guestbook/harness-gitops/repository.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops_repo 3 | identifier: gitopsrepo 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: repository 7 | repo: 8 | repo: https://github.com/harness-community/harnesscd-example-apps 9 | type: git 10 | connectionType: HTTPS_ANONYMOUS 11 | agentIdentifier: AGENT_NAME -------------------------------------------------------------------------------- /helm-guestbook/harness-gitops/repository.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops_repo 3 | identifier: gitopsrepo 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: repository 7 | repo: 8 | repo: https://github.com/harness-community/harnesscd-example-apps 9 | type: git 10 | connectionType: HTTPS_ANONYMOUS 11 | agentIdentifier: AGENT_NAME -------------------------------------------------------------------------------- /podinfo/harness-gitops/repository.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops_repo 3 | identifier: gitopsrepo 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: repository 7 | repo: 8 | repo: https://github.com/harness-community/harnesscd-example-apps 9 | type: git 10 | connectionType: HTTPS_ANONYMOUS 11 | agentIdentifier: AGENT_NAME 12 | -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/dev/main.jsonnet: -------------------------------------------------------------------------------- 1 | local base = import "base.libsonnet"; 2 | // uncomment if you reference ksonnet-lib 3 | // local k = import "k.libsonnet"; 4 | 5 | base + { 6 | // Insert user-specified overrides here. For example if a component is named \"nginx-deployment\", you might have something like:\n") 7 | // "nginx-deployment"+: k.deployment.mixin.metadata.labels({foo: "bar"}) 8 | } 9 | -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/prod/main.jsonnet: -------------------------------------------------------------------------------- 1 | local base = import "base.libsonnet"; 2 | // uncomment if you reference ksonnet-lib 3 | // local k = import "k.libsonnet"; 4 | 5 | base + { 6 | // Insert user-specified overrides here. For example if a component is named \"nginx-deployment\", you might have something like:\n") 7 | // "nginx-deployment"+: k.deployment.mixin.metadata.labels({foo: "bar"}) 8 | } 9 | -------------------------------------------------------------------------------- /kustomize-guestbook/harness-gitops/repository.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops_repo 3 | identifier: gitopsrepo 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | type: repository 7 | repo: 8 | repo: https://github.com/harness-community/harnesscd-example-apps 9 | type: git 10 | connectionType: HTTPS_ANONYMOUS 11 | agentIdentifier: AGENT_NAME -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/default/main.jsonnet: -------------------------------------------------------------------------------- 1 | local base = import "base.libsonnet"; 2 | // uncomment if you reference ksonnet-lib 3 | // local k = import "k.libsonnet"; 4 | 5 | base + { 6 | // Insert user-specified overrides here. For example if a component is named \"nginx-deployment\", you might have something like:\n") 7 | // "nginx-deployment"+: k.deployment.mixin.metadata.labels({foo: "bar"}) 8 | } 9 | -------------------------------------------------------------------------------- /aws-lambda/harnesscd-pipeline/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: aws-infra 3 | identifier: awsinfra 4 | orgIdentifier: your_org_id 5 | projectIdentifier: your_project_id 6 | environmentRef: lambda_env 7 | deploymentType: AwsLambda 8 | type: AwsLambda 9 | spec: 10 | connectorRef: aws-connector 11 | region: AWS_REGION 12 | allowSimultaneousDeployments: false 13 | -------------------------------------------------------------------------------- /serverless-lambda/frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /serverless-lambda/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sfe-demo-leadcapture", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": {}, 7 | "author": "Serverless.com", 8 | "license": "MIT", 9 | "dependencies": { 10 | "js-yaml": "^3.13.0", 11 | "serverless-finch": "^2.3.2" 12 | }, 13 | "devDependencies": { 14 | "@serverless/enterprise-plugin": "latest" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sock-shop/base/rabbitmq-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: rabbitmq 6 | labels: 7 | name: rabbitmq 8 | spec: 9 | ports: 10 | # the port that this service should serve on 11 | - port: 5672 12 | name: rabbitmq 13 | targetPort: 5672 14 | - port: 9090 15 | name: exporter 16 | targetPort: exporter 17 | protocol: TCP 18 | selector: 19 | name: rabbitmq 20 | -------------------------------------------------------------------------------- /blue-green/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /google-cloud-run/harness-cd-pipeline/infrastructureDefinition.yaml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: gcr_test_infra 3 | identifier: gcr_test_infra 4 | orgIdentifier: default 5 | projectIdentifier: lbtest 6 | environmentRef: gcr_test 7 | deploymentType: GoogleCloudRun 8 | type: GoogleCloudRun 9 | spec: 10 | connectorRef: <+input> 11 | project: <+input> 12 | region: <+input> 13 | allowSimultaneousDeployments: false 14 | -------------------------------------------------------------------------------- /harness-platform/secrets/gcp-kms-connector.yaml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: gcp_kms_connector 3 | identifier: gcp_kms_connector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: GcpKms 8 | spec: 9 | projectId: 10 | region: CLOUD_REGION_NAME 11 | keyRing: 12 | keyName: 13 | credentials: gcp_kms_secret_key 14 | default: false 15 | -------------------------------------------------------------------------------- /pre-post-sync/post-sync-job.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: after 5 | annotations: 6 | harnesscd.harnessproj.io/hook: PostSync 7 | harnesscd.harnessproj.io/hook-delete-policy: HookSucceeded 8 | spec: 9 | template: 10 | spec: 11 | containers: 12 | - name: sleep 13 | image: alpine:latest 14 | command: ["sleep", "10"] 15 | restartPolicy: Never 16 | backoffLimit: 0 17 | -------------------------------------------------------------------------------- /pre-post-sync/pre-sync-job.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: before 5 | annotations: 6 | harnesscd.harnessproj.io/hook: PreSync 7 | harnesscd.harnessproj.io/hook-delete-policy: HookSucceeded 8 | spec: 9 | template: 10 | spec: 11 | containers: 12 | - name: sleep 13 | image: alpine:latest 14 | command: ["sleep", "10"] 15 | restartPolicy: Never 16 | backoffLimit: 0 17 | -------------------------------------------------------------------------------- /serverless-lambda/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /helm-guestbook/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /guestbook/harnesscd-pipeline/README.md: -------------------------------------------------------------------------------- 1 | ## Harness CD Pipeline 2 | 3 | Run the resource yaml's in the below order in order to create the required objects and pipeline and execute it successfully. 4 | 5 | 1. github-connector.yml 6 | 2. kubernetes-connector.yml 7 | 3. environment.yml 8 | 4. infrastructure-definition.yml 9 | 5. service.yml 10 | 6. canary-pipeline.yml 11 | OR 12 | bluegreen-pipeline.yml 13 | OR 14 | rolling-pipeline.yml 15 | -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/README.md: -------------------------------------------------------------------------------- 1 | ## Harness CD Pipeline 2 | 3 | Run the resource yaml's in the below order in order to create the required objects and pipeline and execute it successfully. 4 | 5 | 1. github-connector.yml 6 | 2. kubernetes-connector.yml 7 | 3. environment.yml 8 | 4. infrastructure-definition.yml 9 | 5. service.yml 10 | 6. canary-pipeline.yml 11 | OR 12 | bluegreen-pipeline.yml 13 | OR 14 | rolling-pipeline.yml -------------------------------------------------------------------------------- /kustomize-guestbook/harnesscd-pipeline/README.md: -------------------------------------------------------------------------------- 1 | ## Harness CD Pipeline 2 | 3 | Run the resource yaml's in the below order in order to create the required objects and pipeline and execute it successfully. 4 | 5 | 1. github-connector.yml 6 | 2. kubernetes-connector.yml 7 | 3. environment.yml 8 | 4. infrastructure-definition.yml 9 | 5. service.yml 10 | 6. canary-pipeline.yml 11 | OR 12 | bluegreen-pipeline.yml 13 | OR 14 | rolling-pipeline.yml -------------------------------------------------------------------------------- /custom-usecases/Multi-Tenant Architecture/config-files/tenant_ip_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tenant_1 4 | 127.0.0.1 5 | 8080 6 | 7 | 8 | tenant_2 9 | 192.168.0.1 10 | 8081 11 | 12 | 13 | tenant_3 14 | 10.0.0.1 15 | 8082 16 | 17 | -------------------------------------------------------------------------------- /harness-platform/triggers/custom-trigger.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | name: custom-trigger 3 | identifier: customtrigger 4 | enabled: true 5 | description: "" 6 | tags: {} 7 | stagesToExecute: [] 8 | orgIdentifier: ORGANIZATION_ID 9 | projectIdentifier: PROJECT_ID 10 | pipelineIdentifier: PIPELINE_ID 11 | source: 12 | type: Webhook 13 | spec: 14 | type: Custom 15 | spec: 16 | payloadConditions: [] 17 | headerConditions: [] 18 | -------------------------------------------------------------------------------- /serverless-lambda/frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 5 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 6 | sans-serif; 7 | -webkit-font-smoothing: antialiased; 8 | -moz-osx-font-smoothing: grayscale; 9 | } 10 | 11 | code { 12 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 13 | monospace; 14 | } 15 | -------------------------------------------------------------------------------- /harness-platform/secrets/aws-kms-connector.yaml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: aws-kms-connector 3 | identifier: aws_kms_connector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: AwsKms 8 | spec: 9 | credential: 10 | type: ManualConfig 11 | spec: 12 | accessKey: aws_kms_access_key 13 | secretKey: aws_kms_secret_key 14 | kmsArn: aws_kms_arn 15 | region: CLOUD_REGION_NAME 16 | default: false 17 | -------------------------------------------------------------------------------- /event-relay-triggers/trigger.yaml: -------------------------------------------------------------------------------- 1 | trigger: 2 | name: TRIGGER_NAME 3 | identifier: TRIGGER_ID 4 | enabled: true 5 | stagesToExecute: [] 6 | description: "" 7 | tags: {} 8 | orgIdentifier: default 9 | projectIdentifier: PROJECT_ID 10 | pipelineIdentifier: PIPELINE_ID 11 | source: 12 | type: Webhook 13 | spec: 14 | type: EventRelay 15 | spec: 16 | webhookIdentifier: WEBHOOK_ID 17 | payloadConditions: [] 18 | headerConditions: [] 19 | -------------------------------------------------------------------------------- /harness-platform/approval/jira-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: approval-demo 3 | identifier: approvaldemo 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | spec: 8 | jiraUrl: JIRA_URL 9 | username: EMAIL ID FOR JIRA 10 | passwordRef: jirapat 11 | delegateSelectors: 12 | - DELEGATE_NAME 13 | auth: 14 | type: UsernamePassword 15 | spec: 16 | username: EMAIL ID FOR JIRA 17 | passwordRef: jirapat 18 | -------------------------------------------------------------------------------- /cd-features/last-successful-artifact-tag/infrastructureDefinition.yaml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: k8s-demo-infra 3 | identifier: k8sdemoinfra 4 | orgIdentifier: default 5 | projectIdentifier: YOUR_PROJECT_IDENTIFIER 6 | environmentRef: k8sdemoenv 7 | deploymentType: Kubernetes 8 | type: KubernetesDirect 9 | spec: 10 | connectorRef: k8sdemo 11 | namespace: harness-delegate-ng 12 | releaseName: release-<+INFRA_KEY_SHORT_ID> 13 | allowSimultaneousDeployments: false 14 | -------------------------------------------------------------------------------- /google_cloud_function/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: gcpk8s 3 | identifier: gcpk8s 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: GoogleCloudFunctions 10 | type: GoogleCloudFunctions 11 | spec: 12 | connectorRef: gcpconnector 13 | project: CLOUD_PROJECT_NAME 14 | region: CLOUD_REGION_NAME 15 | allowSimultaneousDeployments: false 16 | -------------------------------------------------------------------------------- /guestbook/guestbook-ui-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: guestbook-ui 5 | spec: 6 | replicas: 3 7 | revisionHistoryLimit: 3 8 | selector: 9 | matchLabels: 10 | app: guestbook-ui 11 | template: 12 | metadata: 13 | labels: 14 | app: guestbook-ui 15 | spec: 16 | containers: 17 | - image: docker.io/corelab/ks-guestbook-demo:0.2 18 | name: guestbook-ui 19 | ports: 20 | - containerPort: 80 21 | -------------------------------------------------------------------------------- /azure-function-deployment/harness-cd-pipelines/infrastructureDefinition.yaml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: AzureFunction_infra 3 | identifier: rajAzureFunction 4 | orgIdentifier: Ng_Pipelines_K8s 5 | projectIdentifier: TestProject 6 | environmentRef: Azure 7 | deploymentType: AzureFunction 8 | type: AzureFunction 9 | spec: 10 | connectorRef: <+input> 11 | subscriptionId: <+input> 12 | resourceGroup: <+input> 13 | provisioner: <+input> 14 | allowSimultaneousDeployments: false 15 | -------------------------------------------------------------------------------- /helm-native-canary-blue-green/harnesscd-pipeline/infrastructureDefinition.yaml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: helm_native_infra 3 | identifier: hlem_native_infra 4 | orgIdentifier: default 5 | projectIdentifier: CD_Samples 6 | environmentRef: helm_native_env 7 | deploymentType: NativeHelm 8 | type: KubernetesDirect 9 | spec: 10 | connectorRef: faq_generator 11 | namespace: harness-delegate-ng 12 | releaseName: release-<+INFRA_KEY_SHORT_ID> 13 | allowSimultaneousDeployments: false 14 | -------------------------------------------------------------------------------- /serverless-lambda/harnesscd-pipeline/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: serverless-ec2 3 | identifier: serverlessec2 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: serverlessenv 9 | deploymentType: ServerlessAwsLambda 10 | type: ServerlessAwsLambda 11 | spec: 12 | connectorRef: awsconnector 13 | stage: prod 14 | region: CLOUD_REGION_NAME 15 | allowSimultaneousDeployments: false 16 | -------------------------------------------------------------------------------- /vm-pdc/ssh/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harness_remoteserver 3 | identifier: harness_remoteserver 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: Ssh 10 | type: Pdc 11 | spec: 12 | connectorRef: harness_pdc 13 | credentialsRef: harness_sshprivatekey 14 | hostFilter: 15 | type: All 16 | spec: {} 17 | allowSimultaneousDeployments: false -------------------------------------------------------------------------------- /apps/templates/sync-waves.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: harnessproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: sync-waves 5 | namespace: harnesscd 6 | finalizers: 7 | - resources-finalizer.harnesscd.harnessproj.io 8 | spec: 9 | destination: 10 | namespace: sync-waves 11 | server: {{ .Values.spec.destination.server }} 12 | project: default 13 | source: 14 | path: sync-waves 15 | repoURL: {{ .Values.spec.source.repoURL }} 16 | targetRevision: {{ .Values.spec.source.targetRevision }} 17 | -------------------------------------------------------------------------------- /google-cloud-run/harness-cd-pipeline/manifest.yaml: -------------------------------------------------------------------------------- 1 | # Following are the minimum set of parameters required to create a Google Cloud Run Service. 2 | # Please make sure your uploaded manifest file includes all of them. 3 | 4 | apiVersion: serving.knative.dev/v1 5 | kind: Service 6 | metadata: 7 | name: qademo3 8 | annotations: 9 | run.googleapis.com/minScale: '2' 10 | spec: 11 | template: 12 | spec: 13 | containers: 14 | - image: <+input> 15 | ports: 16 | - containerPort: 8080 -------------------------------------------------------------------------------- /guestbook/harnesscd-pipeline/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harness_k8sinfra 3 | identifier: harnessk8sinfra 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: Kubernetes 10 | type: KubernetesDirect 11 | spec: 12 | connectorRef: harnessk8sconnector 13 | namespace: default 14 | releaseName: release-<+INFRA_KEY> 15 | allowSimultaneousDeployments: false 16 | -------------------------------------------------------------------------------- /kustomize-guestbook/guestbook-ui-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: guestbook-ui 5 | spec: 6 | replicas: 3 7 | revisionHistoryLimit: 3 8 | selector: 9 | matchLabels: 10 | app: guestbook-ui 11 | template: 12 | metadata: 13 | labels: 14 | app: guestbook-ui 15 | spec: 16 | containers: 17 | - image: gcr.io/heptio-images/ks-guestbook-demo:0.1 18 | name: guestbook-ui 19 | ports: 20 | - containerPort: 80 21 | -------------------------------------------------------------------------------- /vm-pdc/winrm/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harness_remoteserver 3 | identifier: harness_remoteserver 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: WinRm 10 | type: Pdc 11 | spec: 12 | connectorRef: harness_pdc 13 | credentialsRef: harness_winrmpwd 14 | hostFilter: 15 | type: All 16 | spec: {} 17 | allowSimultaneousDeployments: false 18 | -------------------------------------------------------------------------------- /apps/templates/helm-hooks.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: harnessproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: helm-hooks 5 | namespace: harnesscd 6 | finalizers: 7 | - resources-finalizer.harnesscd.harnessproj.io 8 | spec: 9 | destination: 10 | namespace: helm-hooks 11 | server: {{ .Values.spec.destination.server }} 12 | project: default 13 | source: 14 | path: helm-hooks 15 | repoURL: {{ .Values.spec.source.repoURL }} 16 | targetRevision: {{ .Values.spec.source.targetRevision }} 17 | 18 | -------------------------------------------------------------------------------- /deploy-own-app/cd-pipeline/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: ownapp_k8sinfra 3 | identifier: ownappk8sinfra 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: ownappdevenv 9 | deploymentType: Kubernetes 10 | type: KubernetesDirect 11 | spec: 12 | connectorRef: ownappk8sconnector 13 | namespace: harness-delegate-ng 14 | releaseName: release-<+INFRA_KEY> 15 | allowSimultaneousDeployments: false -------------------------------------------------------------------------------- /kustomize-guestbook/harnesscd-pipeline/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harness_k8sinfra 3 | identifier: harnessk8sinfra 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: Kubernetes 10 | type: KubernetesDirect 11 | spec: 12 | connectorRef: harnessk8sconnector 13 | namespace: default 14 | releaseName: release-<+INFRA_KEY> 15 | allowSimultaneousDeployments: false -------------------------------------------------------------------------------- /custom-usecases/Multi-Tenant Architecture/config-files/master_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | tenant_1 5 | tenant_project_1.xml 6 | 7 | 8 | tenant_2 9 | tenant_project_2.xml 10 | 11 | 12 | tenant_3 13 | tenant_project_3.xml 14 | 15 | 16 | -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/k8s-infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harnessk8sinfradep 3 | identifier: harnessk8sinfradep 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenvdep 9 | deploymentType: Kubernetes 10 | type: KubernetesDirect 11 | spec: 12 | connectorRef: harnessk8sconnector 13 | namespace: default 14 | releaseName: r<+INFRA_KEY> 15 | allowSimultaneousDeployments: false 16 | -------------------------------------------------------------------------------- /apps/templates/helm-guestbook.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: harnessproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: helm-guestbook 5 | namespace: harnesscd 6 | finalizers: 7 | - resources-finalizer.harnesscd.harnessproj.io 8 | spec: 9 | destination: 10 | namespace: helm-guestbook 11 | server: {{ .Values.spec.destination.server }} 12 | project: default 13 | source: 14 | path: helm-guestbook 15 | repoURL: {{ .Values.spec.source.repoURL }} 16 | targetRevision: {{ .Values.spec.source.targetRevision }} 17 | -------------------------------------------------------------------------------- /harness-platform/secrets/aws-secret-manager-connector.yaml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: aws-secret-manager 3 | identifier: awssecretmanager 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: AwsSecretManager 8 | spec: 9 | credential: 10 | type: ManualConfig 11 | spec: 12 | accessKey: aws_secret_access_key 13 | secretKey: aws_secret_secret_key 14 | region: CLOUD_REGION_NAME 15 | secretNamePrefix: devops/aws-secret-manager 16 | default: false 17 | -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/nativehelm-infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harness_k8sinfra 3 | identifier: harnessk8sinfra 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: NativeHelm 10 | type: KubernetesDirect 11 | spec: 12 | connectorRef: harnessk8sconnector 13 | namespace: default 14 | releaseName: release-<+INFRA_KEY> 15 | allowSimultaneousDeployments: false 16 | -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/dev/params.libsonnet: -------------------------------------------------------------------------------- 1 | local params = std.extVar("__ksonnet/params"); 2 | local globals = import "globals.libsonnet"; 3 | local envParams = params + { 4 | components +: { 5 | // Insert component parameter overrides here. Ex: 6 | // guestbook +: { 7 | // name: "guestbook-dev", 8 | // replicas: params.global.replicas, 9 | // }, 10 | }, 11 | }; 12 | 13 | { 14 | components: { 15 | [x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components) 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/prod/params.libsonnet: -------------------------------------------------------------------------------- 1 | local params = std.extVar("__ksonnet/params"); 2 | local globals = import "globals.libsonnet"; 3 | local envParams = params + { 4 | components +: { 5 | // Insert component parameter overrides here. Ex: 6 | // guestbook +: { 7 | // name: "guestbook-dev", 8 | // replicas: params.global.replicas, 9 | // }, 10 | }, 11 | }; 12 | 13 | { 14 | components: { 15 | [x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components) 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /ksonnet-guestbook/environments/default/params.libsonnet: -------------------------------------------------------------------------------- 1 | local params = std.extVar("__ksonnet/params"); 2 | local globals = import "globals.libsonnet"; 3 | local envParams = params + { 4 | components +: { 5 | // Insert component parameter overrides here. Ex: 6 | // guestbook +: { 7 | // name: "guestbook-dev", 8 | // replicas: params.global.replicas, 9 | // }, 10 | }, 11 | }; 12 | 13 | { 14 | components: { 15 | [x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components) 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /workshop-guestbook/guestbook-ui-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: guestbook-ui 5 | namespace: guestbook 6 | spec: 7 | replicas: 3 8 | revisionHistoryLimit: 3 9 | selector: 10 | matchLabels: 11 | app: guestbook-ui 12 | template: 13 | metadata: 14 | labels: 15 | app: guestbook-ui 16 | spec: 17 | containers: 18 | - image: gcr.io/heptio-images/ks-guestbook-demo:0.1 19 | name: guestbook-ui 20 | ports: 21 | - containerPort: 80 22 | -------------------------------------------------------------------------------- /apps/templates/kustomize-guestbook.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: harnessproj.io/v1alpha1 2 | kind: Application 3 | metadata: 4 | name: kustomize-guestbook 5 | namespace: harnesscd 6 | finalizers: 7 | - resources-finalizer.harnesscd.harnessproj.io 8 | spec: 9 | destination: 10 | namespace: kustomize-guestbook 11 | server: {{ .Values.spec.destination.server }} 12 | project: default 13 | source: 14 | path: kustomize-guestbook 15 | repoURL: {{ .Values.spec.source.repoURL }} 16 | targetRevision: {{ .Values.spec.source.targetRevision }} 17 | -------------------------------------------------------------------------------- /vm-azure/ssh/azure-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_azureconnector 3 | identifier: harness_azureconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Azure 8 | spec: 9 | credential: 10 | type: ManualConfig 11 | spec: 12 | applicationId: APPLICATION_ID 13 | tenantId: TENANT_ID 14 | auth: 15 | type: Secret 16 | spec: 17 | secretRef: azuresecret 18 | azureEnvironmentType: AZURE 19 | executeOnDelegate: false 20 | -------------------------------------------------------------------------------- /vm-azure/winrm/azure-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_azureconnector 3 | identifier: harness_azureconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Azure 8 | spec: 9 | credential: 10 | type: ManualConfig 11 | spec: 12 | applicationId: APPLICATION_ID 13 | tenantId: TENANT_ID 14 | auth: 15 | type: Secret 16 | spec: 17 | secretRef: azuresecret 18 | azureEnvironmentType: AZURE 19 | executeOnDelegate: false 20 | -------------------------------------------------------------------------------- /vm-aws/ssh/aws-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_awsconnector 3 | identifier: harness_awsconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Aws 8 | spec: 9 | credential: 10 | type: ManualConfig 11 | spec: 12 | accessKey: AWS_ACCESS_KEY_ID 13 | secretKeyRef: awssecret 14 | awsSdkClientBackOffStrategyOverride: 15 | type: FixedDelayBackoffStrategy 16 | spec: 17 | fixedBackoff: 0 18 | retryCount: 0 19 | executeOnDelegate: false 20 | -------------------------------------------------------------------------------- /vm-aws/winrm/aws-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_awsconnector 3 | identifier: harness_awsconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Aws 8 | spec: 9 | credential: 10 | type: ManualConfig 11 | spec: 12 | accessKey: AWS_ACCESS_KEY_ID 13 | secretKeyRef: awssecret 14 | awsSdkClientBackOffStrategyOverride: 15 | type: FixedDelayBackoffStrategy 16 | spec: 17 | fixedBackoff: 0 18 | retryCount: 0 19 | executeOnDelegate: false 20 | -------------------------------------------------------------------------------- /ksonnet-guestbook/app.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 0.1.0 2 | environments: 3 | default: 4 | destination: 5 | namespace: default 6 | server: https://kubernetes.default.svc 7 | k8sVersion: v1.10.0 8 | path: default 9 | dev: 10 | destination: 11 | namespace: dev 12 | server: https://kubernetes.default.svc 13 | k8sVersion: v1.10.0 14 | path: dev 15 | prod: 16 | destination: 17 | namespace: prod 18 | server: https://kubernetes.default.svc 19 | k8sVersion: v1.10.0 20 | path: prod 21 | kind: ksonnet.io/app 22 | name: guestbook 23 | version: 0.0.1 24 | -------------------------------------------------------------------------------- /vm-aws/ssh/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harness_ssh 3 | identifier: harness_ssh 4 | tags: {} 5 | serviceDefinition: 6 | spec: 7 | artifacts: 8 | primary: 9 | primaryArtifactRef: <+input> 10 | sources: 11 | - spec: 12 | connectorRef: harness_artifactrepo 13 | artifactDirectory: / 14 | artifactPath: todolist.war 15 | repository: todolist-tutorial 16 | repositoryFormat: generic 17 | identifier: Todolist 18 | type: ArtifactoryRegistry 19 | type: Ssh 20 | -------------------------------------------------------------------------------- /vm-azure/ssh/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harness_ssh 3 | identifier: harness_ssh 4 | tags: {} 5 | serviceDefinition: 6 | spec: 7 | artifacts: 8 | primary: 9 | primaryArtifactRef: <+input> 10 | sources: 11 | - spec: 12 | connectorRef: harness_artifactrepo 13 | artifactDirectory: / 14 | artifactPath: todolist.war 15 | repository: todolist-tutorial 16 | repositoryFormat: generic 17 | identifier: Todolist 18 | type: ArtifactoryRegistry 19 | type: Ssh 20 | -------------------------------------------------------------------------------- /vm-pdc/ssh/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harness_ssh 3 | identifier: harness_ssh 4 | tags: {} 5 | serviceDefinition: 6 | spec: 7 | artifacts: 8 | primary: 9 | primaryArtifactRef: <+input> 10 | sources: 11 | - spec: 12 | connectorRef: harness_artifactrepo 13 | artifactDirectory: / 14 | artifactPath: todolist.war 15 | repository: todolist-tutorial 16 | repositoryFormat: generic 17 | identifier: Todolist 18 | type: ArtifactoryRegistry 19 | type: Ssh 20 | -------------------------------------------------------------------------------- /vm-aws/winrm/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harness_winrm 3 | identifier: harness_winrm 4 | tags: {} 5 | serviceDefinition: 6 | spec: 7 | artifacts: 8 | primary: 9 | primaryArtifactRef: <+input> 10 | sources: 11 | - spec: 12 | connectorRef: harness_artifactrepo 13 | artifactDirectory: / 14 | artifactPath: todolist.zip 15 | repository: todolist-tutorial 16 | repositoryFormat: generic 17 | identifier: Todolist 18 | type: ArtifactoryRegistry 19 | type: WinRm 20 | -------------------------------------------------------------------------------- /vm-pdc/winrm/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harness_winrm 3 | identifier: harness_winrm 4 | tags: {} 5 | serviceDefinition: 6 | spec: 7 | artifacts: 8 | primary: 9 | primaryArtifactRef: <+input> 10 | sources: 11 | - spec: 12 | connectorRef: harness_artifactrepo 13 | artifactDirectory: / 14 | artifactPath: todolist.zip 15 | repository: todolist-tutorial 16 | repositoryFormat: generic 17 | identifier: Todolist 18 | type: ArtifactoryRegistry 19 | type: WinRm 20 | -------------------------------------------------------------------------------- /helm-guestbook/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "helm-guestbook.fullname" . }} 5 | labels: 6 | app: {{ template "helm-guestbook.name" . }} 7 | chart: {{ template "helm-guestbook.chart" . }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | - port: {{ .Values.service.port }} 14 | targetPort: http 15 | protocol: TCP 16 | name: http 17 | selector: 18 | app: {{ template "helm-guestbook.name" . }} 19 | release: {{ .Release.Name }} 20 | -------------------------------------------------------------------------------- /serverless-lambda/frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^16.8.4", 7 | "react-dom": "^16.8.4", 8 | "react-scripts": "2.1.8" 9 | }, 10 | "scripts": { 11 | "start": "react-scripts start", 12 | "build": "react-scripts build", 13 | "test": "react-scripts test", 14 | "eject": "react-scripts eject" 15 | }, 16 | "eslintConfig": { 17 | "extends": "react-app" 18 | }, 19 | "browserslist": [ 20 | ">0.2%", 21 | "not dead", 22 | "not ie <= 11", 23 | "not op_mini all" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /vm-azure/winrm/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harness_winrm 3 | identifier: harness_winrm 4 | tags: {} 5 | serviceDefinition: 6 | spec: 7 | artifacts: 8 | primary: 9 | primaryArtifactRef: <+input> 10 | sources: 11 | - spec: 12 | connectorRef: harness_artifactrepo 13 | artifactDirectory: / 14 | artifactPath: todolist.zip 15 | repository: todolist-tutorial 16 | repositoryFormat: generic 17 | identifier: Todolist 18 | type: ArtifactoryRegistry 19 | type: WinRm 20 | -------------------------------------------------------------------------------- /serverless-lambda/backend/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Form Submit 3 | */ 4 | 5 | const submit = (event, context, callback) => { 6 | 7 | if (event['queryStringParameters'] && event['queryStringParameters']['error']) { 8 | let r = Math.random().toString(36).substring(7); 9 | throw new Error(`Random error ${r}`) 10 | } 11 | 12 | callback(null, { 13 | statusCode: 200, 14 | headers: { 15 | 'Access-Control-Allow-Origin': '*', 16 | 'Access-Control-Allow-Credentials': true, 17 | }, 18 | body: JSON.stringify({ message: 'form submission received' }), 19 | }) 20 | } 21 | 22 | module.exports = { submit } 23 | -------------------------------------------------------------------------------- /azure-function-deployment/harness-cd-pipelines/service.yaml: -------------------------------------------------------------------------------- 1 | service: 2 | name: AzureFunctionAll 3 | identifier: AzureFunctionAll 4 | orgIdentifier: Ng_Pipelines_K8s 5 | projectIdentifier: TestProject 6 | serviceDefinition: 7 | spec: 8 | artifacts: 9 | primary: 10 | sources: 11 | - spec: 12 | connectorRef: <+input> 13 | imagePath: <+input> 14 | tag: <+input> 15 | digest: "" 16 | identifier: azure_artifact_test 17 | type: DockerRegistry 18 | primaryArtifactRef: <+input> 19 | type: AzureFunction 20 | -------------------------------------------------------------------------------- /podinfo/harness-gitops/github-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: github-connector 3 | identifier: githubconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Github 8 | spec: 9 | url: https://github.com/GITHUB_USERNAME/harnesscd-example-apps 10 | authentication: 11 | type: Http 12 | spec: 13 | type: UsernameToken 14 | spec: 15 | username: GITHUB_USERNAME 16 | tokenRef: github_pat 17 | apiAccess: 18 | type: Token 19 | spec: 20 | tokenRef: github_pat 21 | executeOnDelegate: false 22 | type: Repo 23 | -------------------------------------------------------------------------------- /vm-aws/ssh/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harness_remoteinstance 3 | identifier: harness_remoteinstance 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: Ssh 10 | type: SshWinRmAws 11 | spec: 12 | credentialsRef: harness_sshprivatekey 13 | connectorRef: harness_awsconnector 14 | region: CLOUD_REGION_NAME 15 | awsInstanceFilter: 16 | tags: 17 | Name: INSTANCE_NAME 18 | vpcs: [] 19 | hostConnectionType: PublicIP 20 | allowSimultaneousDeployments: false 21 | -------------------------------------------------------------------------------- /vm-aws/winrm/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harness_remoteinstance 3 | identifier: harness_remoteinstance 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: WinRm 10 | type: SshWinRmAws 11 | spec: 12 | credentialsRef: harness_winrmpwd 13 | connectorRef: harness_awsconnector 14 | region: CLOUD_REGION_NAME 15 | awsInstanceFilter: 16 | tags: 17 | Name: INSTANCE_NAME 18 | vpcs: [] 19 | hostConnectionType: PublicIP 20 | allowSimultaneousDeployments: false 21 | -------------------------------------------------------------------------------- /apps/templates/namespaces.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: helm-guestbook 5 | annotations: 6 | harnesscd.harnessproj.io/sync-wave: "-1" 7 | --- 8 | apiVersion: v1 9 | kind: Namespace 10 | metadata: 11 | name: helm-hooks 12 | annotations: 13 | harnesscd.harnessproj.io/sync-wave: "-1" 14 | --- 15 | apiVersion: v1 16 | kind: Namespace 17 | metadata: 18 | name: kustomize-guestbook 19 | annotations: 20 | harnesscd.harnessproj.io/sync-wave: "-1" 21 | --- 22 | apiVersion: v1 23 | kind: Namespace 24 | metadata: 25 | name: sync-waves 26 | annotations: 27 | harnesscd.harnessproj.io/sync-wave: "-1" 28 | -------------------------------------------------------------------------------- /cloudformation/git-connector.yaml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_gitconnector 3 | identifier: harnessgitconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Github 8 | spec: 9 | url: https://github.com/GITHUB_USERNAME/harnesscd-example-apps 10 | authentication: 11 | type: Http 12 | spec: 13 | type: UsernameToken 14 | spec: 15 | username: GITHUB_USERNAME 16 | tokenRef: harness_gitpat 17 | apiAccess: 18 | type: Token 19 | spec: 20 | tokenRef: harness_gitpat 21 | executeOnDelegate: false 22 | type: Repo 23 | -------------------------------------------------------------------------------- /ksonnet-guestbook/components/params.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | global: { 3 | // User-defined global parameters; accessible to all component and environments, Ex: 4 | // replicas: 4, 5 | }, 6 | components: { 7 | // Component-level parameters, defined initially from 'ks prototype use ...' 8 | // Each object below should correspond to a component in the components/ directory 9 | "guestbook-ui": { 10 | containerPort: 80, 11 | image: "gcr.io/heptio-images/ks-guestbook-demo:0.1", 12 | name: "ks-guestbook-ui", 13 | replicas: 3, 14 | servicePort: 80, 15 | type: "LoadBalancer", 16 | }, 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /vm-azure/ssh/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harness_remoteinstance 3 | identifier: harness_remoteinstance 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: Ssh 10 | type: SshWinRmAzure 11 | spec: 12 | credentialsRef: harness_sshprivatekey 13 | connectorRef: harness_azureconnector 14 | subscriptionId: VM_SUBSCRIPTION_ID 15 | resourceGroup: VM_RESOURCE_GROUP 16 | tags: 17 | Name: INSTANCE_NAME 18 | hostConnectionType: PublicIP 19 | allowSimultaneousDeployments: false 20 | -------------------------------------------------------------------------------- /vm-azure/winrm/infrastructure-definition.yml: -------------------------------------------------------------------------------- 1 | infrastructureDefinition: 2 | name: harness_remoteinstance 3 | identifier: harness_remoteinstance 4 | description: "" 5 | tags: {} 6 | orgIdentifier: default 7 | projectIdentifier: default_project 8 | environmentRef: harnessdevenv 9 | deploymentType: WinRm 10 | type: SshWinRmAzure 11 | spec: 12 | credentialsRef: harness_winrmpwd 13 | connectorRef: harness_azureconnector 14 | subscriptionId: VM_SUBSCRIPTION_ID 15 | resourceGroup: VM_RESOURCE_GROUP 16 | tags: 17 | Name: INSTANCE_NAME 18 | hostConnectionType: PublicIP 19 | allowSimultaneousDeployments: false 20 | -------------------------------------------------------------------------------- /cloudformation/aws-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_awsconnector 3 | identifier: harnessawsconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Aws 8 | spec: 9 | credential: 10 | type: ManualConfig 11 | spec: 12 | accessKey: AWS_ACCESS_KEY 13 | secretKeyRef: awssecret 14 | region: CLOUD_REGION_NAME 15 | awsSdkClientBackOffStrategyOverride: 16 | type: FixedDelayBackoffStrategy 17 | spec: 18 | fixedBackoff: 0 19 | retryCount: 0 20 | delegateSelectors: 21 | - DELEGATE_NAME 22 | executeOnDelegate: true 23 | -------------------------------------------------------------------------------- /deploy-own-app/cd-pipeline/github-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: ownapp_gitconnector 3 | identifier: ownappgitconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Github 8 | spec: 9 | url: https://github.com/microservices-demo/microservices-demo 10 | authentication: 11 | type: Http 12 | spec: 13 | type: UsernameToken 14 | spec: 15 | username: GITHUB_USERNAME 16 | tokenRef: harness_gitpat 17 | apiAccess: 18 | type: Token 19 | spec: 20 | tokenRef: harness_gitpat 21 | executeOnDelegate: false 22 | type: Repo -------------------------------------------------------------------------------- /guestbook/harnesscd-pipeline/github-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_gitconnector 3 | identifier: harnessgitconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Github 8 | spec: 9 | url: https://github.com/GITHUB_USERNAME/harnesscd-example-apps 10 | authentication: 11 | type: Http 12 | spec: 13 | type: UsernameToken 14 | spec: 15 | username: GITHUB_USERNAME 16 | tokenRef: harness_gitpat 17 | apiAccess: 18 | type: Token 19 | spec: 20 | tokenRef: harness_gitpat 21 | executeOnDelegate: false 22 | type: Repo 23 | -------------------------------------------------------------------------------- /kustomize-guestbook/harnesscd-pipeline/github-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_gitconnector 3 | identifier: harnessgitconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Github 8 | spec: 9 | url: https://github.com/GITHUB_USERNAME/harnesscd-example-apps 10 | authentication: 11 | type: Http 12 | spec: 13 | type: UsernameToken 14 | spec: 15 | username: GITHUB_USERNAME 16 | tokenRef: harness_gitpat 17 | apiAccess: 18 | type: Token 19 | spec: 20 | tokenRef: harness_gitpat 21 | executeOnDelegate: false 22 | type: Repo -------------------------------------------------------------------------------- /harness-platform/secrets/hashicorp_vault_connector.yaml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: hashicorp_vault 3 | identifier: hashicorp_vault 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Vault 8 | spec: 9 | authToken: hashicorp_admin 10 | vaultUrl: 11 | renewalIntervalMinutes: 0 12 | secretEngineManuallyConfigured: false 13 | secretEngineName: secret 14 | secretEngineVersion: 2 15 | namespace: admin 16 | useVaultAgent: false 17 | useAwsIam: false 18 | useK8sAuth: false 19 | renewAppRoleToken: false 20 | default: false 21 | accessType: TOKEN 22 | readOnly: false 23 | -------------------------------------------------------------------------------- /google_cloud_function/github-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_gitconnector 3 | identifier: harnessgitconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Github 8 | spec: 9 | url: https://github.com/GITHUB_USERNAME/ 10 | validationRepo: harnesscd-example-apps 11 | authentication: 12 | type: Http 13 | spec: 14 | type: UsernameToken 15 | spec: 16 | username: GITHUB_USERNAME 17 | tokenRef: harness_gitpat 18 | apiAccess: 19 | type: Token 20 | spec: 21 | tokenRef: harness_gitpat 22 | executeOnDelegate: false 23 | type: Account 24 | -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/github-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: harness_gitconnector 3 | identifier: harnessgitconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Github 8 | spec: 9 | url: https://github.com/GITHUB_USERNAME/ 10 | validationRepo: harnesscd-example-apps 11 | authentication: 12 | type: Http 13 | spec: 14 | type: UsernameToken 15 | spec: 16 | username: GITHUB_USERNAME 17 | tokenRef: harness_gitpat 18 | apiAccess: 19 | type: Token 20 | spec: 21 | tokenRef: harness_gitpat 22 | executeOnDelegate: false 23 | type: Account 24 | -------------------------------------------------------------------------------- /serverless-lambda/harnesscd-pipeline/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: Serverless 3 | identifier: Serverless 4 | serviceDefinition: 5 | type: ServerlessAwsLambda 6 | spec: 7 | manifests: 8 | - manifest: 9 | identifier: serverless 10 | type: ServerlessAwsLambda 11 | spec: 12 | store: 13 | type: Github 14 | spec: 15 | connectorRef: serverlessgitconnector 16 | gitFetchType: Branch 17 | paths: 18 | - serverless-lambda/backend/ 19 | branch: master 20 | configOverridePath: "" 21 | gitOpsEnabled: false 22 | -------------------------------------------------------------------------------- /podinfo/harness-gitops/application.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops-application 3 | projectIdentifier: default_project 4 | orgIdentifier: default 5 | type: application 6 | application: 7 | metadata: 8 | clusterName: gitops_cluster 9 | labels: 10 | harness.io/serviceRef: "" 11 | harness.io/envRef: "" 12 | spec: 13 | source: 14 | repoURL: https://github.com/harness-community/harnesscd-example-apps 15 | path: podinfo 16 | targetRevision: master 17 | destination: 18 | server: https://kubernetes.default.svc 19 | namespace: default 20 | agentIdentifier: AGENT_NAME 21 | clusterIdentifier: gitopscluster 22 | repoIdentifier: gitopsrepo 23 | -------------------------------------------------------------------------------- /harness-platform/triggers/gitlab-trigger.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | name: gitlab-trigger 3 | identifier: gitlabtrigger 4 | enabled: true 5 | description: "" 6 | tags: {} 7 | orgIdentifier: ORGANIZATION_ID 8 | stagesToExecute: [] 9 | projectIdentifier: PROJECT_ID 10 | pipelineIdentifier: PIPELINE_ID 11 | source: 12 | type: Webhook 13 | spec: 14 | type: Gitlab 15 | spec: 16 | type: Push 17 | spec: 18 | connectorRef: GITLAB_CONNECTOR 19 | autoAbortPreviousExecutions: false 20 | payloadConditions: 21 | - key: targetBranch 22 | operator: Equals 23 | value: main 24 | headerConditions: [] 25 | actions: [] 26 | -------------------------------------------------------------------------------- /serverless-lambda/harnesscd-pipeline/aws-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: aws-connector 3 | identifier: awsconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Aws 8 | spec: 9 | credential: 10 | crossAccountAccess: 11 | crossAccountRoleArn: ROLE_ARN 12 | type: ManualConfig 13 | spec: 14 | accessKey: AWS_ACCESS_KEY 15 | secretKeyRef: awssecret 16 | region: CLOUD_REGION_NAME 17 | awsSdkClientBackOffStrategyOverride: 18 | type: FixedDelayBackoffStrategy 19 | spec: 20 | fixedBackoff: 1 21 | retryCount: 2 22 | delegateSelectors: 23 | - DELEGATE_NAME 24 | executeOnDelegate: true -------------------------------------------------------------------------------- /guestbook/harness-gitops/application.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops-application 3 | projectIdentifier: default_project 4 | orgIdentifier: default 5 | type: application 6 | application: 7 | metadata: 8 | clusterName: gitops_cluster 9 | labels: 10 | harness.io/serviceRef: harnessguestbook 11 | harness.io/envRef: harnessdevenv 12 | spec: 13 | source: 14 | repoURL: https://github.com/harness-community/harnesscd-example-apps 15 | path: guestbook 16 | targetRevision: master 17 | destination: 18 | server: https://kubernetes.default.svc 19 | namespace: default 20 | agentIdentifier: AGENT_NAME 21 | clusterIdentifier: gitopscluster 22 | repoIdentifier: gitopsrepo 23 | -------------------------------------------------------------------------------- /kustomize-guestbook/harnesscd-pipeline/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harnessguestbook 3 | identifier: harnessguestbook 4 | serviceDefinition: 5 | type: Kubernetes 6 | spec: 7 | manifests: 8 | - manifest: 9 | identifier: guestbook 10 | type: Kustomize 11 | spec: 12 | store: 13 | type: Github 14 | spec: 15 | connectorRef: harnessgitconnector 16 | gitFetchType: Branch 17 | folderPath: kustomize-guestbook 18 | branch: master 19 | pluginPath: "" 20 | skipResourceVersioning: false 21 | enableDeclarativeRollback: false 22 | gitOpsEnabled: false -------------------------------------------------------------------------------- /harness-platform/triggers/github-trigger.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | name: git-trigger 3 | identifier: gittrigger 4 | enabled: true 5 | encryptedWebhookSecretIdentifier: "" 6 | description: "" 7 | tags: {} 8 | orgIdentifier: ORGANIZATION_ID 9 | stagesToExecute: [] 10 | projectIdentifier: PROJECT_ID 11 | pipelineIdentifier: PIPELINE_ID 12 | source: 13 | type: Webhook 14 | spec: 15 | type: Github 16 | spec: 17 | type: Push 18 | spec: 19 | connectorRef: GITHUB_CONNECTOR 20 | autoAbortPreviousExecutions: false 21 | payloadConditions: 22 | - key: targetBranch 23 | operator: Equals 24 | value: master 25 | headerConditions: [] 26 | actions: [] 27 | -------------------------------------------------------------------------------- /deploy-own-app/gitops/application.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: ownapp-application 3 | projectIdentifier: default_project 4 | orgIdentifier: default 5 | type: application 6 | application: 7 | metadata: 8 | namespace: default 9 | clusterName: ownapp_cluster 10 | labels: 11 | harness.io/serviceRef: harnesssockshop 12 | harness.io/envRef: harnessdevenv 13 | spec: 14 | source: 15 | repoURL: https://github.com/microservices-demo/microservices-demo 16 | path: deploy/kubernetes 17 | targetRevision: master 18 | destination: 19 | server: https://kubernetes.default.svc 20 | namespace: default 21 | agentIdentifier: AGENT_NAME 22 | clusterIdentifier: ownappcluster 23 | repoIdentifier: ownapprepo 24 | -------------------------------------------------------------------------------- /sock-shop/base/catalogue-db-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: catalogue-db 6 | labels: 7 | name: catalogue-db 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: catalogue-db 13 | template: 14 | metadata: 15 | labels: 16 | name: catalogue-db 17 | spec: 18 | containers: 19 | - name: catalogue-db 20 | image: weaveworksdemos/catalogue-db:0.3.0 21 | env: 22 | - name: MYSQL_ROOT_PASSWORD 23 | value: fake_password 24 | - name: MYSQL_DATABASE 25 | value: socksdb 26 | ports: 27 | - name: mysql 28 | containerPort: 3306 29 | nodeSelector: 30 | beta.kubernetes.io/os: linux 31 | -------------------------------------------------------------------------------- /helm-guestbook/harness-gitops/application.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops-helm-application 3 | projectIdentifier: default_project 4 | orgIdentifier: default 5 | type: application 6 | application: 7 | metadata: 8 | namespace: default 9 | clusterName: gitops_cluster 10 | labels: 11 | harness.io/serviceRef: harnessguestbook 12 | harness.io/envRef: harnessdevenv 13 | spec: 14 | source: 15 | repoURL: https://github.com/harness-community/harnesscd-example-apps 16 | path: helm-guestbook 17 | targetRevision: master 18 | destination: 19 | server: https://kubernetes.default.svc 20 | namespace: default 21 | agentIdentifier: AGENT_NAME 22 | clusterIdentifier: gitopscluster 23 | repoIdentifier: gitopsrepo -------------------------------------------------------------------------------- /kustomize-guestbook/harness-gitops/application.yml: -------------------------------------------------------------------------------- 1 | gitops: 2 | name: gitops-kustomize-application 3 | projectIdentifier: default_project 4 | orgIdentifier: default 5 | type: application 6 | application: 7 | metadata: 8 | namespace: default 9 | clusterName: gitops_cluster 10 | labels: 11 | harness.io/serviceRef: harnessguestbook 12 | harness.io/envRef: harnessdevenv 13 | spec: 14 | source: 15 | repoURL: https://github.com/harness-community/harnesscd-example-apps 16 | path: kustomize-guestbook 17 | targetRevision: master 18 | destination: 19 | server: https://kubernetes.default.svc 20 | namespace: default 21 | agentIdentifier: AGENT_NAME 22 | clusterIdentifier: gitopscluster 23 | repoIdentifier: gitopsrepo -------------------------------------------------------------------------------- /aws-lambda/harnesscd-pipeline/aws-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: aws-connector 3 | identifier: aws-connector 4 | description: "" 5 | accountIdentifier: your_account_id 6 | orgIdentifier: your_org_id 7 | projectIdentifier: your_project_id 8 | type: Aws 9 | spec: 10 | credential: 11 | type: ManualConfig 12 | spec: 13 | accessKey: your_aws_account_access_key 14 | secretKeyRef: your_aws_account_secret_key 15 | sessionTokenRef: your_aws_account_session_token 16 | region: AWS_REGION 17 | awsSdkClientBackOffStrategyOverride: 18 | type: EqualJitterBackoffStrategy 19 | spec: 20 | baseDelay: 1 21 | maxBackoffTime: 1 22 | retryCount: 1 23 | executeOnDelegate: false 24 | proxy: false 25 | ignoreTestConnection: false -------------------------------------------------------------------------------- /serverless-lambda/harnesscd-pipeline/github-connector.yml: -------------------------------------------------------------------------------- 1 | connector: 2 | name: serverless-git-connector 3 | identifier: serverlessgitconnector 4 | description: "" 5 | orgIdentifier: default 6 | projectIdentifier: default_project 7 | type: Github 8 | spec: 9 | url: https://github.com/harness-community/harnesscd-example-apps 10 | validationRepo: https://github.com/harness-community/harnesscd-example-apps 11 | authentication: 12 | type: Http 13 | spec: 14 | type: UsernameToken 15 | spec: 16 | username: GITHUB_USERNAME 17 | tokenRef: harness_gitpat 18 | apiAccess: 19 | type: Token 20 | spec: 21 | tokenRef: harness_gitpat 22 | delegateSelectors: 23 | - DELEGATE_NAME 24 | executeOnDelegate: true 25 | type: Repo 26 | -------------------------------------------------------------------------------- /sock-shop/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - base/carts-db-dep.yaml 3 | - base/carts-db-svc.yaml 4 | - base/carts-dep.yaml 5 | - base/catalogue-db-dep.yaml 6 | - base/catalogue-db-svc.yaml 7 | - base/catalogue-dep.yaml 8 | - base/catalogue-svc.yaml 9 | - base/front-end-dep.yaml 10 | - base/front-end-svc.yaml 11 | - base/orders-db-dep.yaml 12 | - base/orders-db-svc.yaml 13 | - base/orders-dep.yaml 14 | - base/orders-svc.yaml 15 | - base/payment-dep.yaml 16 | - base/payment-svc.yaml 17 | - base/queue-master-dep.yaml 18 | - base/queue-master-svc.yaml 19 | - base/rabbitmq-dep.yaml 20 | - base/rabbitmq-svc.yaml 21 | - base/session-db-dep.yaml 22 | - base/session-db-svc.yaml 23 | - base/shipping-dep.yaml 24 | - base/shipping-svc.yaml 25 | - base/user-db-dep.yaml 26 | - base/user-db-svc.yaml 27 | - base/user-dep.yaml 28 | - base/user-svc.yaml -------------------------------------------------------------------------------- /helm-native-canary-blue-green/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.ingress.enabled }} 2 | apiVersion: networking.k8s.io/v1 3 | kind: Ingress 4 | metadata: 5 | name: {{ .Release.Name }} 6 | annotations: 7 | {{- range $key, $value := .Values.ingress.annotations }} 8 | {{ $key }}: {{ $value | quote }} 9 | {{- end }} 10 | spec: 11 | rules: 12 | {{- range .Values.ingress.hosts }} 13 | - host: {{ .host | lower }} # Ensure 'lower' function is used for RFC 1123 compliance 14 | http: 15 | paths: 16 | {{- range .paths }} 17 | - path: {{ .path }} 18 | pathType: {{ .pathType }} 19 | backend: 20 | service: 21 | name: {{ $.Release.Name }} 22 | port: 23 | number: {{ $.Values.service.port }} 24 | {{- end }} 25 | {{- end }} 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /sock-shop/base/session-db-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: session-db 6 | labels: 7 | name: session-db 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: session-db 13 | template: 14 | metadata: 15 | labels: 16 | name: session-db 17 | annotations: 18 | prometheus.io.scrape: "false" 19 | spec: 20 | containers: 21 | - name: session-db 22 | image: redis:alpine 23 | ports: 24 | - name: redis 25 | containerPort: 6379 26 | securityContext: 27 | capabilities: 28 | drop: 29 | - all 30 | add: 31 | - CHOWN 32 | - SETGID 33 | - SETUID 34 | readOnlyRootFilesystem: true 35 | nodeSelector: 36 | beta.kubernetes.io/os: linux 37 | -------------------------------------------------------------------------------- /serverless-lambda/backend/serverless.yml: -------------------------------------------------------------------------------- 1 | tenant: ac360 # Enter your tenant name here 2 | app: enterprise # Enter your application name here 3 | service: demo-email-form 4 | 5 | frameworkVersion: '>=1.38.0 <2.0.0' 6 | 7 | provider: 8 | name: aws 9 | runtime: nodejs10.x 10 | # credentials: ${secrets:aws-enterprise} # Enter an AWS Secret like this, after you create it in the Dashboard. 11 | 12 | functions: 13 | formSubmit: 14 | handler: index.submit 15 | events: 16 | - http: 17 | path: submit 18 | method: post 19 | cors: true 20 | 21 | plugins: 22 | # - serverless-finch # If you want to deploy the front-end uncomment this and the "custom" object below 23 | 24 | # custom: 25 | # client: 26 | # bucketName: sfe-demo-email-form # If you want to deploy the front-end, change this to a universally unique AWS S3 bucket name 27 | # distributionFolder: ../frontend/build 28 | -------------------------------------------------------------------------------- /helm-native-canary-blue-green/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ .Release.Name }} 5 | labels: 6 | app: {{ .Chart.Name }} 7 | spec: 8 | replicas: {{ .Values.replicaCount }} 9 | selector: 10 | matchLabels: 11 | app: {{ .Chart.Name }} 12 | template: 13 | metadata: 14 | labels: 15 | app: {{ .Chart.Name }} 16 | spec: 17 | containers: 18 | - name: {{ .Chart.Name }} 19 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 20 | imagePullPolicy: {{ .Values.image.pullPolicy }} 21 | ports: 22 | - containerPort: {{ .Values.service.port }} 23 | env: 24 | {{- range .Values.env }} 25 | - name: "{{ .name }}" 26 | value: "{{ .value }}" 27 | {{- end }} 28 | resources: 29 | {{- toYaml .Values.resources | nindent 12 }} -------------------------------------------------------------------------------- /helm-native-canary-blue-green/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 1 2 | 3 | image: 4 | repository: krishi0408/python-helm-native-canary-blue 5 | tag: <+pipeline.variables.imageTag> 6 | pullPolicy: Always 7 | 8 | service: 9 | type: ClusterIP 10 | port: 80 11 | 12 | ingress: 13 | enabled: true 14 | annotations: 15 | nginx.ingress.kubernetes.io/rewrite-target: "/" 16 | nginx.ingress.kubernetes.io/ssl-redirect: "true" # Redirect HTTP to HTTPS 17 | hosts: 18 | - host: dev.helm-native-canary-python-bg.example.com 19 | paths: 20 | - path: / 21 | pathType: ImplementationSpecific 22 | 23 | resources: 24 | requests: 25 | memory: "128Mi" 26 | cpu: "0.25" 27 | limits: 28 | memory: "256Mi" 29 | cpu: "0.5" 30 | 31 | env: 32 | - name: NODE_ENV 33 | value: development 34 | - name: API_BASE_URL 35 | value: "https://dev.api.helm-native-canary-python-bg.example.com" 36 | 37 | logging: 38 | level: DEBUG -------------------------------------------------------------------------------- /google-cloud-run/harness-cd-pipeline/service.yaml: -------------------------------------------------------------------------------- 1 | service: 2 | name: service_gcr 3 | identifier: service_gcr 4 | serviceDefinition: 5 | type: GoogleCloudRun 6 | spec: 7 | manifests: 8 | - manifest: 9 | identifier: gcr_sample 10 | type: GoogleCloudRunService 11 | spec: 12 | store: 13 | type: Harness 14 | spec: 15 | files: 16 | - /manifest.yml 17 | artifacts: 18 | primary: 19 | primaryArtifactRef: <+input> 20 | sources: 21 | - spec: 22 | connectorRef: Docker_gcr_test 23 | imagePath: krishi0408/python-helm-native-canary-blue 24 | tag: <+input> 25 | digest: "" 26 | identifier: artifact_gcr 27 | type: DockerRegistry 28 | gitOpsEnabled: false 29 | orgIdentifier: default 30 | projectIdentifier: lbtest 31 | -------------------------------------------------------------------------------- /podinfo/configs/git-generator-files-discovery/git-generator-files.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: ApplicationSet 3 | metadata: 4 | name: podinfo 5 | spec: 6 | generators: 7 | - git: 8 | repoURL: https://github.com/GITHUB_USERNAME/harnesscd-example-apps.git 9 | revision: HEAD 10 | files: 11 | - path: "podinfo/configs/git-generator-files-discovery/cluster-config/**/config.json" 12 | template: 13 | metadata: 14 | name: '{{cluster.namespace}}-podinfo' 15 | spec: 16 | project: YOUR_ARGO_PROJECT_ID 17 | source: 18 | repoURL: https://github.com/GITHUB_USERNAME/harnesscd-example-apps.git 19 | targetRevision: HEAD 20 | path: "podinfo/apps/podinfo" 21 | destination: 22 | server: '{{cluster.address}}' 23 | namespace: '{{cluster.namespace}}' 24 | syncPolicy: 25 | syncOptions: 26 | - CreateNamespace=true 27 | -------------------------------------------------------------------------------- /deploy-own-app/cd-pipeline/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: ownappservice 3 | identifier: ownappservice 4 | serviceDefinition: 5 | type: Kubernetes 6 | spec: 7 | manifests: 8 | - manifest: 9 | identifier: ownapp 10 | type: K8sManifest 11 | spec: 12 | store: 13 | type: Github 14 | spec: 15 | connectorRef: ownappgitconnector 16 | gitFetchType: Branch 17 | paths: 18 | - guestbook/guestbook-ui-deployment.yaml 19 | - guestbook/guestbook-ui-svc.yaml 20 | repoName: harnesscd-example-apps 21 | branch: master 22 | skipResourceVersioning: false 23 | enableDeclarativeRollback: false -------------------------------------------------------------------------------- /helm-native-canary-blue-green/harnesscd-pipeline/helm_service_native.yaml: -------------------------------------------------------------------------------- 1 | service: 2 | name: helm_service_native 3 | identifier: helm_service_native 4 | serviceDefinition: 5 | type: NativeHelm 6 | spec: 7 | manifests: 8 | - manifest: 9 | identifier: helm_deploy 10 | type: HelmChart 11 | spec: 12 | store: 13 | type: HarnessCode 14 | spec: 15 | gitFetchType: Branch 16 | folderPath: / 17 | repoName: Deploy-helm-bg-canary 18 | branch: main 19 | subChartPath: "" 20 | valuesPaths: 21 | - /values.yaml 22 | skipResourceVersioning: false 23 | enableDeclarativeRollback: false 24 | helmVersion: V3 25 | fetchHelmChartMetadata: false 26 | gitOpsEnabled: false 27 | orgIdentifier: default 28 | projectIdentifier: CD_Samples 29 | -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/k8s-service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harnessguestbookdep 3 | identifier: harnessguestbookdep 4 | orgIdentifier: default 5 | projectIdentifier: default_project 6 | serviceDefinition: 7 | type: Kubernetes 8 | spec: 9 | manifests: 10 | - manifest: 11 | identifier: guestbook 12 | type: HelmChart 13 | spec: 14 | store: 15 | type: Github 16 | spec: 17 | connectorRef: harnessgitconnector 18 | gitFetchType: Branch 19 | folderPath: /helm-guestbook 20 | repoName: harnesscd-example-apps 21 | branch: master 22 | subChartPath: "" 23 | valuesPaths: 24 | - helm-guestbook/values.yaml 25 | skipResourceVersioning: false 26 | enableDeclarativeRollback: false 27 | helmVersion: V3 28 | gitOpsEnabled: false 29 | -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/nativehelm-service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harness_guestbook 3 | identifier: harnessguestbook 4 | orgIdentifier: default 5 | projectIdentifier: default_project 6 | serviceDefinition: 7 | type: NativeHelm 8 | spec: 9 | manifests: 10 | - manifest: 11 | identifier: guestbook 12 | type: HelmChart 13 | spec: 14 | store: 15 | type: Github 16 | spec: 17 | connectorRef: harnessgitconnector 18 | gitFetchType: Branch 19 | folderPath: helm-guestbook 20 | repoName: harnesscd-example-apps 21 | branch: master 22 | subChartPath: "" 23 | valuesPaths: 24 | - helm-guestbook/values.yaml 25 | skipResourceVersioning: false 26 | enableDeclarativeRollback: false 27 | helmVersion: V3 28 | gitOpsEnabled: false 29 | -------------------------------------------------------------------------------- /sock-shop/base/carts-db-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: carts-db 6 | labels: 7 | name: carts-db 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: carts-db 13 | template: 14 | metadata: 15 | labels: 16 | name: carts-db 17 | spec: 18 | containers: 19 | - name: carts-db 20 | image: mongo 21 | ports: 22 | - name: mongo 23 | containerPort: 27017 24 | securityContext: 25 | capabilities: 26 | drop: 27 | - all 28 | add: 29 | - CHOWN 30 | - SETGID 31 | - SETUID 32 | readOnlyRootFilesystem: true 33 | volumeMounts: 34 | - mountPath: /tmp 35 | name: tmp-volume 36 | volumes: 37 | - name: tmp-volume 38 | emptyDir: 39 | medium: Memory 40 | nodeSelector: 41 | beta.kubernetes.io/os: linux 42 | -------------------------------------------------------------------------------- /sock-shop/base/orders-db-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: orders-db 6 | labels: 7 | name: orders-db 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: orders-db 13 | template: 14 | metadata: 15 | labels: 16 | name: orders-db 17 | spec: 18 | containers: 19 | - name: orders-db 20 | image: mongo 21 | ports: 22 | - name: mongo 23 | containerPort: 27017 24 | securityContext: 25 | capabilities: 26 | drop: 27 | - all 28 | add: 29 | - CHOWN 30 | - SETGID 31 | - SETUID 32 | readOnlyRootFilesystem: true 33 | volumeMounts: 34 | - mountPath: /tmp 35 | name: tmp-volume 36 | volumes: 37 | - name: tmp-volume 38 | emptyDir: 39 | medium: Memory 40 | nodeSelector: 41 | beta.kubernetes.io/os: linux 42 | -------------------------------------------------------------------------------- /sock-shop/base/user-db-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: user-db 6 | labels: 7 | name: user-db 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: user-db 13 | template: 14 | metadata: 15 | labels: 16 | name: user-db 17 | spec: 18 | containers: 19 | - name: user-db 20 | image: weaveworksdemos/user-db:0.3.0 21 | 22 | ports: 23 | - name: mongo 24 | containerPort: 27017 25 | securityContext: 26 | capabilities: 27 | drop: 28 | - all 29 | add: 30 | - CHOWN 31 | - SETGID 32 | - SETUID 33 | readOnlyRootFilesystem: true 34 | volumeMounts: 35 | - mountPath: /tmp 36 | name: tmp-volume 37 | volumes: 38 | - name: tmp-volume 39 | emptyDir: 40 | medium: Memory 41 | nodeSelector: 42 | beta.kubernetes.io/os: linux -------------------------------------------------------------------------------- /aws-lambda/harnesscd-pipeline/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: lambda-function 3 | identifier: lambdafunction 4 | serviceDefinition: 5 | type: AwsLambda 6 | spec: 7 | manifests: 8 | - manifest: 9 | identifier: lambdasample 10 | type: AwsLambdaFunctionDefinition 11 | spec: 12 | store: 13 | type: Harness 14 | spec: 15 | files: 16 | - /lambdaFunctions/lambda_func_hello_world 17 | artifacts: 18 | primary: 19 | primaryArtifactRef: <+input> 20 | sources: 21 | - spec: 22 | connectorRef: your-aws-connector 23 | bucketName: your-bucket-name 24 | region: your_aws_region 25 | filePath: lambda-functions/hello_world.zip 26 | identifier: awslambda 27 | type: AmazonS3 28 | gitOpsEnabled: false 29 | orgIdentifier: your_org_id 30 | projectIdentifier: your_project_id 31 | -------------------------------------------------------------------------------- /harness-platform/secrets/secret-sanitization.yaml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: print secret 3 | identifier: print_secret 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: print secret 10 | identifier: print_secret 11 | description: "" 12 | type: Custom 13 | spec: 14 | execution: 15 | steps: 16 | - step: 17 | type: ShellScript 18 | name: ShellScript_1 19 | identifier: ShellScript_1 20 | spec: 21 | shell: Bash 22 | onDelegate: true 23 | source: 24 | type: Inline 25 | spec: 26 | script: "echo \"text secret is: \" <+secrets.getValue(\"docsecret\")>" 27 | environmentVariables: [] 28 | outputVariables: [] 29 | timeout: 10m 30 | tags: {} 31 | -------------------------------------------------------------------------------- /guestbook/harnesscd-pipeline/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harness_guestbook 3 | identifier: harnessguestbook 4 | serviceDefinition: 5 | type: Kubernetes 6 | spec: 7 | manifests: 8 | - manifest: 9 | identifier: guestbook 10 | type: K8sManifest 11 | spec: 12 | store: 13 | type: Github 14 | spec: 15 | connectorRef: harnessgitconnector 16 | gitFetchType: Branch 17 | paths: 18 | - guestbook/guestbook-ui-deployment.yaml 19 | - guestbook/guestbook-ui-svc.yaml 20 | repoName: harnesscd-example-apps 21 | branch: master 22 | skipResourceVersioning: false 23 | enableDeclarativeRollback: false 24 | gitOpsEnabled: false 25 | -------------------------------------------------------------------------------- /custom-usecases/Dynamic-deployment-for-Multi-env-usecase-2/Description.md: -------------------------------------------------------------------------------- 1 | # Multi-Environment Deployment Using Environment Groups 2 | 3 | This pipeline demonstrates how to deploy to different Environment Groups within the same execution. 4 | 5 | In this example: 6 | 7 | - Pipeline chaining is used in the first three stages. 8 | - In the fourth stage, a stage template is used with a fixed environment group. This stage allows you to select specific environments within the environment group for deployment. 9 | 10 | Files in This Folder: 11 | 1. [pipeline.yaml](/custom-usecases/Dynamic-deployment-for-Multi-env-usecase-2/pipeline.yaml): Contains the pipeline YAML. 12 | 2. [chained-pipeline.yaml](/custom-usecases/Dynamic-deployment-for-Multi-env-usecase-2/chained-pipeline.yaml): The pipeline triggered from the first three stages of the main pipeline. 13 | 3. [stage-template.yaml](/custom-usecases/Dynamic-deployment-for-Multi-env-usecase-2/stage-template.yaml): Holds the stage template YAML. Here, the Environment Group is fixed, but users can select specific environments within the group. 14 | -------------------------------------------------------------------------------- /google_cloud_function/2nd_gen/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: hello_http 3 | identifier: hello_http 4 | tags: {} 5 | serviceDefinition: 6 | spec: 7 | environmentType: GenTwo 8 | manifests: 9 | - manifest: 10 | identifier: hello_http 11 | type: GoogleCloudFunctionDefinition 12 | spec: 13 | store: 14 | type: Github 15 | spec: 16 | connectorRef: harnessgitconnector 17 | gitFetchType: Branch 18 | paths: 19 | - google_cloud_function/hello_http.yaml 20 | branch: master 21 | artifacts: 22 | primary: 23 | primaryArtifactRef: <+input> 24 | sources: 25 | - spec: 26 | connectorRef: gcpconnector 27 | project: CLOUD_PROJECT_NAME 28 | bucket: CLOUD_BUCKET_NAME 29 | artifactPath: helloHttp.zip 30 | identifier: hello_http 31 | type: GoogleCloudStorage 32 | type: GoogleCloudFunctions 33 | -------------------------------------------------------------------------------- /plugins/kasane/README.md: -------------------------------------------------------------------------------- 1 | # Kasane 2 | 3 | [Kasane](https://github.com/google/kasane) is a layering tool for Kubernetes which utilises Jsonnet for deep object modification and patching. 4 | 5 | Use following steps to try the application: 6 | 7 | * Follow instructions from [custom_tools.md](https://github.com/harnessproj/harness-cd/blob/master/docs/operator-manual/custom_tools.md) to make sure `kasane` binary is available in `harnesscd-repo-server` pod. 8 | * Register `kasane` plugin `harnesscd-cm` ConfigMap: 9 | 10 | ```yaml 11 | apiVersion: v1 12 | data: 13 | configManagementPlugins: | 14 | - name: kasane 15 | init: 16 | command: [kasane, update] 17 | generate: 18 | command: [kasane, show] 19 | ``` 20 | * Create application using `kasane` as a config management plugin name. 21 | 22 | ``` 23 | harnesscd app create kasane \ 24 | --config-management-plugin kasane \ 25 | --repo https://github.com/harnessproj/harnesscd-example-apps \ 26 | --path plugins/kasane \ 27 | --dest-server https://kubernetes.default.svc \ 28 | --dest-namespace default 29 | ``` 30 | -------------------------------------------------------------------------------- /google_cloud_function/1st_gen/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: hello_world 3 | identifier: hello_world 4 | tags: {} 5 | serviceDefinition: 6 | spec: 7 | environmentType: GenOne 8 | manifests: 9 | - manifest: 10 | identifier: hello_world 11 | type: GoogleCloudFunctionGenOneDefinition 12 | spec: 13 | store: 14 | type: Github 15 | spec: 16 | connectorRef: harnessgitconnector 17 | gitFetchType: Branch 18 | paths: 19 | - google_cloud_function/hello_world.yaml 20 | branch: master 21 | artifacts: 22 | primary: 23 | primaryArtifactRef: <+input> 24 | sources: 25 | - spec: 26 | connectorRef: gcpconnector 27 | project: CLOUD_PROJECT_NAME 28 | bucket: CLOUD_BUCKET_NAME 29 | artifactPath: hello_world.zip 30 | identifier: hello_world 31 | type: GoogleCloudStorage 32 | type: GoogleCloudFunctions 33 | -------------------------------------------------------------------------------- /harness-platform/triggers/docker-trigger.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | name: docker-trigger 3 | identifier: dockertrigger 4 | enabled: true 5 | tags: {} 6 | orgIdentifier: ORGANIZATION_ID 7 | projectIdentifier: PROJECT_ID 8 | pipelineIdentifier: PIPELINE_ID 9 | stagesToExecute: [] 10 | source: 11 | type: Artifact 12 | spec: 13 | type: DockerRegistry 14 | spec: 15 | connectorRef: DOCKER_CONNECTOR 16 | imagePath: MAINTAINER/IMAGE 17 | tag: <+trigger.artifact.build> 18 | metaDataConditions: [] 19 | eventConditions: [] 20 | inputYaml: | 21 | pipeline: 22 | identifier: PIPELINE_ID 23 | stages: 24 | - stage: 25 | identifier: CD_STAGE_ID 26 | type: Deployment 27 | spec: 28 | service: 29 | serviceInputs: 30 | serviceDefinition: 31 | type: Kubernetes 32 | spec: 33 | artifacts: 34 | primary: 35 | primaryArtifactRef: ARTIFACT_ID 36 | sources: "" 37 | -------------------------------------------------------------------------------- /plugins/kustomized-helm/README.md: -------------------------------------------------------------------------------- 1 | # Helm + Kustomize 2 | 3 | Sometimes Helm chart don't have all required parameters and additional customization is required. This example application demonstrates how to combine Helm and Kustomize and use it 4 | as a config management plugin in Harness CD. 5 | 6 | Use following steps to try the application: 7 | 8 | * configure `kustomized-helm` tool in `harnesscd-cm` ConfigMap: 9 | 10 | ```yaml 11 | configManagementPlugins: | 12 | - name: kustomized-helm 13 | init: 14 | command: ["/bin/sh", "-c"] 15 | args: ["helm dependency build"] 16 | generate: 17 | command: [sh, -c] 18 | args: ["helm template --release-name release-name . > all.yaml && kustomize build"] 19 | ``` 20 | 21 | * create application using `kustomized-helm` as a config management plugin name: 22 | 23 | 24 | ``` 25 | harnesscd app create kustomized-helm \ 26 | --config-management-plugin kustomized-helm \ 27 | --repo https://github.com/harnessproj/harnesscd-example-apps \ 28 | --path plugins/kustomized-helm \ 29 | --dest-server https://kubernetes.default.svc \ 30 | --dest-namespace default 31 | ``` 32 | -------------------------------------------------------------------------------- /sock-shop/base/rabbitmq-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: rabbitmq 6 | labels: 7 | name: rabbitmq 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: rabbitmq 13 | template: 14 | metadata: 15 | labels: 16 | name: rabbitmq 17 | annotations: 18 | prometheus.io/scrape: "false" 19 | spec: 20 | containers: 21 | - name: rabbitmq 22 | image: rabbitmq:3.6.8-management 23 | ports: 24 | - containerPort: 15672 25 | name: management 26 | - containerPort: 5672 27 | name: rabbitmq 28 | securityContext: 29 | capabilities: 30 | drop: 31 | - all 32 | add: 33 | - CHOWN 34 | - SETGID 35 | - SETUID 36 | - DAC_OVERRIDE 37 | readOnlyRootFilesystem: true 38 | - name: rabbitmq-exporter 39 | image: kbudde/rabbitmq-exporter 40 | ports: 41 | - containerPort: 9090 42 | name: exporter 43 | nodeSelector: 44 | beta.kubernetes.io/os: linux 45 | -------------------------------------------------------------------------------- /podinfo/harness-gitops/trigger.yml: -------------------------------------------------------------------------------- 1 | trigger: 2 | name: gitopstrigger 3 | identifier: gitopstrigger 4 | enabled: true 5 | encryptedWebhookSecretIdentifier: "" 6 | description: "" 7 | tags: {} 8 | orgIdentifier: default 9 | stagesToExecute: [] 10 | projectIdentifier: default_project 11 | pipelineIdentifier: cdgitopspipeline 12 | source: 13 | type: Webhook 14 | spec: 15 | type: Github 16 | spec: 17 | type: Push 18 | spec: 19 | connectorRef: githubconnector 20 | autoAbortPreviousExecutions: false 21 | payloadConditions: 22 | - key: changedFiles 23 | operator: NotIn 24 | value: podinfo/configs/git-generator-files-discovery/ 25 | - key: targetBranch 26 | operator: Equals 27 | value: master 28 | headerConditions: [] 29 | actions: [] 30 | inputYaml: | 31 | pipeline: 32 | identifier: cdgitopspipeline 33 | properties: 34 | ci: 35 | codebase: 36 | build: 37 | type: branch 38 | spec: 39 | branch: <+trigger.branch> 40 | -------------------------------------------------------------------------------- /apps/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: applications 3 | description: Applications 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: "1.0" 24 | -------------------------------------------------------------------------------- /blue-green/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: helm-guestbook 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: "1.0" 24 | -------------------------------------------------------------------------------- /helm-guestbook/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: helm-guestbook 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: "1.0" 24 | -------------------------------------------------------------------------------- /blue-green/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "helm-guestbook.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "helm-guestbook.fullname" -}} 15 | {{- if .Values.fullnameOverride -}} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 17 | {{- else -}} 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} 19 | {{- if contains $name .Release.Name -}} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 21 | {{- else -}} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{/* 28 | Create chart name and version as used by the chart label. 29 | */}} 30 | {{- define "helm-guestbook.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 32 | {{- end -}} 33 | -------------------------------------------------------------------------------- /custom-usecases/Git Clone Functionality for Run Step/pipeline.yaml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: git-clone 3 | identifier: gitclone 4 | projectIdentifier: your-project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: s1 10 | identifier: s1 11 | description: "" 12 | type: CI 13 | spec: 14 | cloneCodebase: false 15 | caching: 16 | enabled: true 17 | override: false 18 | buildIntelligence: 19 | enabled: true 20 | platform: 21 | os: Linux 22 | arch: Amd64 23 | runtime: 24 | type: Cloud 25 | spec: {} 26 | execution: 27 | steps: 28 | - step: 29 | type: Run 30 | name: Run_1 31 | identifier: Run_1 32 | spec: 33 | shell: Sh 34 | command: |- 35 | git clone https://<+secrets.getValue("your-git-token")>@github.com/your-org/your-repo.git 36 | 37 | cd cd-samples 38 | echo "Printing README.md:" 39 | cat README.md 40 | -------------------------------------------------------------------------------- /helm-guestbook/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "helm-guestbook.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "helm-guestbook.fullname" -}} 15 | {{- if .Values.fullnameOverride -}} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 17 | {{- else -}} 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} 19 | {{- if contains $name .Release.Name -}} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 21 | {{- else -}} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{/* 28 | Create chart name and version as used by the chart label. 29 | */}} 30 | {{- define "helm-guestbook.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 32 | {{- end -}} 33 | -------------------------------------------------------------------------------- /blue-green/templates/services.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ template "helm-guestbook.fullname" . }} 6 | labels: 7 | app: {{ template "helm-guestbook.name" . }} 8 | chart: {{ template "helm-guestbook.chart" . }} 9 | release: {{ .Release.Name }} 10 | heritage: {{ .Release.Service }} 11 | spec: 12 | type: {{ .Values.service.type }} 13 | ports: 14 | - port: {{ .Values.service.port }} 15 | targetPort: http 16 | protocol: TCP 17 | name: http 18 | selector: 19 | app: {{ template "helm-guestbook.name" . }} 20 | release: {{ .Release.Name }} 21 | --- 22 | apiVersion: v1 23 | kind: Service 24 | metadata: 25 | name: {{ template "helm-guestbook.fullname" . }}-preview 26 | labels: 27 | app: {{ template "helm-guestbook.name" . }} 28 | chart: {{ template "helm-guestbook.chart" . }} 29 | release: {{ .Release.Name }} 30 | heritage: {{ .Release.Service }} 31 | spec: 32 | type: {{ .Values.service.type }} 33 | ports: 34 | - port: {{ .Values.service.port }} 35 | targetPort: http 36 | protocol: TCP 37 | name: http 38 | selector: 39 | app: {{ template "helm-guestbook.name" . }} 40 | release: {{ .Release.Name }} 41 | -------------------------------------------------------------------------------- /custom-usecases/terraform-workspace-jfrog-remote-backend/pipeline.yaml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: tf_jfrog 3 | identifier: tf_jfrog 4 | projectIdentifier: project_id 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: stage_1 10 | identifier: stage_1 11 | description: "" 12 | type: CI 13 | spec: 14 | cloneCodebase: true 15 | caching: 16 | enabled: true 17 | buildIntelligence: 18 | enabled: true 19 | platform: 20 | os: Linux 21 | arch: Amd64 22 | runtime: 23 | type: Cloud 24 | spec: {} 25 | execution: 26 | steps: 27 | - step: 28 | name: tfe_workspace 29 | identifier: tfe_workspace 30 | template: 31 | templateRef: jfrog_remote_workspace2 32 | versionLabel: v1 33 | variables: 34 | - name: WORKSPACE_SUFFIX 35 | type: String 36 | description: "" 37 | required: false 38 | value: <+input> 39 | properties: 40 | ci: 41 | codebase: 42 | repoName: test 43 | build: <+input> 44 | -------------------------------------------------------------------------------- /podinfo/harness-gitops/service.yml: -------------------------------------------------------------------------------- 1 | service: 2 | name: podinfoservice 3 | identifier: podinfoservice 4 | orgIdentifier: default 5 | projectIdentifier: default_project 6 | serviceDefinition: 7 | spec: 8 | manifests: 9 | - manifest: 10 | identifier: configjson 11 | type: ReleaseRepo 12 | spec: 13 | store: 14 | type: Github 15 | spec: 16 | connectorRef: githubconnector 17 | gitFetchType: Branch 18 | paths: 19 | - podinfo/configs/git-generator-files-discovery/cluster-config/engineering/<+env.name>/config.json 20 | branch: master 21 | - manifest: 22 | identifier: podinfodeployment 23 | type: DeploymentRepo 24 | spec: 25 | store: 26 | type: Github 27 | spec: 28 | connectorRef: githubconnector 29 | gitFetchType: Branch 30 | paths: 31 | - podinfo/configs/git-generator-files-discovery/git-generator-files.yaml 32 | branch: master 33 | type: Kubernetes 34 | gitOpsEnabled: true 35 | -------------------------------------------------------------------------------- /blue-green/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for helm-guestbook. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 3 6 | 7 | image: 8 | repository: gcr.io/heptio-images/ks-guestbook-demo 9 | tag: 0.1 10 | pullPolicy: IfNotPresent 11 | 12 | service: 13 | type: ClusterIP 14 | port: 80 15 | 16 | ingress: 17 | enabled: false 18 | annotations: {} 19 | # kubernetes.io/ingress.class: nginx 20 | # kubernetes.io/tls-acme: "true" 21 | path: / 22 | hosts: 23 | - chart-example.local 24 | tls: [] 25 | # - secretName: chart-example-tls 26 | # hosts: 27 | # - chart-example.local 28 | 29 | resources: {} 30 | # We usually recommend not to specify default resources and to leave this as a conscious 31 | # choice for the user. This also increases chances charts run on environments with little 32 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 33 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 34 | # limits: 35 | # cpu: 100m 36 | # memory: 128Mi 37 | # requests: 38 | # cpu: 100m 39 | # memory: 128Mi 40 | 41 | nodeSelector: {} 42 | 43 | tolerations: [] 44 | 45 | affinity: {} 46 | -------------------------------------------------------------------------------- /helm-guestbook/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for helm-guestbook. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 3 6 | 7 | image: 8 | repository: hekai/gcr.io_heptio-images_ks-guestbook-demo_0.2 9 | tag: latest 10 | pullPolicy: IfNotPresent 11 | 12 | service: 13 | type: ClusterIP 14 | port: 80 15 | 16 | ingress: 17 | enabled: false 18 | annotations: {} 19 | # kubernetes.io/ingress.class: nginx 20 | # kubernetes.io/tls-acme: "true" 21 | path: / 22 | hosts: 23 | - chart-example.local 24 | tls: [] 25 | # - secretName: chart-example-tls 26 | # hosts: 27 | # - chart-example.local 28 | 29 | resources: {} 30 | # We usually recommend not to specify default resources and to leave this as a conscious 31 | # choice for the user. This also increases chances charts run on environments with little 32 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 33 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 34 | # limits: 35 | # cpu: 100m 36 | # memory: 128Mi 37 | # requests: 38 | # cpu: 100m 39 | # memory: 128Mi 40 | 41 | nodeSelector: {} 42 | 43 | tolerations: [] 44 | 45 | affinity: {} 46 | -------------------------------------------------------------------------------- /custom-usecases/Custom-deployment-for-Lambda-Functions/Pipeline-using-template/infrastructure.yaml: -------------------------------------------------------------------------------- 1 | template: 2 | name: aws-lambda 3 | identifier: awslambda 4 | versionLabel: v1 5 | type: CustomDeployment 6 | projectIdentifier: projectIdentifier 7 | orgIdentifier: default 8 | tags: {} 9 | spec: 10 | infrastructure: 11 | variables: [] 12 | fetchInstancesScript: 13 | store: 14 | type: Inline 15 | spec: 16 | content: |+ 17 | # 18 | # Script is expected to query Infrastructure and dump json 19 | # in $INSTANCE_OUTPUT_PATH file path 20 | # 21 | # Harness is expected to initialize ${INSTANCE_OUTPUT_PATH} 22 | # environment variable - a random unique file path on delegate, 23 | # so script execution can save the result. 24 | # 25 | 26 | cat <<'_EOF_' > $${INSTANCE_OUTPUT_PATH} 27 | { 28 | "data": [] 29 | } 30 | _EOF_ 31 | 32 | instanceAttributes: 33 | - name: instancename 34 | jsonPath: server 35 | description: "" 36 | instancesListPath: data 37 | execution: 38 | stepTemplateRefs: 39 | - aws_template 40 | -------------------------------------------------------------------------------- /helm-dependency/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: wordpress 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: "1.0" 24 | 25 | dependencies: 26 | - name: wordpress 27 | version: 9.0.3 28 | repository: https://charts.helm.sh/stable -------------------------------------------------------------------------------- /plugins/kustomized-helm/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: guestbook 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: "1.0" 24 | 25 | dependencies: 26 | - name: helm-guestbook 27 | version: 0.1.0 28 | repository: file://../../helm-guestbook -------------------------------------------------------------------------------- /custom-usecases/Dynamic-deployment-for-Multi-env-usecase-2/stage-template.yaml: -------------------------------------------------------------------------------- 1 | template: 2 | name: test-asg 3 | identifier: testasg 4 | versionLabel: v1 5 | type: Stage 6 | projectIdentifier: projectIdentifier 7 | orgIdentifier: default 8 | tags: {} 9 | spec: 10 | type: Deployment 11 | spec: 12 | deploymentType: Asg 13 | service: 14 | serviceRef: <+input> 15 | serviceInputs: <+input> 16 | environmentGroup: 17 | envGroupRef: devenvironmentgroup 18 | metadata: 19 | parallel: true 20 | deployToAll: true 21 | environments: <+input> 22 | execution: 23 | steps: 24 | - step: 25 | type: ShellScript 26 | name: ShellScript_1 27 | identifier: ShellScript_1 28 | spec: 29 | shell: Bash 30 | executionTarget: {} 31 | source: 32 | type: Inline 33 | spec: 34 | script: echo "hi" 35 | environmentVariables: [] 36 | outputVariables: [] 37 | timeout: 10m 38 | rollbackSteps: [] 39 | failureStrategies: 40 | - onFailure: 41 | errors: 42 | - AllErrors 43 | action: 44 | type: StageRollback 45 | -------------------------------------------------------------------------------- /helm-native-canary-blue-green/harnesscd-pipeline/Build_and_push_Dockerhub.yaml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: Build 3 | identifier: Build 4 | projectIdentifier: CD_Samples 5 | orgIdentifier: default 6 | tags: {} 7 | properties: 8 | ci: 9 | codebase: 10 | repoName: Build 11 | build: <+input> 12 | stages: 13 | - stage: 14 | type: CI 15 | spec: 16 | cloneCodebase: true 17 | caching: 18 | enabled: true 19 | buildIntelligence: 20 | enabled: true 21 | execution: 22 | steps: 23 | - step: 24 | type: BuildAndPushDockerRegistry 25 | name: BuildAndPushDockerRegistry_1 26 | identifier: BuildAndPushDockerRegistry_1 27 | spec: 28 | connectorRef: Dockerhub_test 29 | repo: krishi0408/python-helm-native-canary-blue 30 | tags: 31 | - <+pipeline.sequenceId> 32 | caching: true 33 | platform: 34 | os: Linux 35 | arch: Amd64 36 | runtime: 37 | type: Cloud 38 | spec: {} 39 | name: Build and push to dockerhub 40 | identifier: Build_and_push_to_dockerhub 41 | description: "" 42 | -------------------------------------------------------------------------------- /cd-features/last-successful-artifact-tag/service.yaml: -------------------------------------------------------------------------------- 1 | service: 2 | name: harness_guestbook 3 | identifier: harnessguestbook 4 | orgIdentifier: default 5 | projectIdentifier: YOUR_PROJECT_IDENTIFIER 6 | gitOpsEnabled: false 7 | serviceDefinition: 8 | type: Kubernetes 9 | spec: 10 | manifests: 11 | - manifest: 12 | identifier: guestbook 13 | type: K8sManifest 14 | spec: 15 | store: 16 | type: Github 17 | spec: 18 | connectorRef: YOUR_GITHUB_CONNECTOR 19 | gitFetchType: Branch 20 | paths: 21 | - guestbook/guestbook-ui-deployment.yaml 22 | - guestbook/guestbook-ui-svc.yaml 23 | repoName: harnesscd-example-apps 24 | branch: master 25 | skipResourceVersioning: false 26 | enableDeclarativeRollback: false 27 | artifacts: 28 | primary: 29 | sources: 30 | - spec: 31 | connectorRef: YOUR_DOCKER_CONNECTOR 32 | imagePath: YOUR_IMAGE_PATH 33 | tag: <+input> 34 | digest: "" 35 | identifier: test_artifact 36 | type: DockerRegistry 37 | primaryArtifactRef: <+input> 38 | -------------------------------------------------------------------------------- /sock-shop/base/front-end-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: front-end 6 | spec: 7 | replicas: 1 8 | selector: 9 | matchLabels: 10 | name: front-end 11 | template: 12 | metadata: 13 | labels: 14 | name: front-end 15 | spec: 16 | containers: 17 | - name: front-end 18 | image: weaveworksdemos/front-end:0.3.12 19 | resources: 20 | limits: 21 | cpu: 300m 22 | memory: 1000Mi 23 | requests: 24 | cpu: 100m 25 | memory: 300Mi 26 | ports: 27 | - containerPort: 8079 28 | env: 29 | - name: SESSION_REDIS 30 | value: "true" 31 | securityContext: 32 | runAsNonRoot: true 33 | runAsUser: 10001 34 | capabilities: 35 | drop: 36 | - all 37 | readOnlyRootFilesystem: true 38 | livenessProbe: 39 | httpGet: 40 | path: / 41 | port: 8079 42 | initialDelaySeconds: 300 43 | periodSeconds: 3 44 | readinessProbe: 45 | httpGet: 46 | path: / 47 | port: 8079 48 | initialDelaySeconds: 30 49 | periodSeconds: 3 50 | nodeSelector: 51 | beta.kubernetes.io/os: linux 52 | -------------------------------------------------------------------------------- /sock-shop/base/payment-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: payment 6 | labels: 7 | name: payment 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: payment 13 | template: 14 | metadata: 15 | labels: 16 | name: payment 17 | spec: 18 | containers: 19 | - name: payment 20 | image: weaveworksdemos/payment:0.4.3 21 | resources: 22 | limits: 23 | cpu: 100m 24 | memory: 100Mi 25 | requests: 26 | cpu: 99m 27 | memory: 100Mi 28 | ports: 29 | - containerPort: 80 30 | securityContext: 31 | runAsNonRoot: true 32 | runAsUser: 10001 33 | capabilities: 34 | drop: 35 | - all 36 | add: 37 | - NET_BIND_SERVICE 38 | readOnlyRootFilesystem: true 39 | livenessProbe: 40 | httpGet: 41 | path: /health 42 | port: 80 43 | initialDelaySeconds: 300 44 | periodSeconds: 3 45 | readinessProbe: 46 | httpGet: 47 | path: /health 48 | port: 80 49 | initialDelaySeconds: 180 50 | periodSeconds: 3 51 | nodeSelector: 52 | beta.kubernetes.io/os: linux 53 | -------------------------------------------------------------------------------- /sock-shop/base/catalogue-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: catalogue 6 | labels: 7 | name: catalogue 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: catalogue 13 | template: 14 | metadata: 15 | labels: 16 | name: catalogue 17 | spec: 18 | containers: 19 | - name: catalogue 20 | image: weaveworksdemos/catalogue:0.3.5 21 | resources: 22 | limits: 23 | cpu: 100m 24 | memory: 100Mi 25 | requests: 26 | cpu: 100m 27 | memory: 100Mi 28 | ports: 29 | - containerPort: 80 30 | securityContext: 31 | runAsNonRoot: true 32 | runAsUser: 10001 33 | capabilities: 34 | drop: 35 | - all 36 | add: 37 | - NET_BIND_SERVICE 38 | readOnlyRootFilesystem: true 39 | livenessProbe: 40 | httpGet: 41 | path: /health 42 | port: 80 43 | initialDelaySeconds: 300 44 | periodSeconds: 3 45 | readinessProbe: 46 | httpGet: 47 | path: /health 48 | port: 80 49 | initialDelaySeconds: 180 50 | periodSeconds: 3 51 | nodeSelector: 52 | beta.kubernetes.io/os: linux 53 | -------------------------------------------------------------------------------- /sock-shop/base/queue-master-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: queue-master 6 | labels: 7 | name: queue-master 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: queue-master 13 | template: 14 | metadata: 15 | labels: 16 | name: queue-master 17 | spec: 18 | containers: 19 | - name: queue-master 20 | image: weaveworksdemos/queue-master:0.3.1 21 | env: 22 | - name: ZIPKIN 23 | value: zipkin.jaeger.svc.cluster.local 24 | - name: JAVA_OPTS 25 | value: -Xms64m -Xmx128m -XX:PermSize=32m -XX:MaxPermSize=64m -XX:+UseG1GC -Djava.security.egd=file:/dev/urandom 26 | resources: 27 | limits: 28 | cpu: 300m 29 | memory: 500Mi 30 | requests: 31 | cpu: 300m 32 | memory: 500Mi 33 | ports: 34 | - containerPort: 80 35 | livenessProbe: 36 | httpGet: 37 | path: /health 38 | port: 80 39 | initialDelaySeconds: 300 40 | periodSeconds: 3 41 | readinessProbe: 42 | httpGet: 43 | path: /health 44 | port: 80 45 | initialDelaySeconds: 180 46 | periodSeconds: 3 47 | nodeSelector: 48 | beta.kubernetes.io/os: linux 49 | -------------------------------------------------------------------------------- /sock-shop/base/user-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: user 6 | labels: 7 | name: user 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: user 13 | template: 14 | metadata: 15 | labels: 16 | name: user 17 | spec: 18 | containers: 19 | - name: user 20 | image: weaveworksdemos/user:0.4.7 21 | resources: 22 | limits: 23 | cpu: 300m 24 | memory: 100Mi 25 | requests: 26 | cpu: 100m 27 | memory: 100Mi 28 | ports: 29 | - containerPort: 80 30 | env: 31 | - name: MONGO_HOST 32 | value: user-db:27017 33 | securityContext: 34 | runAsNonRoot: true 35 | runAsUser: 10001 36 | capabilities: 37 | drop: 38 | - all 39 | add: 40 | - NET_BIND_SERVICE 41 | readOnlyRootFilesystem: true 42 | livenessProbe: 43 | httpGet: 44 | path: /health 45 | port: 80 46 | initialDelaySeconds: 300 47 | periodSeconds: 3 48 | readinessProbe: 49 | httpGet: 50 | path: /health 51 | port: 80 52 | initialDelaySeconds: 180 53 | periodSeconds: 3 54 | nodeSelector: 55 | beta.kubernetes.io/os: linux 56 | -------------------------------------------------------------------------------- /blue-green/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 1. Get the application URL by running these commands: 2 | {{- if .Values.ingress.enabled }} 3 | {{- range .Values.ingress.hosts }} 4 | http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} 5 | {{- end }} 6 | {{- else if contains "NodePort" .Values.service.type }} 7 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "helm-guestbook.fullname" . }}) 8 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") 9 | echo http://$NODE_IP:$NODE_PORT 10 | {{- else if contains "LoadBalancer" .Values.service.type }} 11 | NOTE: It may take a few minutes for the LoadBalancer IP to be available. 12 | You can watch the status of by running 'kubectl get svc -w {{ template "helm-guestbook.fullname" . }}' 13 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "helm-guestbook.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') 14 | echo http://$SERVICE_IP:{{ .Values.service.port }} 15 | {{- else if contains "ClusterIP" .Values.service.type }} 16 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "helm-guestbook.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") 17 | echo "Visit http://127.0.0.1:8080 to use your application" 18 | kubectl port-forward $POD_NAME 8080:80 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /custom-usecases/terraform-workspace-jfrog-remote-backend/template.yaml: -------------------------------------------------------------------------------- 1 | template: 2 | name: jfrog_remote_workspace-2 3 | identifier: jfrog_remote_workspace2 4 | versionLabel: v1 5 | type: Step 6 | projectIdentifier: Krishika_CD_Samples 7 | orgIdentifier: default 8 | tags: {} 9 | spec: 10 | type: Run 11 | spec: 12 | shell: Sh 13 | command: |- 14 | set -e 15 | 16 | export TF_TOKEN_harness_jfrog_io="<+secrets.getValue("harness_jfrog_identity_token")>" 17 | 18 | WORKSPACE_NAME=<+pipeline.variables.WORKSPACE_SUFFIX> 19 | 20 | echo " Cleaning previous .terraform setup..." 21 | rm -rf .terraform 22 | 23 | echo " Running terraform init..." 24 | # terraform init -reconfigure 25 | 26 | printf "1\n" | terraform init -reconfigure 27 | 28 | echo " Checking for workspace '${WORKSPACE_NAME}'..." 29 | 30 | # Check if the workspace exists 31 | if terraform workspace list | grep -q "${WORKSPACE_NAME}"; then 32 | echo " Workspace '${WORKSPACE_NAME}' already exists. Selecting it..." 33 | terraform workspace select "${WORKSPACE_NAME}" 34 | else 35 | echo " Workspace '${WORKSPACE_NAME}' not found. Creating it..." 36 | terraform workspace new "${WORKSPACE_NAME}" 37 | fi 38 | 39 | echo " Running terraform plan in workspace: ${WORKSPACE_NAME}..." 40 | terraform plan 41 | 42 | echo " Applying changes..." 43 | terraform apply -auto-approve 44 | -------------------------------------------------------------------------------- /helm-guestbook/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 1. Get the application URL by running these commands: 2 | {{- if .Values.ingress.enabled }} 3 | {{- range .Values.ingress.hosts }} 4 | http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} 5 | {{- end }} 6 | {{- else if contains "NodePort" .Values.service.type }} 7 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "helm-guestbook.fullname" . }}) 8 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") 9 | echo http://$NODE_IP:$NODE_PORT 10 | {{- else if contains "LoadBalancer" .Values.service.type }} 11 | NOTE: It may take a few minutes for the LoadBalancer IP to be available. 12 | You can watch the status of by running 'kubectl get svc -w {{ template "helm-guestbook.fullname" . }}' 13 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "helm-guestbook.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') 14 | echo http://$SERVICE_IP:{{ .Values.service.port }} 15 | {{- else if contains "ClusterIP" .Values.service.type }} 16 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "helm-guestbook.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") 17 | echo "Visit http://127.0.0.1:8080 to use your application" 18 | kubectl port-forward $POD_NAME 8080:80 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Harness CD & GitOps Example Apps 2 | 3 | This repository contains example applications for demoing Harness CD & GitOps functionality. Feel free 4 | use this to learn more about Harness CD & GitOps in your own Harness account, or fork this repo and push your own commits! 5 | 6 | | Application | Description | 7 | |-------------|-------------| 8 | | [guestbook](guestbook/) | A hello word guestbook app as plain YAML | 9 | | [ksonnet-guestbook](ksonnet-guestbook/) | The guestbook app as a ksonnet app | 10 | | [helm-guestbook](helm-guestbook/) | The guestbook app as a Helm chart | 11 | | [jsonnet-guestbook](jsonnet-guestbook/) | The guestbook app as a raw jsonnet | 12 | | [jsonnet-guestbook-tla](jsonnet-guestbook-tla/) | The guestbook app as a raw jsonnet with support for top level arguments | 13 | | [kustomize-guestbook](kustomize-guestbook/) | The guestbook app as a Kustomize 2 app | 14 | | [pre-post-sync](pre-post-sync/) | Demonstrates Harness CD PreSync and PostSync hooks | 15 | | [sync-waves](sync-waves/) | Demonstrates Harness CD sync waves with hooks | 16 | | [helm-dependency](helm-dependency/) | Demonstrates how to customize an OTS (off-the-shelf) helm chart from an upstream repo | 17 | | [sock-shop](sock-shop/) | A microservices demo app (https://microservices-demo.github.io) | 18 | | [plugins](plugins/) | Apps which demonstrate config management plugins usage | 19 | | [blue-green](blue-green/) | Demonstrates how to implement blue-green deployment using Harness CD| 20 | | [apps](apps/) | An app composed of other apps | 21 | -------------------------------------------------------------------------------- /cd-features/slack-notify-step/pipeline.yaml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: slack_notify 3 | identifier: slack_notify 4 | projectIdentifier: PROJECT_ID 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: slack 10 | identifier: slack 11 | description: "" 12 | type: Custom 13 | spec: 14 | execution: 15 | steps: 16 | - stepGroup: 17 | name: container 18 | identifier: container 19 | steps: 20 | - step: 21 | type: SlackNotify 22 | name: SlackNotify_1 23 | identifier: SlackNotify_1 24 | spec: 25 | channel: CHANNEL_ID 26 | blocks: |- 27 | [ { "type": "header", 28 | "text": { "type" 29 | : "plain_text", "text": "Header" 30 | } }] 31 | token: SLACK_TOKEN 32 | threadTs: THREAD_ID 33 | stepGroupInfra: 34 | type: KubernetesDirect 35 | spec: 36 | connectorRef: KUBERNETES_CONNECTOR 37 | namespace: default 38 | rollbackSteps: [] 39 | serviceDependencies: [] 40 | tags: {} 41 | -------------------------------------------------------------------------------- /serverless-lambda/harnesscd-pipeline/serverless-deployment.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: serverless-demo 3 | identifier: serverlessdemo 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: stage-1 10 | identifier: stage1 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: ServerlessAwsLambda 15 | service: 16 | serviceRef: Serverless 17 | execution: 18 | steps: 19 | - step: 20 | name: Serverless Lambda Deploy 21 | identifier: ServerlessLambdaDeploy 22 | type: ServerlessAwsLambdaDeploy 23 | timeout: 10m 24 | spec: 25 | commandOptions: "" 26 | rollbackSteps: 27 | - step: 28 | name: Serverless Lambda Rollback 29 | identifier: ServerlessLambdaRollback 30 | type: ServerlessAwsLambdaRollback 31 | timeout: 10m 32 | spec: {} 33 | environment: 34 | environmentRef: serverlessenv 35 | deployToAll: false 36 | infrastructureDefinitions: 37 | - identifier: serverlessec2 38 | tags: {} 39 | failureStrategies: 40 | - onFailure: 41 | errors: 42 | - AllErrors 43 | action: 44 | type: StageRollback 45 | variables: [] 46 | -------------------------------------------------------------------------------- /jsonnet-guestbook/guestbook-ui.jsonnet: -------------------------------------------------------------------------------- 1 | local params = import 'params.libsonnet'; 2 | 3 | [ 4 | { 5 | "apiVersion": "v1", 6 | "kind": "Service", 7 | "metadata": { 8 | "name": params.name 9 | }, 10 | "spec": { 11 | "ports": [ 12 | { 13 | "port": params.servicePort, 14 | "targetPort": params.containerPort 15 | } 16 | ], 17 | "selector": { 18 | "app": params.name 19 | }, 20 | "type": params.type 21 | } 22 | }, 23 | { 24 | "apiVersion": "apps/v1", 25 | "kind": "Deployment", 26 | "metadata": { 27 | "name": params.name 28 | }, 29 | "spec": { 30 | "replicas": params.replicas, 31 | "revisionHistoryLimit": 3, 32 | "selector": { 33 | "matchLabels": { 34 | "app": params.name 35 | }, 36 | }, 37 | "template": { 38 | "metadata": { 39 | "labels": { 40 | "app": params.name 41 | } 42 | }, 43 | "spec": { 44 | "containers": [ 45 | { 46 | "image": params.image, 47 | "name": params.name, 48 | "ports": [ 49 | { 50 | "containerPort": params.containerPort 51 | } 52 | ] 53 | } 54 | ] 55 | } 56 | } 57 | } 58 | } 59 | ] 60 | -------------------------------------------------------------------------------- /deploy-own-app/cd-pipeline/rolling-pipeline.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: ownapp_rolling_pipeline 3 | identifier: ownapp_rolling_pipeline 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: deploy-ownapp 10 | identifier: deployownapp 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: Kubernetes 15 | service: 16 | serviceRef: ownappservice 17 | environment: 18 | environmentRef: ownappdevenv 19 | deployToAll: false 20 | infrastructureDefinitions: 21 | - identifier: ownappk8sinfra 22 | execution: 23 | steps: 24 | - step: 25 | name: Rollout Deployment 26 | identifier: rolloutDeployment 27 | type: K8sRollingDeploy 28 | timeout: 10m 29 | spec: 30 | skipDryRun: false 31 | pruningEnabled: false 32 | rollbackSteps: 33 | - step: 34 | name: Rollback Rollout Deployment 35 | identifier: rollbackRolloutDeployment 36 | type: K8sRollingRollback 37 | timeout: 10m 38 | spec: 39 | pruningEnabled: false 40 | tags: {} 41 | failureStrategies: 42 | - onFailure: 43 | errors: 44 | - AllErrors 45 | action: 46 | type: StageRollback 47 | -------------------------------------------------------------------------------- /guestbook/harnesscd-pipeline/rolling-pipeline.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: guestbook_rolling_pipeline 3 | identifier: guestbook_rolling_pipeline 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: deploy-guestbook 10 | identifier: deployguestbook 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: Kubernetes 15 | service: 16 | serviceRef: harnessguestbook 17 | environment: 18 | environmentRef: harnessdevenv 19 | deployToAll: false 20 | infrastructureDefinitions: 21 | - identifier: harnessk8sinfra 22 | execution: 23 | steps: 24 | - step: 25 | name: Rollout Deployment 26 | identifier: rolloutDeployment 27 | type: K8sRollingDeploy 28 | timeout: 10m 29 | spec: 30 | skipDryRun: false 31 | pruningEnabled: false 32 | rollbackSteps: 33 | - step: 34 | name: Rollback Rollout Deployment 35 | identifier: rollbackRolloutDeployment 36 | type: K8sRollingRollback 37 | timeout: 10m 38 | spec: 39 | pruningEnabled: false 40 | tags: {} 41 | failureStrategies: 42 | - onFailure: 43 | errors: 44 | - AllErrors 45 | action: 46 | type: StageRollback 47 | -------------------------------------------------------------------------------- /kustomize-guestbook/harnesscd-pipeline/rolling-pipeline.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: guestbook_rolling_pipeline 3 | identifier: guestbook_rolling_pipeline 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: deploy-guestbook 10 | identifier: deployguestbook 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: Kubernetes 15 | service: 16 | serviceRef: harnessguestbook 17 | environment: 18 | environmentRef: harnessdevenv 19 | deployToAll: false 20 | infrastructureDefinitions: 21 | - identifier: harnessk8sinfra 22 | execution: 23 | steps: 24 | - step: 25 | name: Rollout Deployment 26 | identifier: rolloutDeployment 27 | type: K8sRollingDeploy 28 | timeout: 10m 29 | spec: 30 | skipDryRun: false 31 | pruningEnabled: false 32 | rollbackSteps: 33 | - step: 34 | name: Rollback Rollout Deployment 35 | identifier: rollbackRolloutDeployment 36 | type: K8sRollingRollback 37 | timeout: 10m 38 | spec: 39 | pruningEnabled: false 40 | tags: {} 41 | failureStrategies: 42 | - onFailure: 43 | errors: 44 | - AllErrors 45 | action: 46 | type: StageRollback -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/nativehelm-rolling-pipeline.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: guestbook_rolling_pipeline 3 | identifier: guestbook_rolling_pipeline 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: deploy-guestbook 10 | identifier: deployguestbook 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: NativeHelm 15 | service: 16 | serviceRef: harnessguestbook 17 | environment: 18 | environmentRef: harnessdevenv 19 | deployToAll: false 20 | infrastructureDefinitions: 21 | - identifier: harnessk8sinfra 22 | execution: 23 | steps: 24 | - step: 25 | name: Rollout Deployment 26 | identifier: rolloutDeployment 27 | type: K8sRollingDeploy 28 | timeout: 10m 29 | spec: 30 | skipDryRun: false 31 | pruningEnabled: false 32 | rollbackSteps: 33 | - step: 34 | name: Rollback Rollout Deployment 35 | identifier: rollbackRolloutDeployment 36 | type: K8sRollingRollback 37 | timeout: 10m 38 | spec: 39 | pruningEnabled: false 40 | tags: {} 41 | failureStrategies: 42 | - onFailure: 43 | errors: 44 | - AllErrors 45 | action: 46 | type: StageRollback 47 | -------------------------------------------------------------------------------- /helm-guestbook/harnesscd-pipeline/k8s-rolling-pipeline.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: guestbook_k8s_rolling_pipeline 3 | identifier: guestbook_k8s_rolling_pipeline 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: deployguestbook 10 | identifier: deployguestbook 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: Kubernetes 15 | service: 16 | serviceRef: harnessguestbookdep 17 | environment: 18 | environmentRef: harnessdevenvdep 19 | deployToAll: false 20 | infrastructureDefinitions: 21 | - identifier: harnessk8sinfradep 22 | execution: 23 | steps: 24 | - step: 25 | name: Rollout Deployment 26 | identifier: rolloutDeployment 27 | type: K8sRollingDeploy 28 | timeout: 10m 29 | spec: 30 | skipDryRun: false 31 | pruningEnabled: false 32 | rollbackSteps: 33 | - step: 34 | name: Rollback Rollout Deployment 35 | identifier: rollbackRolloutDeployment 36 | type: K8sRollingRollback 37 | timeout: 10m 38 | spec: 39 | pruningEnabled: false 40 | tags: {} 41 | failureStrategies: 42 | - onFailure: 43 | errors: 44 | - AllErrors 45 | action: 46 | type: StageRollback 47 | -------------------------------------------------------------------------------- /custom-usecases/Custom-deployment-for-Lambda-Functions/Pipeline-using-template/pipeline.yaml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: aws-lambda-using-template 3 | identifier: awslambdausingtemplate 4 | projectIdentifier: projectIdentifier 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: stage1 10 | identifier: stage1 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: CustomDeployment 15 | customDeploymentRef: 16 | templateRef: awslambda 17 | versionLabel: v1 18 | service: 19 | serviceRef: test123 20 | execution: 21 | steps: 22 | - step: 23 | name: Fetch Instances 24 | identifier: fetchInstances 25 | type: FetchInstanceScript 26 | timeout: 10m 27 | spec: {} 28 | - step: 29 | name: lambda-test 30 | identifier: lambdatest 31 | template: 32 | templateRef: aws_template 33 | versionLabel: v1 34 | rollbackSteps: [] 35 | environment: 36 | environmentRef: test_env 37 | deployToAll: false 38 | infrastructureDefinitions: 39 | - identifier: test_infra 40 | tags: {} 41 | failureStrategies: 42 | - onFailure: 43 | errors: 44 | - AllErrors 45 | action: 46 | type: StageRollback 47 | delegateSelectors: 48 | - kubernetes-delegate 49 | -------------------------------------------------------------------------------- /blue-green/README.md: -------------------------------------------------------------------------------- 1 | # Blue Green 2 | 3 | The blue green strategy is not supported by built-in Kubernetes Deployment but available via third-party Kubernetes controller. 4 | This example demonstrates how to implement blue-green deployment via [Harness Rollouts](https://github.com/harnessproj/harness-rollouts): 5 | 6 | 1. Install Harness Rollouts controller: https://github.com/harnessproj/harness-rollouts#installation 7 | 2. Create a sample application and sync it. 8 | 9 | ``` 10 | harnesscd app create --name blue-green --repo https://github.com/harnessproj/harnesscd-example-apps --dest-server https://kubernetes.default.svc --dest-namespace default --path blue-green && harnesscd app sync blue-green 11 | ``` 12 | 13 | Once the application is synced you can access it using `blue-green-helm-guestbook` service. 14 | 15 | 3. Change image version parameter to trigger blue-green deployment process: 16 | 17 | ``` 18 | harnesscd app set blue-green -p image.tag=0.2 && harnesscd app sync blue-green 19 | ``` 20 | 21 | Now application runs `ks-guestbook-demo:0.1` and `ks-guestbook-demo:0.2` images simultaneously. 22 | The `ks-guestbook-demo:0.2` is still considered `blue` available only via preview service `blue-green-helm-guestbook-preview`. 23 | 24 | 4. Promote `ks-guestbook-demo:0.2` to `green` by patching `Rollout` resource: 25 | 26 | ``` 27 | harnesscd app patch-resource blue-green --kind Rollout --resource-name blue-green-helm-guestbook --patch '{ "status": { "verifyingPreview": false } }' --patch-type 'application/merge-patch+json' 28 | ``` 29 | 30 | This promotes `ks-guestbook-demo:0.2` to `green` status and `Rollout` deletes old replica which runs `ks-guestbook-demo:0.1`. 31 | -------------------------------------------------------------------------------- /helm-guestbook/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ template "helm-guestbook.fullname" . }} 5 | labels: 6 | app: {{ template "helm-guestbook.name" . }} 7 | chart: {{ template "helm-guestbook.chart" . }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | spec: 11 | replicas: {{ .Values.replicaCount }} 12 | revisionHistoryLimit: 3 13 | selector: 14 | matchLabels: 15 | app: {{ template "helm-guestbook.name" . }} 16 | release: {{ .Release.Name }} 17 | template: 18 | metadata: 19 | labels: 20 | app: {{ template "helm-guestbook.name" . }} 21 | release: {{ .Release.Name }} 22 | spec: 23 | containers: 24 | - name: {{ .Chart.Name }} 25 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 26 | imagePullPolicy: {{ .Values.image.pullPolicy }} 27 | ports: 28 | - name: http 29 | containerPort: 80 30 | protocol: TCP 31 | livenessProbe: 32 | httpGet: 33 | path: / 34 | port: http 35 | readinessProbe: 36 | httpGet: 37 | path: / 38 | port: http 39 | resources: 40 | {{ toYaml .Values.resources | indent 12 }} 41 | {{- with .Values.nodeSelector }} 42 | nodeSelector: 43 | {{ toYaml . | indent 8 }} 44 | {{- end }} 45 | {{- with .Values.affinity }} 46 | affinity: 47 | {{ toYaml . | indent 8 }} 48 | {{- end }} 49 | {{- with .Values.tolerations }} 50 | tolerations: 51 | {{ toYaml . | indent 8 }} 52 | {{- end }} 53 | -------------------------------------------------------------------------------- /ksonnet-guestbook/components/guestbook-ui.jsonnet: -------------------------------------------------------------------------------- 1 | local env = std.extVar("__ksonnet/environments"); 2 | local params = std.extVar("__ksonnet/params").components["guestbook-ui"]; 3 | [ 4 | { 5 | "apiVersion": "v1", 6 | "kind": "Service", 7 | "metadata": { 8 | "name": params.name 9 | }, 10 | "spec": { 11 | "ports": [ 12 | { 13 | "port": params.servicePort, 14 | "targetPort": params.containerPort 15 | } 16 | ], 17 | "selector": { 18 | "app": params.name 19 | }, 20 | "type": params.type 21 | } 22 | }, 23 | { 24 | "apiVersion": "apps/v1", 25 | "kind": "Deployment", 26 | "metadata": { 27 | "name": params.name 28 | }, 29 | "spec": { 30 | "replicas": params.replicas, 31 | "revisionHistoryLimit": 3, 32 | "selector": { 33 | "matchLabels": { 34 | "app": params.name 35 | }, 36 | }, 37 | "template": { 38 | "metadata": { 39 | "labels": { 40 | "app": params.name 41 | } 42 | }, 43 | "spec": { 44 | "containers": [ 45 | { 46 | "image": params.image, 47 | "name": params.name, 48 | "ports": [ 49 | { 50 | "containerPort": params.containerPort 51 | } 52 | ] 53 | } 54 | ] 55 | } 56 | } 57 | } 58 | } 59 | ] 60 | -------------------------------------------------------------------------------- /custom-usecases/Multi-Tenant Architecture/config-files/tenant_config/tenant_project_1.xml: -------------------------------------------------------------------------------- 1 | 2 | tenant_1 3 | 4 | 5 | Macrims 6 | 7 | 8 | prod 9 | macrims_prod_env 10 | prod_infrastructure_1 11 | 12 | 13 | stage 14 | macrims_stage_env 15 | stage_infrastructure_1 16 | 17 | 18 | dev 19 | tenant1_dev_env 20 | k8s_infra_1 21 | 22 | 23 | 24 | 25 | Decisions 26 | 27 | 28 | prod 29 | decisions_prod_env 30 | prod_infrastructure_2 31 | 32 | 33 | stage 34 | decisions_stage_env 35 | stage_infrastructure_2 36 | 37 | 38 | dev 39 | tenant_dev_env1 40 | k8S_infra 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /custom-usecases/Multi-Tenant Architecture/config-files/tenant_config/tenant_project_2.xml: -------------------------------------------------------------------------------- 1 | 2 | tenant_1 3 | 4 | 5 | Macrims 6 | 7 | 8 | prod 9 | macrims_prod_env 10 | prod_infrastructure_1 11 | 12 | 13 | stage 14 | macrims_stage_env 15 | stage_infrastructure_1 16 | 17 | 18 | dev 19 | tenant2_dev_env 20 | k8s_infra_2 21 | 22 | 23 | 24 | 25 | Decisions 26 | 27 | 28 | prod 29 | decisions_prod_env 30 | prod_infrastructure_2 31 | 32 | 33 | stage 34 | decisions_stage_env 35 | stage_infrastructure_2 36 | 37 | 38 | dev 39 | tenant2_dev_env 40 | k8s_infra 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /custom-usecases/Multi-Tenant Architecture/config-files/tenant_config/tenant_project_3.xml: -------------------------------------------------------------------------------- 1 | 2 | tenant_1 3 | 4 | 5 | Macrims 6 | 7 | 8 | prod 9 | macrims_prod_env 10 | prod_infrastructure_1 11 | 12 | 13 | stage 14 | macrims_stage_env 15 | stage_infrastructure_1 16 | 17 | 18 | dev 19 | tenant3_dev_env 20 | k8s_infra_3 21 | 22 | 23 | 24 | 25 | Decisions 26 | 27 | 28 | prod 29 | decisions_prod_env 30 | prod_infrastructure_2 31 | 32 | 33 | stage 34 | decisions_stage_env 35 | stage_infrastructure_2 36 | 37 | 38 | dev 39 | tenant3_dev_env 40 | k8s_infra 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /aws-lambda/harnesscd-pipeline/pipeline.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: your_pipeline_name 3 | identifier: your_pipeline_id 4 | projectIdentifier: your_project_id 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: lambda_deploy 10 | identifier: lambda_deploy 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: AwsLambda 15 | service: 16 | serviceRef: lambdafunction 17 | serviceInputs: 18 | serviceDefinition: 19 | type: AwsLambda 20 | spec: 21 | artifacts: 22 | primary: 23 | primaryArtifactRef: <+input> 24 | sources: <+input> 25 | environment: 26 | environmentRef: lambda_env 27 | deployToAll: false 28 | infrastructureDefinitions: 29 | - identifier: awsinfra 30 | execution: 31 | steps: 32 | - step: 33 | name: Deploy Aws Lambda 34 | identifier: deployawslambda 35 | type: AwsLambdaDeploy 36 | timeout: 10m 37 | spec: {} 38 | rollbackSteps: 39 | - step: 40 | name: Aws Lambda rollback 41 | identifier: awslambdarollback 42 | type: AwsLambdaRollback 43 | timeout: 10m 44 | spec: {} 45 | tags: {} 46 | failureStrategies: 47 | - onFailure: 48 | errors: 49 | - AllErrors 50 | action: 51 | type: StageRollback 52 | -------------------------------------------------------------------------------- /kubernetes-steps/diff-step/pipeline.yaml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: kubectl-diff 3 | identifier: kubectldiff 4 | projectIdentifier: your_project_id 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: deploy-ownapp 10 | identifier: deployownapp 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: Kubernetes 15 | service: 16 | serviceRef: ownappservice 17 | environment: 18 | environmentRef: ownappdevenv 19 | deployToAll: false 20 | infrastructureDefinitions: 21 | - identifier: ownappk8sinfra 22 | execution: 23 | steps: 24 | - step: 25 | type: K8sDiff 26 | name: K8sDiff_1 27 | identifier: K8sDiff_1 28 | spec: {} 29 | timeout: 10m 30 | - step: 31 | name: Rollout Deployment 32 | identifier: rolloutDeployment 33 | type: K8sRollingDeploy 34 | timeout: 10m 35 | spec: 36 | skipDryRun: false 37 | pruningEnabled: false 38 | rollbackSteps: 39 | - step: 40 | name: Rollback Rollout Deployment 41 | identifier: rollbackRolloutDeployment 42 | type: K8sRollingRollback 43 | timeout: 10m 44 | spec: 45 | pruningEnabled: false 46 | tags: {} 47 | failureStrategies: 48 | - onFailure: 49 | errors: 50 | - AllErrors 51 | action: 52 | type: StageRollback 53 | -------------------------------------------------------------------------------- /helm-dependency/README.md: -------------------------------------------------------------------------------- 1 | # Helm Dependencies 2 | 3 | This example application demonstrates how an OTS (off-the-shelf) helm chart can be retrieved and 4 | pinned to a specific helm sem version from an upstream helm repository, and customized using a custom 5 | values.yaml in the private git repository. 6 | 7 | In this example, the wordpress application is pulled from the stable helm repo, and pinned to v5.0.2: 8 | 9 | ```yaml 10 | dependencies: 11 | - name: wordpress 12 | version: 5.0.2 13 | repository: https://charts.helm.sh/stable 14 | ``` 15 | 16 | A custom values.yaml is used to customize the parameters of the wordpress helm chart: 17 | 18 | ```yaml 19 | wordpress: 20 | wordpressPassword: foo 21 | mariadb: 22 | db: 23 | password: bar 24 | rootUser: 25 | password: baz 26 | ``` 27 | 28 | ### Subchart Note 29 | 30 | The wordpress chart referenced in this example contains a subchart for mariadb as specified in the requirements.yaml file of the wordpress chart: 31 | ```yaml 32 | - name: mariadb 33 | version: 5.x.x 34 | repository: https://charts.helm.sh/stable 35 | condition: mariadb.enabled 36 | tags: 37 | - wordpress-database 38 | ``` 39 | 40 | In order to disable this chart, you must set the value to false for both `mariadb.enabled` and `wordpress.mariadb.enabled`. The first is used by the mariadb subchart condition field, the second is used by the wordpress chart deployment template. An example demonstration is available in the values-nomaria.yaml file: 41 | ```yaml 42 | mariadb: 43 | enabled: false 44 | 45 | wordpress: 46 | wordpressPassword: foo 47 | mariadb: 48 | enabled: false 49 | externalDatabase: 50 | host: localhost 51 | user: bn_wordpress 52 | password: "" 53 | database: bitnami_wordpress 54 | port: 3306 55 | ``` -------------------------------------------------------------------------------- /serverless-lambda/frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 15 | 16 | 25 | Serverless Email Form 26 | 27 | 28 | 29 |
30 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /sock-shop/base/carts-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: carts 6 | labels: 7 | name: carts 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: carts 13 | template: 14 | metadata: 15 | labels: 16 | name: carts 17 | spec: 18 | containers: 19 | - name: carts 20 | image: weaveworksdemos/carts:0.4.8 21 | env: 22 | - name: ZIPKIN 23 | value: zipkin.jaeger.svc.cluster.local 24 | - name: JAVA_OPTS 25 | value: -Xms64m -Xmx128m -XX:PermSize=32m -XX:MaxPermSize=64m -XX:+UseG1GC -Djava.security.egd=file:/dev/urandom 26 | resources: 27 | limits: 28 | cpu: 300m 29 | memory: 500Mi 30 | requests: 31 | cpu: 300m 32 | memory: 500Mi 33 | ports: 34 | - containerPort: 80 35 | securityContext: 36 | runAsNonRoot: true 37 | runAsUser: 10001 38 | capabilities: 39 | drop: 40 | - all 41 | add: 42 | - NET_BIND_SERVICE 43 | readOnlyRootFilesystem: true 44 | volumeMounts: 45 | - mountPath: /tmp 46 | name: tmp-volume 47 | livenessProbe: 48 | httpGet: 49 | path: /health 50 | port: 80 51 | initialDelaySeconds: 300 52 | periodSeconds: 3 53 | readinessProbe: 54 | httpGet: 55 | path: /health 56 | port: 80 57 | initialDelaySeconds: 180 58 | periodSeconds: 3 59 | volumes: 60 | - name: tmp-volume 61 | emptyDir: 62 | medium: Memory 63 | nodeSelector: 64 | beta.kubernetes.io/os: linux 65 | -------------------------------------------------------------------------------- /custom-usecases/terraform-create-workspace/Description.md: -------------------------------------------------------------------------------- 1 | # Dynamic Terraform Workspace Creation Step Template 2 | 3 | ## Overview 4 | 5 | This step template helps you automatically create a Terraform workspace in Terraform Cloud (or Enterprise) if it does not already exist. It simplifies your infrastructure provisioning workflow by ensuring required resources are created dynamically. 6 | 7 | ## Use Case Solved 8 | 9 | - You're using Terraform Cloud (TFC) or Terraform Enterprise (TFE) for managing your infrastructure state. 10 | - You want to dynamically select or create Terraform workspaces based on a given prefix and dynamic suffix. 11 | 12 | ## What This Template Does 13 | 14 | - Checks if the specified Terraform workspace (constructed from a prefix and dynamic suffix) exists. 15 | - If the workspace doesn't exist, it automatically creates it using the Terraform Cloud API. 16 | - Outputs the Terraform workspace name as an output variable, allowing it to be referenced in subsequent pipeline steps. 17 | 18 | ## How to Use 19 | 20 | 1. Add this step template to your Harness pipeline. 21 | 2. Set pipeline variables for workspace suffix, workspace prefix and org_name dynamically during pipeline execution. 22 | 3. Reference the generated workspace name output variable in subsequent steps for consistent resource deployments. 23 | 24 | ## Requirements 25 | 26 | - Terraform Cloud or Terraform Enterprise account and API token. 27 | 28 | - Harness secret setup with the Terraform Cloud API token. 29 | 30 | ## Example Scenario 31 | 32 | If your workspace prefix is mypref- and the dynamic suffix is dev, this template: 33 | - Creates a Terraform workspace named `mypref-dev` (if not already existing). 34 | 35 | This automation ensures your workspace is ready for subsequent infrastructure provisioning steps. -------------------------------------------------------------------------------- /sock-shop/base/orders-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: orders 6 | labels: 7 | name: orders 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: orders 13 | template: 14 | metadata: 15 | labels: 16 | name: orders 17 | spec: 18 | containers: 19 | - name: orders 20 | image: weaveworksdemos/orders:0.4.7 21 | env: 22 | - name: ZIPKIN 23 | value: zipkin.jaeger.svc.cluster.local 24 | - name: JAVA_OPTS 25 | value: -Xms64m -Xmx128m -XX:PermSize=32m -XX:MaxPermSize=64m -XX:+UseG1GC -Djava.security.egd=file:/dev/urandom 26 | resources: 27 | limits: 28 | cpu: 500m 29 | memory: 500Mi 30 | requests: 31 | cpu: 200m 32 | memory: 500Mi 33 | ports: 34 | - containerPort: 80 35 | securityContext: 36 | runAsNonRoot: true 37 | runAsUser: 10001 38 | capabilities: 39 | drop: 40 | - all 41 | add: 42 | - NET_BIND_SERVICE 43 | readOnlyRootFilesystem: true 44 | volumeMounts: 45 | - mountPath: /tmp 46 | name: tmp-volume 47 | livenessProbe: 48 | httpGet: 49 | path: /health 50 | port: 80 51 | initialDelaySeconds: 300 52 | periodSeconds: 3 53 | readinessProbe: 54 | httpGet: 55 | path: /health 56 | port: 80 57 | initialDelaySeconds: 180 58 | periodSeconds: 3 59 | volumes: 60 | - name: tmp-volume 61 | emptyDir: 62 | medium: Memory 63 | nodeSelector: 64 | beta.kubernetes.io/os: linux 65 | -------------------------------------------------------------------------------- /google_cloud_function/2nd_gen/basic-pipeline.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: basic 3 | identifier: basic 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: hello_http 10 | identifier: hello_http 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: GoogleCloudFunctions 15 | deploymentMetadata: 16 | environmentType: GenTwo 17 | service: 18 | serviceRef: hello_http 19 | serviceInputs: 20 | serviceDefinition: 21 | type: GoogleCloudFunctions 22 | spec: 23 | artifacts: 24 | primary: 25 | primaryArtifactRef: <+input> 26 | sources: <+input> 27 | environment: 28 | environmentRef: harnessdevenv 29 | deployToAll: false 30 | infrastructureDefinitions: 31 | - identifier: gcpk8s 32 | execution: 33 | steps: 34 | - step: 35 | name: Deploy Cloud Function 36 | identifier: deployCloudFunction 37 | type: DeployCloudFunction 38 | timeout: 10m 39 | spec: {} 40 | rollbackSteps: 41 | - step: 42 | name: Rollback Cloud Function 43 | identifier: cloudFunctionRollback 44 | type: CloudFunctionRollback 45 | timeout: 10m 46 | spec: {} 47 | tags: {} 48 | failureStrategies: 49 | - onFailure: 50 | errors: 51 | - AllErrors 52 | action: 53 | type: StageRollback 54 | -------------------------------------------------------------------------------- /sock-shop/base/shipping-dep.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: shipping 6 | labels: 7 | name: shipping 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | name: shipping 13 | template: 14 | metadata: 15 | labels: 16 | name: shipping 17 | spec: 18 | containers: 19 | - name: shipping 20 | image: weaveworksdemos/shipping:0.4.8 21 | env: 22 | - name: ZIPKIN 23 | value: zipkin.jaeger.svc.cluster.local 24 | - name: JAVA_OPTS 25 | value: -Xms64m -Xmx128m -XX:PermSize=32m -XX:MaxPermSize=64m -XX:+UseG1GC -Djava.security.egd=file:/dev/urandom 26 | resources: 27 | limits: 28 | cpu: 300m 29 | memory: 500Mi 30 | requests: 31 | cpu: 300m 32 | memory: 500Mi 33 | ports: 34 | - containerPort: 80 35 | securityContext: 36 | runAsNonRoot: true 37 | runAsUser: 10001 38 | capabilities: 39 | drop: 40 | - all 41 | add: 42 | - NET_BIND_SERVICE 43 | readOnlyRootFilesystem: true 44 | volumeMounts: 45 | - mountPath: /tmp 46 | name: tmp-volume 47 | livenessProbe: 48 | httpGet: 49 | path: /health 50 | port: 80 51 | initialDelaySeconds: 300 52 | periodSeconds: 3 53 | readinessProbe: 54 | httpGet: 55 | path: /health 56 | port: 80 57 | initialDelaySeconds: 180 58 | periodSeconds: 3 59 | volumes: 60 | - name: tmp-volume 61 | emptyDir: 62 | medium: Memory 63 | nodeSelector: 64 | beta.kubernetes.io/os: linux 65 | -------------------------------------------------------------------------------- /custom-usecases/Custom-deployment-for-Lambda-Functions/Pipeline-using-custom-stage/Description.md: -------------------------------------------------------------------------------- 1 | # Deploy AWS Lambda Function Using Custom Stage 2 | 3 | In this example, let's understand how to deploy a Lambda using a custom stage. 4 | 5 | ## Pipeline Overview 6 | 7 | The pipeline consists of a custom stage with a container step that deploys a Lambda function. 8 | 9 | **Key Takeaways:** 10 | 1. The artifact source used here is AWS S3. 11 | 2. The artifact size can be of any size. 12 | 3. The script will check if the function exists in Lambda and updates it if it exists or creates a new function. 13 | 4. It deploys the Lambda function. 14 | 15 | ## Configuring Container Step 16 | 17 | - **Name:** 18 | Name for the Container step. 19 | 20 | - **Timeout:** 21 | How long you want Harness to try to complete the step before failing and initiating the stage or step failure strategy. 22 | 23 | - **Container Registry:** 24 | We use the Docker connector. 25 | 26 | - **Image:** 27 | Here we use the AWS CLI provided by Amazon: 28 | `amazon/aws-cli:2.24.5` 29 | This is a public image officially provided by AWS. 30 | 31 | - **Command:** 32 | In the command, you provide the shell script to fetch the artifact from the S3 bucket and deploy it. 33 | 34 | **Infrastructure Settings** 35 | 36 | - **Connector:** 37 | Provide the Harness connector to connect to the cluster. 38 | 39 | - **Namespace:** 40 | The namespace in the cluster where you want to run the step. 41 | 42 | The connector for this case can be an AWS connector connecting the EC2 or EKS cluster, or any Kubernetes cluster, as we provide the credentials required in the script. 43 | 44 | Here is the [pipeline.yaml](/custom-usecases/Custom-deployment-for-Lambda-Functions/Pipeline-using-custom-stage/pipeline.yaml) file for a working sample. 45 | -------------------------------------------------------------------------------- /jsonnet-guestbook-tla/guestbook-ui.jsonnet: -------------------------------------------------------------------------------- 1 | function ( 2 | containerPort=80, 3 | image="gcr.io/heptio-images/ks-guestbook-demo:0.1", 4 | name="jsonnet-guestbook-ui", 5 | replicas=3, 6 | servicePort=80, 7 | type="LoadBalancer" 8 | ) 9 | [ 10 | { 11 | "apiVersion": "v1", 12 | "kind": "Service", 13 | "metadata": { 14 | "name": name 15 | }, 16 | "spec": { 17 | "ports": [ 18 | { 19 | "port": servicePort, 20 | "targetPort": containerPort 21 | } 22 | ], 23 | "selector": { 24 | "app": name 25 | }, 26 | "type": type 27 | } 28 | }, 29 | { 30 | "apiVersion": "apps/v1", 31 | "kind": "Deployment", 32 | "metadata": { 33 | "name": name 34 | }, 35 | "spec": { 36 | "replicas": replicas, 37 | "revisionHistoryLimit": 3, 38 | "selector": { 39 | "matchLabels": { 40 | "app": name 41 | }, 42 | }, 43 | "template": { 44 | "metadata": { 45 | "labels": { 46 | "app": name 47 | } 48 | }, 49 | "spec": { 50 | "containers": [ 51 | { 52 | "image": image, 53 | "name": name, 54 | "ports": [ 55 | { 56 | "containerPort": containerPort 57 | } 58 | ] 59 | } 60 | ] 61 | } 62 | } 63 | } 64 | } 65 | ] 66 | -------------------------------------------------------------------------------- /blue-green/templates/rollout.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: harnessproj.io/v1alpha1 2 | kind: Rollout 3 | metadata: 4 | name: {{ template "helm-guestbook.fullname" . }} 5 | labels: 6 | app: {{ template "helm-guestbook.name" . }} 7 | chart: {{ template "helm-guestbook.chart" . }} 8 | release: {{ .Release.Name }} 9 | heritage: {{ .Release.Service }} 10 | spec: 11 | replicas: {{ .Values.replicaCount }} 12 | revisionHistoryLimit: 3 13 | selector: 14 | matchLabels: 15 | app: {{ template "helm-guestbook.name" . }} 16 | release: {{ .Release.Name }} 17 | strategy: 18 | blueGreen: 19 | activeService: {{ template "helm-guestbook.fullname" . }} 20 | previewService: {{ template "helm-guestbook.fullname" . }}-preview 21 | template: 22 | metadata: 23 | labels: 24 | app: {{ template "helm-guestbook.name" . }} 25 | release: {{ .Release.Name }} 26 | spec: 27 | containers: 28 | - name: {{ .Chart.Name }} 29 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 30 | imagePullPolicy: {{ .Values.image.pullPolicy }} 31 | ports: 32 | - name: http 33 | containerPort: 80 34 | protocol: TCP 35 | livenessProbe: 36 | httpGet: 37 | path: / 38 | port: http 39 | readinessProbe: 40 | httpGet: 41 | path: / 42 | port: http 43 | resources: 44 | {{ toYaml .Values.resources | indent 12 }} 45 | {{- with .Values.nodeSelector }} 46 | nodeSelector: 47 | {{ toYaml . | indent 8 }} 48 | {{- end }} 49 | {{- with .Values.affinity }} 50 | affinity: 51 | {{ toYaml . | indent 8 }} 52 | {{- end }} 53 | {{- with .Values.tolerations }} 54 | tolerations: 55 | {{ toYaml . | indent 8 }} 56 | {{- end }} 57 | -------------------------------------------------------------------------------- /custom-usecases/Dynamic-deployment-for-Multi-env-usecase-2/chained-pipeline.yaml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | projectIdentifier: projectIdentifier 3 | orgIdentifier: default 4 | tags: {} 5 | stages: 6 | - stage: 7 | name: deploy 8 | identifier: deploy 9 | description: "" 10 | type: Deployment 11 | spec: 12 | deploymentType: Asg 13 | service: 14 | serviceRef: ASGService 15 | serviceInputs: 16 | serviceDefinition: 17 | type: Asg 18 | spec: 19 | artifacts: 20 | primary: 21 | primaryArtifactRef: <+input> 22 | sources: <+input> 23 | environmentGroup: 24 | envGroupRef: ritenvironmentgroup 25 | metadata: 26 | parallel: true 27 | deployToAll: true 28 | environments: <+input> 29 | execution: 30 | steps: 31 | - step: 32 | type: ShellScript 33 | name: ShellScript_1 34 | identifier: ShellScript_1 35 | spec: 36 | shell: Bash 37 | executionTarget: {} 38 | source: 39 | type: Inline 40 | spec: 41 | script: echo "deploying" 42 | environmentVariables: [] 43 | outputVariables: [] 44 | timeout: 10m 45 | rollbackSteps: [] 46 | tags: {} 47 | failureStrategies: 48 | - onFailure: 49 | errors: 50 | - AllErrors 51 | action: 52 | type: StageRollback 53 | identifier: asgdeployenvgroups_manualselect 54 | name: asg-deploy-env-groups - manual-select 55 | -------------------------------------------------------------------------------- /deploy-own-app/cd-pipeline/bluegreen-pipeline.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: ownapp_bluegreen_pipeline 3 | identifier: ownapp_bluegreen_pipeline 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: deploy-ownapp 10 | identifier: deployownapp 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: Kubernetes 15 | service: 16 | serviceRef: ownappservice 17 | environment: 18 | environmentRef: ownappdevenv 19 | deployToAll: false 20 | infrastructureDefinitions: 21 | - identifier: ownappk8sinfra 22 | execution: 23 | steps: 24 | - step: 25 | name: Stage Deployment 26 | identifier: stageDeployment 27 | type: K8sBlueGreenDeploy 28 | timeout: 10m 29 | spec: 30 | skipDryRun: false 31 | pruningEnabled: false 32 | - step: 33 | name: Swap primary with stage service 34 | identifier: bgSwapServices 35 | type: K8sBGSwapServices 36 | timeout: 10m 37 | spec: 38 | skipDryRun: false 39 | rollbackSteps: 40 | - step: 41 | name: Swap primary with stage service 42 | identifier: rollbackBgSwapServices 43 | type: K8sBGSwapServices 44 | timeout: 10m 45 | spec: 46 | skipDryRun: false 47 | tags: {} 48 | failureStrategies: 49 | - onFailure: 50 | errors: 51 | - AllErrors 52 | action: 53 | type: StageRollback 54 | -------------------------------------------------------------------------------- /helm-hooks/manifests.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: batch/v1 3 | kind: Job 4 | metadata: 5 | generateName: upgrade-sql-schema 6 | annotations: 7 | helm.sh/hook: pre-install 8 | helm.sh/hook-weight: "-2" 9 | spec: 10 | template: 11 | spec: 12 | containers: 13 | - name: upgrade-sql-schema 14 | image: alpine:latest 15 | command: ["sleep", "5"] 16 | restartPolicy: Never 17 | --- 18 | apiVersion: batch/v1 19 | kind: Job 20 | metadata: 21 | name: maint-page-up 22 | annotations: 23 | helm.sh/hook: pre-install 24 | helm.sh/hook-delete-policy: before-hook-creation 25 | helm.sh/hook-weight: "-1" 26 | spec: 27 | template: 28 | spec: 29 | containers: 30 | - name: page-up 31 | image: alpine:latest 32 | command: ["sleep", "2"] 33 | restartPolicy: Never 34 | backoffLimit: 0 35 | --- 36 | apiVersion: apps/v1 37 | kind: ReplicaSet 38 | metadata: 39 | name: frontend 40 | spec: 41 | replicas: 1 42 | selector: 43 | matchLabels: 44 | tier: frontend 45 | template: 46 | metadata: 47 | labels: 48 | tier: frontend 49 | spec: 50 | containers: 51 | - name: main 52 | image: nginx:latest 53 | --- 54 | apiVersion: v1 55 | kind: Service 56 | metadata: 57 | name: frontend 58 | annotations: 59 | helm.sh/hook-weight: "2" 60 | spec: 61 | selector: 62 | tier: frontend 63 | ports: 64 | - protocol: TCP 65 | port: 80 66 | targetPort: 80 67 | --- 68 | apiVersion: batch/v1 69 | kind: Job 70 | metadata: 71 | name: maint-page-down 72 | annotations: 73 | helm.sh/hook: post-install 74 | helm.sh/hook-delete-policy: before-hook-creation 75 | spec: 76 | template: 77 | spec: 78 | containers: 79 | - name: page-down 80 | image: alpine:latest 81 | command: ["sleep", "2"] 82 | restartPolicy: Never 83 | -------------------------------------------------------------------------------- /guestbook/harnesscd-pipeline/bluegreen-pipeline.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | name: guestbook_bluegreen_pipeline 3 | identifier: guestbook_bluegreen_pipeline 4 | projectIdentifier: default_project 5 | orgIdentifier: default 6 | tags: {} 7 | stages: 8 | - stage: 9 | name: deploy-guestbook 10 | identifier: deployguestbook 11 | description: "" 12 | type: Deployment 13 | spec: 14 | deploymentType: Kubernetes 15 | service: 16 | serviceRef: harnessguestbook 17 | environment: 18 | environmentRef: harnessdevenv 19 | deployToAll: false 20 | infrastructureDefinitions: 21 | - identifier: harnessk8sinfra 22 | execution: 23 | steps: 24 | - step: 25 | name: Stage Deployment 26 | identifier: stageDeployment 27 | type: K8sBlueGreenDeploy 28 | timeout: 10m 29 | spec: 30 | skipDryRun: false 31 | pruningEnabled: false 32 | - step: 33 | name: Swap primary with stage service 34 | identifier: bgSwapServices 35 | type: K8sBGSwapServices 36 | timeout: 10m 37 | spec: 38 | skipDryRun: false 39 | rollbackSteps: 40 | - step: 41 | name: Swap primary with stage service 42 | identifier: rollbackBgSwapServices 43 | type: K8sBGSwapServices 44 | timeout: 10m 45 | spec: 46 | skipDryRun: false 47 | tags: {} 48 | failureStrategies: 49 | - onFailure: 50 | errors: 51 | - AllErrors 52 | action: 53 | type: StageRollback 54 | --------------------------------------------------------------------------------