Skip to content

Commit

Permalink
Added Tier based deployment support, minikube support, Helm unit test…
Browse files Browse the repository at this point in the history
… cases, Auto-publish to bintray (#26)

* Added Tier based deployment support
* Minikube support
* Helm unit test cases
* Auto-publish to bintray
  • Loading branch information
MadhuriArugula authored and arvasrikanth committed Nov 7, 2019
1 parent b67d80d commit 754066f
Show file tree
Hide file tree
Showing 104 changed files with 5,453 additions and 525 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
**/charts/*.tgz
**/requirements.lock


# Generated example yaml
/build
*.tar.gz

# OSX trash
.DS_Store

#terratest
**/terratest/pkg/*
**/terratest/bin/*
**/terratest/src/test/vendor
100 changes: 66 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,85 @@
---
language: python
env:
global:
- HELM_URL=https://storage.googleapis.com/kubernetes-helm
- HELM_TGZ=helm-v2.11.0-linux-amd64.tar.gz
- HELM_TGZ=helm-v2.14.0-linux-amd64.tar.gz
- YAMLLINT_VERSION=1.15.0
install:
# Install Helm
- wget -q ${HELM_URL}/${HELM_TGZ}
- tar xzfv ${HELM_TGZ}
- PATH=`pwd`/linux-amd64/:$PATH
- helm init --client-only
# Install pip deps
# Install YamlLint
- sudo pip install yamllint=="${YAMLLINT_VERSION}"
# Install Go
- wget -c https://storage.googleapis.com/golang/go1.7.3.linux-amd64.tar.gz
- sudo tar -C /usr/local -xvzf go1.7.3.linux-amd64.tar.gz
- export PATH=$PATH:/usr/local/go/bin
script:
# Check YAML styling
- yamllint -c .yamllint.yml -s $(find . -type f -name "Chart.yaml")
- yamllint -c .yamllint.yml -s $(find . -type f -name "values.yaml")
- yamllint -c .yamllint.yml -s $(find . -type f -name "values*.yaml")
# Now load the helm dependencies
- make dependencies
# Run Helm lint
- helm lint ./charts/pega
- helm lint ./charts/pega
- helm lint ./charts/addons
# Run GO helm unit tests
- mkdir $TRAVIS_BUILD_DIR/terratest/bin
- export GOPATH=$TRAVIS_BUILD_DIR/terratest
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- export PATH=$PATH:$TRAVIS_BUILD_DIR/terratest/bin
- cd terratest/src/test
- dep ensure
- go test deploy_test.go common_utility.go deployment_utility.go
- go test install_test.go common_utility.go installer_utility.go
- go test install_deploy_test.go common_utility.go deployment_utility.go installer_utility.go
- go test upgrade_test.go common_utility.go installer_utility.go
- go test upgrade_deploy_test.go common_utility.go deployment_utility.go installer_utility.go
- go test aks_deploy_test.go common_utility.go deployment_utility.go installer_utility.go
- go test eks_deploy_test.go common_utility.go deployment_utility.go
- go test openshift_test.go common_utility.go deployment_utility.go
- go test invalidAction_test.go
- cd $TRAVIS_BUILD_DIR
- chmod 777 before_deploy.sh
before_deploy:
- ./before_deploy.sh
- make examples
deploy:
provider: releases
api_key:
secure: >
GuZqxcgBOueUOJWg6t5NaCTIssfkptgdAjwyWm/6SaVXqs9Kdgy
EawtYSu0WLh815qGmuxgVjMbvvkAvtbBXanKH+BheRl1cQjYnza
XJlL+Oa/xxzCqz1n4txqtDMR7l/loqrMTzCRe2bZ806z3+uXpXh
CO12+LwvMDJAAddDkX+2wRE240/1f/0lVlZ2lNzgBitC63jAf1H
ml3/KrgHsTYvNB5M6qKn8C24DcC6PMe012K3hL0O+F+er9Mb39R
FcSLTjF/6AiLvpK4oDAg8sBgciXVq0FPhCXvjbINGB/AY7jM5Ql
0A6ngngZjsjefn+NbtZ3aK230h2m0XM+dN7FJCbtRQeqvczcwRT
/wpDimpzFR0rf/NdXV4G+UZYI6a3bjqKYP5IPN8BbzVo8KzlbGW
JeJLV40gW7EbdyT57R2dNp46I17c1KL8atQH97n3yv9d9ZaC87O
6tOohLmue7L3lKxPDpY60VFna5BjJwvrhW4gvsd11Ko4c39FSu8
ogBSZ6E1EOlmVZDX+cBjuw4dGihcrHqWW5V3k2X/ksAKb+4A74g
AG8pCr/ifPEj9kTWb71IIF5RHkD6JqeGJdKaWFHDpWlYhKNTLRt
3gmcgdLmM5MN9A5khwBzPYiF5oaWT1COxh/Rjdz5V0+jUvyRvc9
a/rvc6hM6quXSmlAwA0U=
file:
- pega-kubernetes-example.tar.gz
- pega-openshift-example.tar.gz
- pega-azure-aks-example.tar.gz
- pega-aws-eks-example.tar.gz
- pega-google-gke-example.tar.gz
- pega-pivotal-pks-example.tar.gz
skip_cleanup: true
on:
repo: pegasystems/pega-helm-charts
tags: true
- provider: releases
api_key:
secure: >
GuZqxcgBOueUOJWg6t5NaCTIssfkptgdAjwyWm/6SaVXqs9Kdgy
EawtYSu0WLh815qGmuxgVjMbvvkAvtbBXanKH+BheRl1cQjYnza
XJlL+Oa/xxzCqz1n4txqtDMR7l/loqrMTzCRe2bZ806z3+uXpXh
CO12+LwvMDJAAddDkX+2wRE240/1f/0lVlZ2lNzgBitC63jAf1H
ml3/KrgHsTYvNB5M6qKn8C24DcC6PMe012K3hL0O+F+er9Mb39R
FcSLTjF/6AiLvpK4oDAg8sBgciXVq0FPhCXvjbINGB/AY7jM5Ql
0A6ngngZjsjefn+NbtZ3aK230h2m0XM+dN7FJCbtRQeqvczcwRT
/wpDimpzFR0rf/NdXV4G+UZYI6a3bjqKYP5IPN8BbzVo8KzlbGW
JeJLV40gW7EbdyT57R2dNp46I17c1KL8atQH97n3yv9d9ZaC87O
6tOohLmue7L3lKxPDpY60VFna5BjJwvrhW4gvsd11Ko4c39FSu8
ogBSZ6E1EOlmVZDX+cBjuw4dGihcrHqWW5V3k2X/ksAKb+4A74g
AG8pCr/ifPEj9kTWb71IIF5RHkD6JqeGJdKaWFHDpWlYhKNTLRt
3gmcgdLmM5MN9A5khwBzPYiF5oaWT1COxh/Rjdz5V0+jUvyRvc9
a/rvc6hM6quXSmlAwA0U=
file:
- pega-kubernetes-example.tar.gz
- pega-openshift-example.tar.gz
- pega-azure-aks-example.tar.gz
- pega-aws-eks-example.tar.gz
- pega-google-gke-example.tar.gz
- pega-pivotal-pks-example.tar.gz
skip_cleanup: true
on:
repo: pegasystems/pega-helm-charts
tags: true
- provider: bintray
file: descriptor.json
user: bintrayautomation
key:
secure: M1CPmmjJ1OI2luWFRW9Aqregj3b4rQLSnP4ROurkHkewB+HwoZ+QHAQ4JJD0B+br2AddaGKgN1rdzYpyvg0Cl7ZhWnMb96bE+lVbmDzYnUc+Iwd8/PWXNoaFuB5sn5LPVESe8H/ZLdP0IyMbBknBDgdNgKpD9XqH7/UrrNT9jvZSpGFAcMCwLVFiQ1auusnSLOYVr611JadpNZarx7QgPLBtlit+cfi/vEGy7GyYTtFzSbM86gBnm1kViSVM4w1bE4cFs+14KVNiNiwpSzFzK/gBncqQVTz6yaD3bV48Cla5sz3/sDkh3If7pUhcmMYyy9BPk35176TWTHKcqATv/5GxDvQpgaBMlyl0Dhwhb2d++ZZ6V+kYYj+Uf4m4NaxGV6WNrUnW+IPw9qlBWFHnw17u80HU5GapXXNedUi2CjzrH25A0Y6DHqfZubDBXJh31RfWKz0r58bLSGLYxdl96purfLUCeSrsKkZAWS59EmpXiR/f+zSbNmlpG+ryVBsQIPG+cwdPSVUdGBGVp3QzEjVze6gABSQ/2GaMeRterjzBypi8ab4vbIyxY905deoMAwcQHUcvybpNJfRcaowToK0BnMNhy8pn26KYct3oGLVxQe6rlGbQNZrFePSCyNd/ZfYlkWDcLh/j0OH0gdspHTdDfsy8dgS8QzvgNsNKRHk=
skip_cleanup: true
on:
all_branches: true
tags: true
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# How to contribute

## Getting Started

* Make sure you have a [GitHub account](https://github.com/signup/free)
* Submit a ticket for your issue, assuming one does not already exist.
* Clearly describe the issue including steps to reproduce when it is a bug.
* Make sure you fill in the earliest version that you know has the issue.
* Fork the repository on GitHub

## Making Changes

* Create a topic branch from where you want to base your work.
* This is usually the master branch.
* Only target release branches if you are certain your fix must be on that
branch.
* To quickly create a topic branch based on master; `git checkout -b
fix/master/my_contribution master`. Please avoid working directly on the
`master` branch.
* Make commits of logical units.
* Check for unnecessary whitespace with `git diff --check` before committing.
* Make sure your commit messages are in the proper format:

`ISSUE-1234: terse and to the point message describing change`

* Make sure you have added the necessary tests for your changes.
* Run _all_ the tests to assure nothing else was accidentally broken.
* Make sure you've done a squash and rebase before submitting

## Submitting Changes

* Push your changes to a topic branch in your fork of the repository.
* Submit a pull request.
* After feedback has been given we expect responses within two weeks. After two
weeks we may close the pull request if it isn't showing any activity.

# Additional Resources

* [General GitHub documentation](https://help.github.com/)
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
44 changes: 23 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,64 +1,66 @@
dependencies:
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
helm repo list
helm repo add stable https://kubernetes-charts.storage.googleapis.com
helm repo list
helm dependency update ./charts/pega/
helm dependency update ./charts/addons/

examples: dependencies
examples:
mkdir -p ./build/kubernetes
helm template ./charts/pega/ \
--output-dir ./build/kubernetes \
--values ./charts/pega/values.yaml \
--namespace example \
--set provider=k8s \
--set actions.execute=deploy
tar -C ./build/kubernetes/pega/templates -cvzf ./pega-kubernetes-example.tar.gz .
--set global.provider=k8s \
--set global.actions.execute=deploy
tar -C ./build/kubernetes/pega -cvzf ./pega-kubernetes-example.tar.gz .

mkdir -p ./build/openshift
helm template ./charts/pega/ \
--output-dir ./build/openshift \
--values ./charts/pega/values.yaml \
--namespace example \
--set provider=openshift \
--set actions.execute=deploy
tar -C ./build/openshift/pega/templates -cvzf ./pega-openshift-example.tar.gz .
--set global.provider=openshift \
--set global.actions.execute=deploy
tar -C ./build/openshift/pega -cvzf ./pega-openshift-example.tar.gz .

mkdir -p ./build/aws-eks
helm template ./charts/pega/ \
--output-dir ./build/aws-eks \
--values ./charts/pega/values.yaml \
--namespace example \
--set provider=eks \
--set actions.execute=deploy
tar -C ./build/aws-eks/pega/templates -cvzf ./pega-aws-eks-example.tar.gz .
--set global.provider=eks \
--set global.actions.execute=deploy
tar -C ./build/aws-eks/pega -cvzf ./pega-aws-eks-example.tar.gz .

mkdir -p ./build/azure-aks
helm template ./charts/pega/ \
--output-dir ./build/azure-aks \
--values ./charts/pega/values.yaml \
--namespace example \
--set provider=aks \
--set actions.execute=deploy
tar -C ./build/azure-aks/pega/templates -cvzf ./pega-azure-aks-example.tar.gz .
--set global.provider=aks \
--set global.actions.execute=deploy
tar -C ./build/azure-aks/pega -cvzf ./pega-azure-aks-example.tar.gz .

mkdir -p ./build/google-gke
helm template ./charts/pega/ \
--output-dir ./build/google-gke \
--values ./charts/pega/values.yaml \
--namespace example \
--set provider=gke \
--set actions.execute=deploy
tar -C ./build/google-gke/pega/templates -cvzf ./pega-google-gke-example.tar.gz .
--set global.provider=gke \
--set global.actions.execute=deploy
tar -C ./build/google-gke/pega -cvzf ./pega-google-gke-example.tar.gz .

mkdir -p ./build/pivotal-pks
helm template ./charts/pega/ \
--output-dir ./build/pivotal-pks \
--values ./charts/pega/values.yaml \
--namespace example \
--set provider=pks \
--set actions.execute=deploy
tar -C ./build/pivotal-pks/pega/templates -cvzf ./pega-pivotal-pks-example.tar.gz .
--set global.provider=pks \
--set global.actions.execute=deploy
tar -C ./build/pivotal-pks/pega -cvzf ./pega-pivotal-pks-example.tar.gz .

clean:
rm -rf ./build
rm -rf ./charts/pega/charts/*
rm -rf ./*.tar.gz
rm -rf ./*.tar.gz
65 changes: 58 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# Pega Deployment on Kubernetes
# Pega deployment on Kubernetes

This project provides Helm charts and basic examples for deploying Pega on Kubernetes. This project **does not include** the required database installation image which you [may obtain from the Pega Community](https://community.pega.com/knowledgebase/products/platform/deploy). Deploying Pega on Kubernetes requires Pega Infinity 8.2 or newer.
This project provides Helm charts and basic examples for deploying Pega on Kubernetes. You will also need to download the required [installation kit](https://community.pega.com/knowledgebase/products/platform/deploy) from the Pega Community which includes rules and data to preload into your relational database. Deploying Pega on Kubernetes requires Pega Infinity 8.2 or newer.

[![Build Status](https://travis-ci.org/pegasystems/pega-helm-charts.svg?branch=master)](https://travis-ci.org/pegasystems/pega-helm-charts)
[![GitHub release](https://img.shields.io/github/release/pegasystems/pega-helm-charts.svg)](https://github.com/pegasystems/pega-helm-charts/releases)

## Getting Started
# Supported Kubernetes environments

Pegasystems has validated deployments on the following Kubernetes IaaS and PaaS environments.

* Open-source Kubernetes (and [MiniKube for personal deployments](docs/RUNBOOK_MINIKUBE.md))
* Microsoft Azure Kubernetes Service (AKS)
* Amazon Elastic Kubernetes Service (EKS)
* Google Kubernetes Engine (GKE)
* Red Hat OpenShift
* Pivotal Container Service (PKS)

# Getting started

This project assumes you have an installation of Kubernetes available and have Helm installed locally. The following commands will verify your installation. The exact output may be slightly different, but they should return without error.
```console
Expand All @@ -22,12 +33,52 @@ Server: &version.Version{SemVer:"v2.12.2", GitCommit:"7d2b0c73d734f6586ed222a567

Start by performing a clone (or download) of the latest Charts.

`` git clone https://github.com/pegasystems/pega-helm-charts.git ``
```bash
git clone https://github.com/pegasystems/pega-helm-charts.git
```

Navigate to the project directory and open the values.yaml file. This is the configuration file that tells Helm what and how to deploy. For additional documentation covering the different deployment options, see the Pega Community article on [Deploying the Pega Platform by using Kubnernetes](https://community.pega.com/knowledgebase/articles/deploying-pega-platform-using-kubernetes).
## Update dependencies

## Dependencies
The Pega charts depends on other charts supplied by third parties. These are called out in the requirements yaml file for the [pega](charts/pega/requirements.yaml) and [addons](charts/addons/requirements.yaml) charts. Individual dependencies may or may not be deployed based on the configuration of your values.yaml files. When you first setup your helm chart, you will need to update your dependencies to pull down these additional charts from their repositories. For convenience, the required commands are part of the [Makefile](Makefile) and can run with the following command.

The Pega chart depends on other charts supplied by third parties. These are called out in the [requirements yaml file](charts/pega/requirements.yaml). Individual dependencies may or may not be deployed based on the configuration of your values.yaml file. When you first setup your helm chart, you will need to update your dependencies to pull down these additional charts from their repositories. For convenience, the required commands are part of the [Makefile](Makefile) and can run with the ```make dependencies``` command.
```bash
make dependencies
```

For more information about Helm dependencies, see the [Helm documentation](https://helm.sh/docs/helm/#helm-dependency).

## Configure and install using the charts

There are two charts available in this repository - *addons* and *pega*.

The addons chart installs a collection of supporting services and tools required for a Pega deployment. The services you will need to deploy will depend on your cloud environment - for example you may need a load balancer on Minikube, but not for EKS. These supporting services are deployed once per Kubernetes environment, regardless of how many Pega Infinity instances are deployed.

[Instructions to configure the Pega addons](charts/addons/README.md)

To install the addons chart, run the following helm command after configuring your values.yaml file.

```bash
helm install . -n pegaaddons --namespace pegaaddons --values /home/user/my-overridden-values.yaml
```

After installing the addons, you can deploy Pega. Before installing using the chart, it is a good idea to review the detailed [deployment guide](https://community.pega.com/knowledgebase/articles/deploying-pega-platform-using-kubernetes) to understand how Pega deploys as a distributed system. Running a Helm installation using the pega chart installs a Pega Infinity instance into a specified namespace.

[Instructions to configure the Pega chart](charts/pega/README.md)

To install the pega chart, run the following helm command after configuring your values.yaml file.

```bash
helm install . -n mypega --namespace myproject --values /home/user/my-overridden-values.yaml
```

To delete this chart, enter:

```bash
helm delete mypega --purge
```

Navigate to the project directory and open the values.yaml file. This is the configuration file that tells Helm what and how to deploy. For additional documentation covering the different deployment options, see the Pega Community article on [Deploying the Pega Platform by using Kubnernetes](https://community.pega.com/knowledgebase/articles/deploying-pega-platform-using-kubernetes).

# Contributing

This is an open source project and contributions are welcome. Please see the [contributing guidelines](./CONTRIBUTING.md) to get started.
12 changes: 12 additions & 0 deletions before_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# CHART_VERSION is computed from the TAG details of the commit. Every Github release creates tag with the release name.
# Release name (or) Tag name should be in vX.X.X format. Helm CHART_VERSION would be X.X.X
export CHART_VERSION=$(expr ${TRAVIS_TAG:1})
export PEGA_FILE_NAME=pega-${CHART_VERSION}.tgz
export ADDONS_FILE_NAME=addons-${CHART_VERSION}.tgz
cat descriptor-template.json | jq '.files[0].includePattern=env.PEGA_FILE_NAME' | jq '.files[0].uploadPattern=env.PEGA_FILE_NAME' | jq '.files[1].includePattern=env.ADDONS_FILE_NAME' | jq '.files[1].uploadPattern=env.ADDONS_FILE_NAME' > descriptor.json
curl -o index.yaml https://dl.bintray.com/pegasystems/pega-helm-charts/index.yaml
helm package --version ${CHART_VERSION} ./charts/pega/
helm package --version ${CHART_VERSION} ./charts/addons/
helm repo index --merge index.yaml --url https://dl.bintray.com/pegasystems/pega-helm-charts/ .
22 changes: 22 additions & 0 deletions charts/addons/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/addons/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: addons
version: 1.2.0
Loading

0 comments on commit 754066f

Please sign in to comment.