Concourse pipeline to create PKS (Pivotal Kubernetes Service) clusters.
You will need:
- Concourse
- The provided docker image
- Access to a repository containing your cluster.json and/or playground.json files
- A front-end system to write to cluster.json and/or playground.json files
- create-cluster.yml can be used to create clusters you plan keep
- pks-playground.yml contains the logic to create a long-term pks cluster or a test cluster to be deleted in 7 days. This pipeline also contains the job the run the cleanup process for temporary clusters
- cluster.json is used to store cluster owner data for long-term clusters
- playground.json is used to maintain information about temporary clusters. The playground will create a cluster avilable for 7 days. Once the cluster expires, the cluster will be deleted via the concourse pipeline.
- Pipeline is trigger upon commit to either cluster.json or playground.json
- Grafana URL and PKS API are added to no_proxy list. (Remove if you are luckly enough to not have a Proxy server to mess with)
- https://kubernetes-charts.storage.googleapis.com is added to helm repo list
- Log into pks API
- Reads from cluster.json or playground.json
- For each cluster in the list, attempt to create. If it exists it will fail. No harm done.
- Add master node IP to no_proxy
- Add requestor to cluster manager binding
- Create monitoring namespace to be used by Prometheus
- Create a new storage class to be used by Prometheus persistent storage
- Add prometheus-operator-operator to cluster developer role binding
- Add service account
- prometheus-operator-prometheus
- prometheus-operator-admission
- prometheus-operator-grafana
- prometheus-operator-operator
- Run helm to install prometheus. Alter to match your needs
helm upgrade prometheus-operator -i \
-f pks-cluster-repo/${PKS_ENV}/values-prometheus.yml \
--namespace monitoring \
--set grafana.service.type=LoadBalancer \
--set grafana.enabled=true \
--set grafana.adminPassword=RandomP@55w0rd \
--set global.rbac.pspEnabled=false \
--set grafana.testFramework.enabled=false \
--set alertmanager.enabled=false \
--set prometheus.service.type=LoadBalancer \
--set kubeTargetVersionOverride="$(kubectl version --short | grep -i server | awk '{print $3}' | cut -c2-1000)" \
stable/prometheus-operator
- If Change made to cluster.json
- Using provided Grafana URL and API token, the prometheus end-point is added your grafana data sources
- Email is sent to the requestor with all information they need to connect to their new kubernetes cluster
bsmith, I'm happy to report you have a temporary fresh cluster named cluster1. The userID bsmith has been granted the
Cluster Manager Role binding. Your cluster will be deleted on 03/02/2020
PKS Cluster creation results
PKS Version: 1.6.1-build.6
Name: cluster1
K8s Version: 1.15.5
Plan Name: small
UUID: 149e6751-b438-481a-9ae0-84be2583dd1c
Last Action: CREATE
Last Action State: succeeded
Last Action Description: Instance provisioning completed
Kubernetes Master Host: cluster1.xxxx.xxxx.xxx
Kubernetes Master Port: 8443
Worker Nodes: 3
Kubernetes Master IP(s): x.x.116.93
Network Profile Name:
________________________________________
Getting Started
Please follow the getting started link: GETTING STARTED
________________________________________
PKS Admins, if you so desire, add http://x.x.116.98:9090 as a new prometheus datasource
bsmith, I'm happy to report you have a fresh cluster named long_term_cluster. The userID bsmith has been granted the Cluster Manager Role binding.
PKS Cluster creation results
PKS Version: 1.6.1-build.6
Name: long_term_cluster
K8s Version: 1.15.5
Plan Name: small
UUID: 95cebdd8-fa44-4988-9da0-4143e18257c8
Last Action: CREATE
Last Action State: succeeded
Last Action Description: Instance provisioning completed
Kubernetes Master Host: long_term_cluster.xxxx.xxxx.xxx
Kubernetes Master Port: 8443
Worker Nodes: 1
Kubernetes Master IP(s): xx.xx.116.156
Network Profile Name:
________________________________________
Getting Started
Please follow the getting started link: GETTING STARTED