Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/h3poteto/k8s-clusters
kops kubernetes cluster definition
https://github.com/h3poteto/k8s-clusters
kops kubernetes
Last synced: 17 days ago
JSON representation
kops kubernetes cluster definition
- Host: GitHub
- URL: https://github.com/h3poteto/k8s-clusters
- Owner: h3poteto
- Created: 2019-02-20T13:01:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-22T13:56:00.000Z (5 months ago)
- Last Synced: 2024-10-06T16:41:44.846Z (about 1 month ago)
- Topics: kops, kubernetes
- Language: Makefile
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Create cluster
```
$ kops create cluster external-prd-20200329.k8s.h3poteto.dev --zones ap-northeast-1a,ap-northeast-1c,ap-northeast-1d --node-count 3 --master-zones ap-northeast-1a,ap-northeast-1c,ap-northeast-1d --node-size t3.medium --master-size t3.small
```Edit this cluster before apply. And apply it.
```
$ kops update cluster --lifecycle-overrides IAMRole=ExistsAndWarnIfChanges,IAMRolePolicy=ExistsAndWarnIfChanges,IAMInstanceProfileRole=ExistsAndWarnIfChanges --name external-prd-20200329.k8s.h3poteto.dev --yes
```## Edit cluster
You can edit cluster or instancegroup.
Edit cluster.
```bash
$ kops edit cluster external-prd-20200329.k8s.h3poteto.dev
```Edit master instancegroup. You have to edit each master instance.
```bash
$ kops edit instancegroup master-ap-northeast-1a --name external-prd-20200329.k8s.h3poteto.dev
$ kops edit instancegroup master-ap-northeast-1c --name external-prd-20200329.k8s.h3poteto.dev
...
```
Edit node instancegroup.```bash
$ kops edit instancegroup nodes --name external-prd-20200329.k8s.h3poteto.dev
```## Update cluster
And after that, please update the cluster.At first, update cluster definition.
Then rolling update the cluster to replace all master and node instances.```bash
$ kops update cluster --yes --admin --lifecycle-overrides IAMRole=ExistsAndWarnIfChanges,IAMRolePolicy=ExistsAndWarnIfChanges,IAMInstanceProfileRole=ExistsAndWarnIfChanges
```Sometimes the command show some differences about iam role, please ignore it. I added required policy to role, but kops added the poliyc as inline policy, so the differences are appear. But it is no problem.
```bash
# update master instances
$ kops rolling-update cluster external-prd-20200329.k8s.h3poteto.dev --instance-group-roles=control-plane --force --yes
# update node instances
$ kops rolling-update cluster external-prd-20200329.k8s.h3poteto.dev --instance-group-roles=node --force --yes
```