KOPS template automation
Project description
# Kubernetes
![build-status](http://nginx.k8s.domainsecurity.cc/api/badges/ycliuhw/kforce/status.svg?branch=master)
----
<img src="https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png" width="100">
----
## Create and manage K8S cluster using templates in an automated way :>
> <https://github.com/kubernetes/kops/blob/master/docs/cluster_spec.md>
----
### directory structure
```text
├── Makefile
├── README.md
├── addons # some required pre-installed addon packages (monitoring, logging, helm server - tiller etc.)
│ ├── README.md
│ └── cluster_role.yaml
├── __generated__ # WARNING: supposed for version control auto-generated templates(`GitOps` -> version controlled infra), DO NOT make any changes here
│ ├── README.md
│ ├── cre-m.yaml
│ ├── aws-account1-s.yaml
│ └── domainsandbox-s.yaml
├── bin
│ └── kforce
├── lib
│ ├── aws_facts.py
│ ├── renderer.py
│ └── utils.py
├── requirements.txt
├── setup.cfg
├── templates # cluster global definition
│ ├── cluster.yaml # template
│ ├── values.yaml.j2 # configure
│ └── addons
│ ├── README.md
│ ├── autoscaler.yaml
│ ├── dashboard.yaml
│ ├── external-dns.yaml
│ ├── fluentd.yaml
│ ├── ingress-nginx-external.yaml
│ └── ingress-nginx-internal.yaml
└── vars # new cluster configure customization goes here
├── aws-account2
│ └── m.yaml
├── aws-account1
│ ├── m-addons
│ │ ├── grafama.yaml
│ │ ├── influxdb.yaml
│ │ ├── jenkins.yaml
│ │ └── prometheus.yaml
│ ├── s.yaml # IMPORTANT: `aws-account1-[s]taging` cluster configure - naming convention ([env].yaml)
│ ├── s-snippets # IMPORTANT: any additional `instance group` defines here(high memory, spot, etc.)
│ │ └── ig-spot.yaml # spot instance group definition
│ │ └── ig-high-memory.yaml # high memory instance group definition
│ ├── u.yaml # `aws-account1-[u]at` cluster with standard 3*node IG and spot IG
│ ├── u-snippets
│ │ └── ig-spot.yaml
│ └── m.yaml # `aws-account1-[m]anagement` cluster with standard 3*node IG
└── aws-account3
└── s.yaml
```
----
### create `kops` iam group, attach related policies, create user then add user to group:
```bash
AWS_PROFILE=[admin] make ensure_iam
```
### create access key for `kops` user
```bash
AWS_PROFILE=[admin] make create_access_key
```
### build kops template
```bash
AWS_PROFILE=[kops] make build account_name=[aws-account1] env=[s|p|u|m] vpc_id=vpc-xxxx
```
### diff kops template
```bash
AWS_PROFILE=[kops] make diff account_name=[aws-account1] env=[s|p|u|m] vpc_id=vpc-xxxx
```
![make diff](img/make-diff.png)
### apply kops template to create the cluster
```bash
AWS_PROFILE=[kops] make apply account_name=[aws-account1] env=[s|p|u|m] vpc_id=vpc-xxxx
```
![build-status](http://nginx.k8s.domainsecurity.cc/api/badges/ycliuhw/kforce/status.svg?branch=master)
----
<img src="https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png" width="100">
----
## Create and manage K8S cluster using templates in an automated way :>
> <https://github.com/kubernetes/kops/blob/master/docs/cluster_spec.md>
----
### directory structure
```text
├── Makefile
├── README.md
├── addons # some required pre-installed addon packages (monitoring, logging, helm server - tiller etc.)
│ ├── README.md
│ └── cluster_role.yaml
├── __generated__ # WARNING: supposed for version control auto-generated templates(`GitOps` -> version controlled infra), DO NOT make any changes here
│ ├── README.md
│ ├── cre-m.yaml
│ ├── aws-account1-s.yaml
│ └── domainsandbox-s.yaml
├── bin
│ └── kforce
├── lib
│ ├── aws_facts.py
│ ├── renderer.py
│ └── utils.py
├── requirements.txt
├── setup.cfg
├── templates # cluster global definition
│ ├── cluster.yaml # template
│ ├── values.yaml.j2 # configure
│ └── addons
│ ├── README.md
│ ├── autoscaler.yaml
│ ├── dashboard.yaml
│ ├── external-dns.yaml
│ ├── fluentd.yaml
│ ├── ingress-nginx-external.yaml
│ └── ingress-nginx-internal.yaml
└── vars # new cluster configure customization goes here
├── aws-account2
│ └── m.yaml
├── aws-account1
│ ├── m-addons
│ │ ├── grafama.yaml
│ │ ├── influxdb.yaml
│ │ ├── jenkins.yaml
│ │ └── prometheus.yaml
│ ├── s.yaml # IMPORTANT: `aws-account1-[s]taging` cluster configure - naming convention ([env].yaml)
│ ├── s-snippets # IMPORTANT: any additional `instance group` defines here(high memory, spot, etc.)
│ │ └── ig-spot.yaml # spot instance group definition
│ │ └── ig-high-memory.yaml # high memory instance group definition
│ ├── u.yaml # `aws-account1-[u]at` cluster with standard 3*node IG and spot IG
│ ├── u-snippets
│ │ └── ig-spot.yaml
│ └── m.yaml # `aws-account1-[m]anagement` cluster with standard 3*node IG
└── aws-account3
└── s.yaml
```
----
### create `kops` iam group, attach related policies, create user then add user to group:
```bash
AWS_PROFILE=[admin] make ensure_iam
```
### create access key for `kops` user
```bash
AWS_PROFILE=[admin] make create_access_key
```
### build kops template
```bash
AWS_PROFILE=[kops] make build account_name=[aws-account1] env=[s|p|u|m] vpc_id=vpc-xxxx
```
### diff kops template
```bash
AWS_PROFILE=[kops] make diff account_name=[aws-account1] env=[s|p|u|m] vpc_id=vpc-xxxx
```
![make diff](img/make-diff.png)
### apply kops template to create the cluster
```bash
AWS_PROFILE=[kops] make apply account_name=[aws-account1] env=[s|p|u|m] vpc_id=vpc-xxxx
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kforce-0.1.1.tar.gz
(3.1 kB
view details)
File details
Details for the file kforce-0.1.1.tar.gz
.
File metadata
- Download URL: kforce-0.1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c48166438c6ac492ee1fe5d3290f227bfce81494732c027f3a914c254e6198a3 |
|
MD5 | cabf48ff69737984a57781720dfc013f |
|
BLAKE2b-256 | 7bc94513cc4bb11d9d872316fb1a45cfe63dc86e87a7d713ddba5a64057a150a |