mirror of
https://github.com/puppetmaster/typhoon.git
synced 2025-08-03 07:51:34 +02:00
Compare commits
152 Commits
Author | SHA1 | Date | |
---|---|---|---|
d45dfdbf91 | |||
d7e0536838 | |||
8dd221a57c | |||
f17bb4cf61 | |||
44f1fe620a | |||
a504264e24 | |||
88cf7273dc | |||
58def65a09 | |||
cd7fd29194 | |||
aafa38476a | |||
9a07f1d30b | |||
c87db3ef37 | |||
342380cfa4 | |||
5e70d7e2c8 | |||
aab071309f | |||
f6ce12766b | |||
e1d6ab2f24 | |||
8b3d41d6a0 | |||
ccee5d3d89 | |||
8aefd4f082 | |||
78e6409bd0 | |||
2aef42d4f6 | |||
b7d67757de | |||
26f5d2d753 | |||
cd0a28904e | |||
618f8b30fd | |||
264d23a1b5 | |||
f96e91f225 | |||
efd4a0319d | |||
6df6bf904a | |||
5fba20d358 | |||
a8d3d3bb12 | |||
9ea6d2c245 | |||
507aac9b78 | |||
dfd2a0ec23 | |||
e3bf7d8f9b | |||
49050320ce | |||
74e025c9e4 | |||
257a49ce37 | |||
df3f40bcce | |||
32886cfba1 | |||
0ba2c1a4da | |||
430d139a5b | |||
7c6ab21b94 | |||
21178868db | |||
9dcf35e393 | |||
81b6f54169 | |||
7bce15975c | |||
1f83ae7dbb | |||
a10a1cee9f | |||
a79ad34ba3 | |||
99a11442c7 | |||
d27f367004 | |||
e9c8520359 | |||
37f00a3882 | |||
4cfafeaa07 | |||
90e23f5822 | |||
6234147948 | |||
c25c59058c | |||
bc9b808d44 | |||
4b0203fdb2 | |||
331566e1f7 | |||
04520e447c | |||
413585681b | |||
96711d7f17 | |||
c9059d3fe9 | |||
a287920169 | |||
8dc170b9d9 | |||
aed1a5f33d | |||
31d02b0221 | |||
8f875f80f5 | |||
16c0b9152b | |||
99dbce67a3 | |||
20bfd69780 | |||
ba44408b76 | |||
455175d9e6 | |||
d45804b1f6 | |||
907a96916f | |||
187bb17d39 | |||
abc31c3711 | |||
283e14f3e0 | |||
e72f916c8d | |||
c52f9f8d08 | |||
ecae6679ff | |||
4760543356 | |||
09eb208b4e | |||
8d024d22ad | |||
3bdddc452c | |||
ff4187a1fb | |||
2578be1f96 | |||
90edcd3d77 | |||
a927c7c790 | |||
d952576d2f | |||
70e389f37f | |||
a18bd0a707 | |||
01905b00bc | |||
f4194cd57a | |||
a2db4fa8c4 | |||
358854e712 | |||
b5dabcea31 | |||
3f0a5d2715 | |||
33173c0206 | |||
70f30d9c07 | |||
6afc1643d9 | |||
e71e27e769 | |||
64035005d4 | |||
317416b316 | |||
2c1af917ec | |||
4ac2d94999 | |||
fd044ee117 | |||
38a6bddd06 | |||
d8966afdda | |||
84ed0a31c3 | |||
fcbee12334 | |||
feac94605a | |||
2b1b918b43 | |||
bf22222f7d | |||
671eacb86e | |||
e2d4af43be | |||
5c4a3f73d5 | |||
76ab4c4c2a | |||
1627ecaf27 | |||
1420700bc0 | |||
80538e2953 | |||
73af2f3b7c | |||
17ea547723 | |||
2b5dfece93 | |||
d47d40b517 | |||
3c1be7b0e0 | |||
bbbaf949f9 | |||
135c6182b8 | |||
c53dc66d4a | |||
9960972726 | |||
bac5acb3bd | |||
70bdc9ec94 | |||
144bb9403c | |||
5fca08064b | |||
fc686c8fc7 | |||
a1a5da6bc2 | |||
076b8e3c42 | |||
ef5f953e04 | |||
d25f23e675 | |||
f100a90d28 | |||
c3bf8bcf96 | |||
5d1e4ad333 | |||
9f702c72d2 | |||
e556bc2167 | |||
1bf4f3b801 | |||
590d941f50 | |||
ddc1ff5348 | |||
61557e89a6 | |||
c3ef21dbf5 |
33
.github/ISSUE_TEMPLATE.md
vendored
33
.github/ISSUE_TEMPLATE.md
vendored
@ -1,33 +0,0 @@
|
|||||||
<!-- Fill in either the 'Bug' or 'Feature Request' section -->
|
|
||||||
|
|
||||||
## Bug
|
|
||||||
|
|
||||||
### Environment
|
|
||||||
|
|
||||||
* Platform: aws, azure, bare-metal, google-cloud, digital-ocean
|
|
||||||
* OS: container-linux, flatcar-linux
|
|
||||||
* Release: Typhoon version or Git SHA (reporting latest is **not** helpful)
|
|
||||||
* Terraform: `terraform version` (reporting latest is **not** helpful)
|
|
||||||
* Plugins: Provider plugin versions (reporting latest is **not** helpful)
|
|
||||||
|
|
||||||
### Problem
|
|
||||||
|
|
||||||
Describe the problem.
|
|
||||||
|
|
||||||
### Desired Behavior
|
|
||||||
|
|
||||||
Describe the goal.
|
|
||||||
|
|
||||||
### Steps to Reproduce
|
|
||||||
|
|
||||||
Provide clear steps to reproduce the issue unless already covered.
|
|
||||||
|
|
||||||
## Feature Request
|
|
||||||
|
|
||||||
### Feature
|
|
||||||
|
|
||||||
Describe the feature and what problem it solves.
|
|
||||||
|
|
||||||
### Tradeoffs
|
|
||||||
|
|
||||||
What are the pros and cons of this feature? How will it be exercised and maintained?
|
|
39
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
39
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Report a bug to improve the project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- READ: Issues are used to receive focused bug reports from users and to track planned future enhancements by the authors. Topics like cluster operation, support, debugging help, advice, and Kubernetes concepts are out of scope and should not use issues-->
|
||||||
|
|
||||||
|
**Description**
|
||||||
|
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**Steps to Reproduce**
|
||||||
|
|
||||||
|
Provide clear steps to reproduce the bug.
|
||||||
|
|
||||||
|
- [ ] Relevant error messages if appropriate (concise, not a dump of everything).
|
||||||
|
- [ ] Explored using a vanilla cluster from the [tutorials](https://typhoon.psdn.io/#documentation). Ruled out [customizations](https://typhoon.psdn.io/advanced/customization/).
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Environment**
|
||||||
|
|
||||||
|
* Platform: aws, azure, bare-metal, google-cloud, digital-ocean
|
||||||
|
* OS: fedora-coreos, flatcar-linux (include release version)
|
||||||
|
* Release: Typhoon version or Git SHA (reporting latest is **not** helpful)
|
||||||
|
* Terraform: `terraform version` (reporting latest is **not** helpful)
|
||||||
|
* Plugins: Provider plugin versions (reporting latest is **not** helpful)
|
||||||
|
|
||||||
|
**Possible Solution**
|
||||||
|
|
||||||
|
<!-- Most bug reports should have some inkling about solutions. Otherwise, your report may be less of a bug and more of a support request (see top).-->
|
||||||
|
|
||||||
|
Link to a PR or description.
|
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
blank_issues_enabled: true
|
||||||
|
contact_links:
|
||||||
|
- name: Security
|
||||||
|
url: https://typhoon.psdn.io/topics/security/
|
||||||
|
about: Report security vulnerabilities
|
15
.github/issue_template.md
vendored
Normal file
15
.github/issue_template.md
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!-- READ: Issues are used to receive focused bug reports from users and to track planned future enhancements by the authors. Topics like cluster operation, support, debugging help, advice, and Kubernetes concepts are out of scope and should not use issues-->
|
||||||
|
|
||||||
|
## Enhancement
|
||||||
|
|
||||||
|
### Overview
|
||||||
|
|
||||||
|
One paragraph explanation of the enhancement.
|
||||||
|
|
||||||
|
### Motivation
|
||||||
|
|
||||||
|
Describe the motivation and what problem this solves.
|
||||||
|
|
||||||
|
### Tradeoffs
|
||||||
|
|
||||||
|
What are the pros and cons of this feature? How will it be exercised and maintained?
|
332
CHANGES.md
332
CHANGES.md
@ -4,6 +4,338 @@ Notable changes between versions.
|
|||||||
|
|
||||||
## Latest
|
## Latest
|
||||||
|
|
||||||
|
* Kubernetes [v1.19.0](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.19.md#v1190)
|
||||||
|
* Update etcd from v3.4.10 to [v3.4.12](https://github.com/etcd-io/etcd/releases/tag/v3.4.12)
|
||||||
|
* Update Calico from v3.15.1 to [v3.15.2](https://docs.projectcalico.org/v3.15/release-notes/)
|
||||||
|
|
||||||
|
### Fedora CoreOS
|
||||||
|
|
||||||
|
* Fix race condition during bootstrap of multi-controller clusters ([#808](https://github.com/poseidon/typhoon/pull/808))
|
||||||
|
* Fix SELinux label of bootstrap-secrets on non-bootstrap controllers
|
||||||
|
|
||||||
|
### Addons
|
||||||
|
|
||||||
|
* Introduce [fleetlock](https://github.com/poseidon/fleetlock) for Fedora CoreOS reboot coordination ([#814](https://github.com/poseidon/typhoon/pull/814))
|
||||||
|
* Update nginx-ingress from v0.34.1 to [v0.35.0](https://github.com/kubernetes/ingress-nginx/releases/tag/controller-v0.35.0)
|
||||||
|
* Repository changed to `k8s.gcr.io/ingress-nginx/controller`
|
||||||
|
* Update Grafana from v7.1.3 to [v7.1.5](https://github.com/grafana/grafana/releases/tag/v7.1.5)
|
||||||
|
|
||||||
|
## v1.18.8
|
||||||
|
|
||||||
|
* Kubernetes [v1.18.8](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.18.md#v1188)
|
||||||
|
* Migrate from Terraform v0.12.x to v0.13.x ([#804](https://github.com/poseidon/typhoon/pull/804)) (**action required**)
|
||||||
|
* Recommend Terraform v0.13.x ([migration guide](https://typhoon.psdn.io/topics/maintenance/#terraform-versions))
|
||||||
|
* Support automatic install of poseidon's provider plugins ([poseidon/ct](https://registry.terraform.io/providers/poseidon/ct/latest), [poseidon/matchbox](https://registry.terraform.io/providers/poseidon/matchbox/latest))
|
||||||
|
* Require Terraform v0.12.26+ (migration compatibility)
|
||||||
|
* Require `terraform-provider-ct` v0.6.1
|
||||||
|
* Require `terraform-provider-matchbox` v0.4.1
|
||||||
|
* Update etcd from v3.4.9 to [v3.4.10](https://github.com/etcd-io/etcd/releases/tag/v3.4.10)
|
||||||
|
* Update CoreDNS from v1.6.7 to [v1.7.0](https://coredns.io/2020/06/15/coredns-1.7.0-release/)
|
||||||
|
* Update Cilium from v1.8.1 to [v1.8.2](https://github.com/cilium/cilium/releases/tag/v1.8.2)
|
||||||
|
* Update [coreos/flannel-cni](https://github.com/coreos/flannel-cni) to [poseidon/flannel-cni](https://github.com/poseidon/flannel-cni) ([#798](https://github.com/poseidon/typhoon/pull/798))
|
||||||
|
* Update CNI plugins and fix CVEs with Flannel CNI (non-default)
|
||||||
|
* Transition to a poseidon maintained container image
|
||||||
|
|
||||||
|
### AWS
|
||||||
|
|
||||||
|
* Allow `terraform-provider-aws` v3.0+ ([#803](https://github.com/poseidon/typhoon/pull/803))
|
||||||
|
* Recommend updating `terraform-provider-aws` to v3.0+
|
||||||
|
* Continue to allow v2.23+, no v3.x specific features are used
|
||||||
|
|
||||||
|
### DigitalOcean
|
||||||
|
|
||||||
|
* Require `terraform-provider-digitalocean` v1.21+ for Terraform v0.13.x (unenforced)
|
||||||
|
* Require `terraform-provider-digitalocean` v1.20+ for Terraform v0.12.x
|
||||||
|
|
||||||
|
### Fedora CoreOS
|
||||||
|
|
||||||
|
* Fix support for Flannel with Fedora CoreOS ([#795](https://github.com/poseidon/typhoon/pull/795))
|
||||||
|
* Configure `flannel.1` link to select its own MAC address to solve flannel
|
||||||
|
pod-to-pod traffic drops starting with default link changes in Fedora CoreOS
|
||||||
|
32.20200629.3.0 ([details](https://github.com/coreos/fedora-coreos-tracker/issues/574#issuecomment-665487296))
|
||||||
|
|
||||||
|
#### Addons
|
||||||
|
|
||||||
|
* Update Prometheus from v2.19.2 to [v2.20.0](https://github.com/prometheus/prometheus/releases/tag/v2.20.0)
|
||||||
|
* Update Grafana from v7.0.6 to [v7.1.3](https://github.com/grafana/grafana/releases/tag/v7.1.3)
|
||||||
|
|
||||||
|
## v1.18.6
|
||||||
|
|
||||||
|
* Kubernetes [v1.18.6](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.18.md#v1186)
|
||||||
|
* Update Calico from v3.15.0 to [v3.15.1](https://docs.projectcalico.org/v3.15/release-notes/)
|
||||||
|
* Update Cilium from v1.8.0 to [v1.8.1](https://github.com/cilium/cilium/releases/tag/v1.8.1)
|
||||||
|
|
||||||
|
#### Addons
|
||||||
|
|
||||||
|
* Update nginx-ingress from v0.33.0 to [v0.34.1](https://github.com/kubernetes/ingress-nginx/releases/tag/nginx-0.34.1)
|
||||||
|
* [ingress-nginx](https://github.com/kubernetes/ingress-nginx/releases/tag/controller-v0.34.0) will publish images only to gcr.io
|
||||||
|
* Update Prometheus from v2.19.1 to [v2.19.2](https://github.com/prometheus/prometheus/releases/tag/v2.19.2)
|
||||||
|
* Update Grafana from v7.0.4 to [v7.0.6](https://github.com/grafana/grafana/releases/tag/v7.0.6)
|
||||||
|
|
||||||
|
## v1.18.5
|
||||||
|
|
||||||
|
* Kubernetes [v1.18.5](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.18.md#v1185)
|
||||||
|
* Add Cilium v1.8.0 as a (experimental) CNI provider option ([#760](https://github.com/poseidon/typhoon/pull/760))
|
||||||
|
* Set `networking` to "cilium" to enable
|
||||||
|
* Update Calico from v3.14.1 to [v3.15.0](https://docs.projectcalico.org/v3.15/release-notes/)
|
||||||
|
|
||||||
|
#### DigitalOcean
|
||||||
|
|
||||||
|
* Isolate each cluster in an independent DigitalOcean VPC ([#776](https://github.com/poseidon/typhoon/pull/776))
|
||||||
|
* Create droplets in a VPC per cluster (matches Typhoon AWS, Azure, and GCP)
|
||||||
|
* Require `terraform-provider-digitalocean` v1.16.0+ (action required)
|
||||||
|
* Output `vpc_id` for use with an attached DigitalOcean [loadbalancer](https://github.com/poseidon/typhoon/blob/v1.18.5/docs/architecture/digitalocean.md#custom-load-balancer)
|
||||||
|
|
||||||
|
### Fedora CoreOS
|
||||||
|
|
||||||
|
#### Google Cloud
|
||||||
|
|
||||||
|
* Promote Fedora CoreOS to stable
|
||||||
|
* Remove `os_image` variable deprecated in v1.18.3 ([#777](https://github.com/poseidon/typhoon/pull/777))
|
||||||
|
* Use `os_stream` to select a Fedora CoreOS image stream
|
||||||
|
|
||||||
|
### Flatcar Linux
|
||||||
|
|
||||||
|
#### Azure
|
||||||
|
|
||||||
|
* Allow using Flatcar Linux Edge by setting `os_image` to "flatcar-edge" ([#778](https://github.com/poseidon/typhoon/pull/778))
|
||||||
|
|
||||||
|
#### Addons
|
||||||
|
|
||||||
|
* Update Prometheus from v2.19.0 to [v2.19.1](https://github.com/prometheus/prometheus/releases/tag/v2.19.1)
|
||||||
|
* Update Grafana from v7.0.3 to [v7.0.4](https://github.com/grafana/grafana/releases/tag/v7.0.4)
|
||||||
|
|
||||||
|
## v1.18.4
|
||||||
|
|
||||||
|
* Kubernetes [v1.18.4](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.18.md#v1184)
|
||||||
|
* Update Kubelet image publishing ([#749](https://github.com/poseidon/typhoon/pull/749))
|
||||||
|
* Build Kubelet images internally and publish to Quay and Dockerhub
|
||||||
|
* [quay.io/poseidon/kubelet](https://quay.io/repository/poseidon/kubelet) (official)
|
||||||
|
* [docker.io/psdn/kubelet](https://hub.docker.com/r/psdn/kubelet) (fallback)
|
||||||
|
* Continue offering automated image builds with an alternate tag strategy (see [docs](https://typhoon.psdn.io/topics/security/#container-images))
|
||||||
|
* [Document](https://typhoon.psdn.io/advanced/customization/#kubelet) use of alternate Kubelet images during registry incidents
|
||||||
|
* Update Calico from v3.14.0 to [v3.14.1](https://docs.projectcalico.org/v3.14/release-notes/)
|
||||||
|
* Fix [CVE-2020-13597](https://github.com/kubernetes/kubernetes/issues/91507)
|
||||||
|
* Rename controller NoSchedule taint from `node-role.kubernetes.io/master` to `node-role.kubernetes.io/controller` ([#764](https://github.com/poseidon/typhoon/pull/764))
|
||||||
|
* Tolerate the new taint name for workloads that may run on controller nodes
|
||||||
|
* Remove node label `node.kubernetes.io/master` from controller nodes ([#764](https://github.com/poseidon/typhoon/pull/764))
|
||||||
|
* Use `node.kubernetes.io/controller` (present since v1.9.5, [#160](https://github.com/poseidon/typhoon/pull/160)) to node select controllers
|
||||||
|
* Remove unused Kubelet `-lock-file` and `-exit-on-lock-contention` ([#758](https://github.com/poseidon/typhoon/pull/758))
|
||||||
|
|
||||||
|
### Fedora CoreOS
|
||||||
|
|
||||||
|
#### Azure
|
||||||
|
|
||||||
|
* Use `strict` Fedora CoreOS Config (FCC) snippet parsing ([#755](https://github.com/poseidon/typhoon/pull/755))
|
||||||
|
* Reduce Calico vxlan interface MTU to maintain performance ([#767](https://github.com/poseidon/typhoon/pull/766))
|
||||||
|
|
||||||
|
#### AWS
|
||||||
|
|
||||||
|
* Fix Kubelet service race with hostname update ([#766](https://github.com/poseidon/typhoon/pull/766))
|
||||||
|
* Wait for a hostname to avoid Kubelet trying to register as `localhost`
|
||||||
|
|
||||||
|
### Flatcar Linux
|
||||||
|
|
||||||
|
* Use `strict` Container Linux Config (CLC) snippet parsing ([#755](https://github.com/poseidon/typhoon/pull/755))
|
||||||
|
* Require `terraform-provider-ct` v0.4+, recommend v0.5+ (**action required**)
|
||||||
|
|
||||||
|
### Addons
|
||||||
|
|
||||||
|
* Update nginx-ingress from v0.32.0 to [v0.33.0](https://github.com/kubernetes/ingress-nginx/releases/tag/nginx-0.33.0)
|
||||||
|
* Update Prometheus from v2.18.1 to [v2.19.0](https://github.com/prometheus/prometheus/releases/tag/v2.19.0)
|
||||||
|
* Update node-exporter from v1.0.0-rc.1 to [v1.0.1](https://github.com/prometheus/node_exporter/releases/tag/v1.0.1)
|
||||||
|
* Update kube-state-metrics from v1.9.6 to v1.9.7
|
||||||
|
* Update Grafana from v7.0.0 to v7.0.3
|
||||||
|
|
||||||
|
## v1.18.3
|
||||||
|
|
||||||
|
* Kubernetes [v1.18.3](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.18.md#v1183)
|
||||||
|
* Use Kubelet [TLS bootstrap](https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet-tls-bootstrapping/) with bootstrap token authentication ([#713](https://github.com/poseidon/typhoon/pull/713))
|
||||||
|
* Enable Node [Authorization](https://kubernetes.io/docs/reference/access-authn-authz/node/) and [NodeRestriction](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction) to reduce authorization scope
|
||||||
|
* Renew Kubelet certificates every 72 hours
|
||||||
|
* Update etcd from v3.4.7 to [v3.4.9](https://github.com/etcd-io/etcd/releases/tag/v3.4.9)
|
||||||
|
* Update Calico from v3.13.1 to [v3.14.0](https://docs.projectcalico.org/v3.14/release-notes/)
|
||||||
|
* Add CoreDNS node affinity preference for controller nodes ([#188](https://github.com/poseidon/terraform-render-bootstrap/pull/188))
|
||||||
|
* Deprecate CoreOS Container Linux support (no OS [updates](https://coreos.com/os/eol/) after May 2020)
|
||||||
|
* Use a `fedora-coreos` module for Fedora CoreOS
|
||||||
|
* Use a `container-linux` module for Flatcar Linux
|
||||||
|
|
||||||
|
### AWS
|
||||||
|
|
||||||
|
* Fix Terraform plan error when `controller_count` exceeds AWS zones (e.g. 5 controllers) ([#714](https://github.com/poseidon/typhoon/pull/714))
|
||||||
|
* Regressed in v1.17.1 ([#605](https://github.com/poseidon/typhoon/pull/605))
|
||||||
|
|
||||||
|
### Azure
|
||||||
|
|
||||||
|
* Update Azure subnets to set `address_prefixes` list ([#730](https://github.com/poseidon/typhoon/pull/730))
|
||||||
|
* Fix warning that `address_prefix` is deprecated
|
||||||
|
* Require `terraform-provider-azurerm` v2.8.0+ (action required)
|
||||||
|
|
||||||
|
### DigitalOcean
|
||||||
|
|
||||||
|
* Promote DigitalOcean to beta on both Fedora CoreOS and Flatcar Linux
|
||||||
|
|
||||||
|
### Fedora CoreOS
|
||||||
|
|
||||||
|
* Fix Calico `install-cni` crashloop on Pod restarts ([#724](https://github.com/poseidon/typhoon/pull/724))
|
||||||
|
* SELinux enforcement requires consistent file context MCS level
|
||||||
|
* Restarting a node resolved the issue as a previous workaround
|
||||||
|
|
||||||
|
#### AWS
|
||||||
|
|
||||||
|
* Support Fedora CoreOS [image streams](https://docs.fedoraproject.org/en-US/fedora-coreos/update-streams/) ([#727](https://github.com/poseidon/typhoon/pull/727))
|
||||||
|
* Add `os_stream` variable to set the stream to `stable` (default), `testing`, or `next`
|
||||||
|
* Remove unused `os_image` variable
|
||||||
|
|
||||||
|
#### Google
|
||||||
|
|
||||||
|
* Support Fedora CoreOS [image streams](https://docs.fedoraproject.org/en-US/fedora-coreos/update-streams/) ([#723](https://github.com/poseidon/typhoon/pull/723))
|
||||||
|
* Add `os_stream` variable to set the stream to `stable` (default), `testing`, or `next`
|
||||||
|
* Deprecate `os_image` variable. Manual image uploads are no longer needed
|
||||||
|
|
||||||
|
### Flatcar Linux
|
||||||
|
|
||||||
|
#### Azure
|
||||||
|
|
||||||
|
* Use the Flatcar Linux Azure Marketplace image
|
||||||
|
* Restore [#664](https://github.com/poseidon/typhoon/pull/664) (reverted in [#707](https://github.com/poseidon/typhoon/pull/707)) but use Flatcar Linux new free offer (not byol)
|
||||||
|
* Change `os_image` to use a `flatcar-stable` default
|
||||||
|
|
||||||
|
#### Google
|
||||||
|
|
||||||
|
* Promote Flatcar Linux to beta
|
||||||
|
|
||||||
|
### Addons
|
||||||
|
|
||||||
|
* Update nginx-ingress from v0.30.0 to [v0.32.0](https://github.com/kubernetes/ingress-nginx/releases/tag/nginx-0.32.0)
|
||||||
|
* Add support for [IngressClass](https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-class)
|
||||||
|
* Update Prometheus from v2.17.1 to v2.18.1
|
||||||
|
* Update kube-state-metrics from v1.9.5 to [v1.9.6](https://github.com/kubernetes/kube-state-metrics/releases/tag/v1.9.6)
|
||||||
|
* Update node-exporter from v1.0.0-rc.0 to [v1.0.0-rc.1](https://github.com/prometheus/node_exporter/releases/tag/v1.0.0-rc.1)
|
||||||
|
* Update Grafana from v6.7.2 to [v7.0.0](https://grafana.com/docs/grafana/latest/guides/whats-new-in-v7-0/)
|
||||||
|
|
||||||
|
## v1.18.2
|
||||||
|
|
||||||
|
* Kubernetes [v1.18.2](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.18.md#v1182)
|
||||||
|
* Choose Fedora CoreOS or Flatcar Linux (**action required**)
|
||||||
|
* Use a `fedora-coreos` module for Fedora CoreOS
|
||||||
|
* Use a `container-linux` module for Flatcar Linux
|
||||||
|
* Change Container Linux modules' defaults from CoreOS Container Linux to [Flatcar Container Linux](https://typhoon.psdn.io/architecture/operating-systems/) ([#702](https://github.com/poseidon/typhoon/pull/702))
|
||||||
|
* CoreOS Container Linux [won't receive updates](https://coreos.com/os/eol/) after May 2020
|
||||||
|
|
||||||
|
### Fedora CoreOS
|
||||||
|
|
||||||
|
* Fix bootstrap race condition from SELinux unshared content label ([#708](https://github.com/poseidon/typhoon/pull/708))
|
||||||
|
|
||||||
|
#### Azure
|
||||||
|
|
||||||
|
* Add support for Fedora CoreOS ([#704](https://github.com/poseidon/typhoon/pull/704))
|
||||||
|
|
||||||
|
#### DigitalOcean
|
||||||
|
|
||||||
|
* Fix race condition creating firewall allow rules ([#709](https://github.com/poseidon/typhoon/pull/709))
|
||||||
|
|
||||||
|
### Flatcar Linux
|
||||||
|
|
||||||
|
#### AWS
|
||||||
|
|
||||||
|
* Change `os_image` default from `coreos-stable` to `flatcar-stable` ([#702](https://github.com/poseidon/typhoon/pull/702))
|
||||||
|
|
||||||
|
#### Azure
|
||||||
|
|
||||||
|
* Change `os_image` to be required. Recommend uploading a Flatcar Linux image (**action required**) ([#702](https://github.com/poseidon/typhoon/pull/702))
|
||||||
|
* Disable Flatcar Linux Azure Marketplace image [support](https://github.com/poseidon/typhoon/pull/664) (**breaking**, [#707](https://github.com/poseidon/typhoon/pull/707))
|
||||||
|
* Revert to manual uploading until marketplace issue is closed ([#703](https://github.com/poseidon/typhoon/issues/703))
|
||||||
|
|
||||||
|
#### Bare-Metal
|
||||||
|
|
||||||
|
* Recommend changing [os_channel](https://typhoon.psdn.io/cl/bare-metal/#required) from `coreos-stable` to `flatcar-stable`
|
||||||
|
|
||||||
|
#### Google
|
||||||
|
|
||||||
|
* Change `os_image` to be required. Recommend uploading a Flatcar Linux image (**action required**) ([#702](https://github.com/poseidon/typhoon/pull/702))
|
||||||
|
|
||||||
|
#### DigitalOcean
|
||||||
|
|
||||||
|
* Change `os_image` to be required. Recommend uploading a Flatcar Linux image (**action required**) ([#702](https://github.com/poseidon/typhoon/pull/702))
|
||||||
|
* Fix race condition creating firewall allow rules ([#709](https://github.com/poseidon/typhoon/pull/709))
|
||||||
|
|
||||||
|
## v1.18.1
|
||||||
|
|
||||||
|
* Kubernetes [v1.18.1](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.18.md#v1181)
|
||||||
|
* Choose Fedora CoreOS or Flatcar Linux (**action recommended**)
|
||||||
|
* Use a `fedora-coreos` module for Fedora CoreOS
|
||||||
|
* Use a `container-linux` module with OS set to Flatcar Linux
|
||||||
|
* Update etcd from v3.4.5 to [v3.4.7](https://github.com/etcd-io/etcd/releases/tag/v3.4.7)
|
||||||
|
* Change `kube-proxy` and `calico` or `flannel` to tolerate specific taints ([#682](https://github.com/poseidon/typhoon/pull/682))
|
||||||
|
* Tolerate master and not-ready taints, rather than tolerating all taints
|
||||||
|
* Update flannel from v0.11.0 to v0.12.0 ([#690](https://github.com/poseidon/typhoon/pull/690))
|
||||||
|
* Fix bootstrap when `networking` mode `flannel` (non-default) is chosen ([#689](https://github.com/poseidon/typhoon/pull/689))
|
||||||
|
* Regressed in v1.18.0 changes for Calico ([#675](https://github.com/poseidon/typhoon/pull/675))
|
||||||
|
* Rename Container Linux `controller_clc_snippets` to `controller_snippets` for consistency ([#688](https://github.com/poseidon/typhoon/pull/688))
|
||||||
|
* Rename Container Linux `worker_clc_snippets` to `worker_snippets` for consistency
|
||||||
|
* Rename Container Linux `clc_snippets` (bare-metal) to `snippets` for consistency
|
||||||
|
* Drop support for [gitRepo](https://kubernetes.io/docs/concepts/storage/volumes/#gitrepo) volumes ([kubelet#3](https://github.com/poseidon/kubelet/pull/3))
|
||||||
|
|
||||||
|
#### Azure
|
||||||
|
|
||||||
|
* Fix Azure worker UDP outbound connections ([#691](https://github.com/poseidon/typhoon/pull/691))
|
||||||
|
* Fix Azure worker clock sync timeouts
|
||||||
|
|
||||||
|
#### DigitalOcean
|
||||||
|
|
||||||
|
* Add support for Fedora CoreOS ([#699](https://github.com/poseidon/typhoon/pull/699))
|
||||||
|
|
||||||
|
#### Addons
|
||||||
|
|
||||||
|
* Refresh Prometheus rules/alerts and Grafana dashboards ([#692](https://github.com/poseidon/typhoon/pull/692))
|
||||||
|
* Update Grafana from v6.7.1 to v6.7.2
|
||||||
|
|
||||||
|
## v1.18.0
|
||||||
|
|
||||||
|
* Kubernetes [v1.18.0](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.18.md#v1180)
|
||||||
|
* Update etcd from v3.4.4 to [v3.4.5](https://github.com/etcd-io/etcd/releases/tag/v3.4.5)
|
||||||
|
* Switch from upstream hyperkube image to individual images ([#669](https://github.com/poseidon/typhoon/pull/669))
|
||||||
|
* Use upstream k8s.gcr.io `kube-apiserver`, `kube-controller-manager`, `kube-scheduler`, and `kube-proxy` container images
|
||||||
|
* Use [poseidon/kubelet](https://github.com/poseidon/kubelet) to package the upstream Kubelet binary and dependencies as a container image (checksummed, automated build)
|
||||||
|
* Add [quay.io/poseidon/kubelet](https://quay.io/repository/poseidon/kubelet) as a Typhoon distributed artifact in the security policy
|
||||||
|
* Update base images from debian 9 to debian 10
|
||||||
|
* Background: Kubernetes will [stop releasing](https://github.com/kubernetes/kubernetes/pull/88676) the hyperkube container image and provide the Kubelet as a binary for packaging
|
||||||
|
* Choose Fedora CoreOS or Flatcar Linux (**action recommended**)
|
||||||
|
* Use a `fedora-coreos` module for Fedora CoreOS
|
||||||
|
* Use a `container-linux` module with OS set for Flatcar Linux (varies, see docs)
|
||||||
|
* CoreOS Container Linux [won't receive updates](https://coreos.com/os/eol/) after May 2020
|
||||||
|
* Add support for Fedora CoreOS snippets (`terraform-provider-ct` v0.5+) ([#686](https://github.com/poseidon/typhoon/pull/686))
|
||||||
|
* Recommend updating `terraform-provider-ct` plugin from v0.4.0 to [v0.5.0](https://github.com/poseidon/terraform-provider-ct/releases/tag/v0.5.0)
|
||||||
|
* Set Fedora CoreOS log driver back to the default `journald` ([#681](https://github.com/poseidon/typhoon/pull/681))
|
||||||
|
* Deprecate `asset_dir` variable and remove docs ([#678](https://github.com/poseidon/typhoon/pull/678))
|
||||||
|
* Deprecate support for [gitRepo](https://kubernetes.io/docs/concepts/storage/volumes/#gitrepo) volumes. A future release will drop support.
|
||||||
|
|
||||||
|
#### AWS
|
||||||
|
|
||||||
|
* Fix Fedora CoreOS AMI to filter for stable images ([#685](https://github.com/poseidon/typhoon/pull/685))
|
||||||
|
* Latest Fedora CoreOS `testing` or `bodhi-update` images could be chosen depending on the region
|
||||||
|
|
||||||
|
#### Bare-Metal
|
||||||
|
|
||||||
|
* Update Fedora CoreOS default `os_stream` from testing to stable
|
||||||
|
|
||||||
|
#### Google Cloud
|
||||||
|
|
||||||
|
* Known: Use of stale Fedora CoreOS image may require terraform re-apply during bootstrap ([#687](https://github.com/poseidon/typhoon/pull/687))
|
||||||
|
|
||||||
|
#### DigitalOcean
|
||||||
|
|
||||||
|
* Rename `image` variable to `os_image` for consistency ([#677](https://github.com/poseidon/typhoon/pull/677)) (action required)
|
||||||
|
|
||||||
|
#### Addons
|
||||||
|
|
||||||
|
* Update Prometheus from v2.16.0 to [v2.17.1](https://github.com/prometheus/prometheus/releases/tag/v2.17.1)
|
||||||
|
* Update Grafana from v6.6.2 to [v6.7.1](https://github.com/grafana/grafana/releases/tag/v6.7.1)
|
||||||
|
|
||||||
|
## v1.17.4
|
||||||
|
|
||||||
|
* Kubernetes [v1.17.4](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.17.md#v1174)
|
||||||
* Update etcd from v3.4.3 to [v3.4.4](https://github.com/etcd-io/etcd/releases/tag/v3.4.4)
|
* Update etcd from v3.4.3 to [v3.4.4](https://github.com/etcd-io/etcd/releases/tag/v3.4.4)
|
||||||
* On Container Linux, fetch using the docker transport format ([#659](https://github.com/poseidon/typhoon/pull/659))
|
* On Container Linux, fetch using the docker transport format ([#659](https://github.com/poseidon/typhoon/pull/659))
|
||||||
* Update CoreDNS from v1.6.6 to v1.6.7 ([#648](https://github.com/poseidon/typhoon/pull/648))
|
* Update CoreDNS from v1.6.6 to v1.6.7 ([#648](https://github.com/poseidon/typhoon/pull/648))
|
||||||
|
35
README.md
35
README.md
@ -11,9 +11,9 @@ Typhoon distributes upstream Kubernetes, architectural conventions, and cluster
|
|||||||
|
|
||||||
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
||||||
|
|
||||||
* Kubernetes v1.17.4 (upstream)
|
* Kubernetes v1.19.0 (upstream)
|
||||||
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [flannel](https://github.com/coreos/flannel) networking
|
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [Cilium](https://github.com/cilium/cilium) or [flannel](https://github.com/coreos/flannel) networking
|
||||||
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/), SELinux enforcing
|
||||||
* Advanced features like [worker pools](https://typhoon.psdn.io/advanced/worker-pools/), [preemptible](https://typhoon.psdn.io/cl/google-cloud/#preemption) workers, and [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
* Advanced features like [worker pools](https://typhoon.psdn.io/advanced/worker-pools/), [preemptible](https://typhoon.psdn.io/cl/google-cloud/#preemption) workers, and [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
||||||
* Ready for Ingress, Prometheus, Grafana, CSI, or other [addons](https://typhoon.psdn.io/addons/overview/)
|
* Ready for Ingress, Prometheus, Grafana, CSI, or other [addons](https://typhoon.psdn.io/addons/overview/)
|
||||||
|
|
||||||
@ -21,37 +21,32 @@ Typhoon distributes upstream Kubernetes, architectural conventions, and cluster
|
|||||||
|
|
||||||
Typhoon provides a Terraform Module for each supported operating system and platform.
|
Typhoon provides a Terraform Module for each supported operating system and platform.
|
||||||
|
|
||||||
| Platform | Operating System | Terraform Module | Status |
|
|
||||||
|---------------|------------------|------------------|--------|
|
|
||||||
| AWS | Container Linux | [aws/container-linux/kubernetes](aws/container-linux/kubernetes) | stable |
|
|
||||||
| Azure | Container Linux | [azure/container-linux/kubernetes](azure/container-linux/kubernetes) | alpha |
|
|
||||||
| Bare-Metal | Container Linux | [bare-metal/container-linux/kubernetes](bare-metal/container-linux/kubernetes) | stable |
|
|
||||||
| Digital Ocean | Container Linux | [digital-ocean/container-linux/kubernetes](digital-ocean/container-linux/kubernetes) | beta |
|
|
||||||
| Google Cloud | Container Linux | [google-cloud/container-linux/kubernetes](google-cloud/container-linux/kubernetes) | stable |
|
|
||||||
|
|
||||||
Typhoon is available for [Fedora CoreOS](https://getfedora.org/coreos/).
|
Typhoon is available for [Fedora CoreOS](https://getfedora.org/coreos/).
|
||||||
|
|
||||||
| Platform | Operating System | Terraform Module | Status |
|
| Platform | Operating System | Terraform Module | Status |
|
||||||
|---------------|------------------|------------------|--------|
|
|---------------|------------------|------------------|--------|
|
||||||
| AWS | Fedora CoreOS | [aws/fedora-coreos/kubernetes](aws/fedora-coreos/kubernetes) | stable |
|
| AWS | Fedora CoreOS | [aws/fedora-coreos/kubernetes](aws/fedora-coreos/kubernetes) | stable |
|
||||||
|
| Azure | Fedora CoreOS | [azure/fedora-coreos/kubernetes](azure/fedora-coreos/kubernetes) | alpha |
|
||||||
| Bare-Metal | Fedora CoreOS | [bare-metal/fedora-coreos/kubernetes](bare-metal/fedora-coreos/kubernetes) | beta |
|
| Bare-Metal | Fedora CoreOS | [bare-metal/fedora-coreos/kubernetes](bare-metal/fedora-coreos/kubernetes) | beta |
|
||||||
| Google Cloud | Fedora CoreOS | [google-cloud/fedora-coreos/kubernetes](google-cloud/fedora-coreos/kubernetes) | beta |
|
| DigitalOcean | Fedora CoreOS | [digital-ocean/fedora-coreos/kubernetes](digital-ocean/fedora-coreos/kubernetes) | beta |
|
||||||
|
| Google Cloud | Fedora CoreOS | [google-cloud/fedora-coreos/kubernetes](google-cloud/fedora-coreos/kubernetes) | stable |
|
||||||
|
|
||||||
Typhoon is available for [Flatcar Container Linux](https://www.flatcar-linux.org/releases/).
|
Typhoon is available for [Flatcar Linux](https://www.flatcar-linux.org/releases/).
|
||||||
|
|
||||||
| Platform | Operating System | Terraform Module | Status |
|
| Platform | Operating System | Terraform Module | Status |
|
||||||
|---------------|------------------|------------------|--------|
|
|---------------|------------------|------------------|--------|
|
||||||
| AWS | Flatcar Linux | [aws/container-linux/kubernetes](aws/container-linux/kubernetes) | stable |
|
| AWS | Flatcar Linux | [aws/container-linux/kubernetes](aws/container-linux/kubernetes) | stable |
|
||||||
| Azure | Flatcar Linux | [azure/container-linux/kubernetes](azure/container-linux/kubernetes) | alpha |
|
| Azure | Flatcar Linux | [azure/container-linux/kubernetes](azure/container-linux/kubernetes) | alpha |
|
||||||
| Bare-Metal | Flatcar Linux | [bare-metal/container-linux/kubernetes](bare-metal/container-linux/kubernetes) | stable |
|
| Bare-Metal | Flatcar Linux | [bare-metal/container-linux/kubernetes](bare-metal/container-linux/kubernetes) | stable |
|
||||||
| Google Cloud | Flatcar Linux | [google-cloud/container-linux/kubernetes](google-cloud/container-linux/kubernetes) | alpha |
|
| DigitalOcean | Flatcar Linux | [digital-ocean/container-linux/kubernetes](digital-ocean/container-linux/kubernetes) | beta |
|
||||||
| Digital Ocean | Flatcar Linux | [digital-ocean/container-linux/kubernetes](digital-ocean/container-linux/kubernetes) | alpha |
|
| Google Cloud | Flatcar Linux | [google-cloud/container-linux/kubernetes](google-cloud/container-linux/kubernetes) | beta |
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
* [Docs](https://typhoon.psdn.io)
|
* [Docs](https://typhoon.psdn.io)
|
||||||
* Architecture [concepts](https://typhoon.psdn.io/architecture/concepts/) and [operating systems](https://typhoon.psdn.io/architecture/operating-systems/)
|
* Architecture [concepts](https://typhoon.psdn.io/architecture/concepts/) and [operating systems](https://typhoon.psdn.io/architecture/operating-systems/)
|
||||||
* Tutorials for [AWS](docs/cl/aws.md), [Azure](docs/cl/azure.md), [Bare-Metal](docs/cl/bare-metal.md), [Digital Ocean](docs/cl/digital-ocean.md), and [Google-Cloud](docs/cl/google-cloud.md)
|
* Fedora CoreOS tutorials for [AWS](docs/fedora-coreos/aws.md), [Azure](docs/fedora-coreos/azure.md), [Bare-Metal](docs/fedora-coreos/bare-metal.md), [DigitalOcean](docs/fedora-coreos/digitalocean.md), and [Google Cloud](docs/fedora-coreos/google-cloud.md)
|
||||||
|
* Flatcar Linux tutorials for [AWS](docs/flatcar-linux/aws.md), [Azure](docs/flatcar-linux/azure.md), [Bare-Metal](docs/flatcar-linux/bare-metal.md), [DigitalOcean](docs/flatcar-linux/digitalocean.md), and [Google Cloud](docs/flatcar-linux/google-cloud.md)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -59,7 +54,7 @@ Define a Kubernetes cluster by using the Terraform module for your chosen platfo
|
|||||||
|
|
||||||
```tf
|
```tf
|
||||||
module "yavin" {
|
module "yavin" {
|
||||||
source = "git::https://github.com/poseidon/typhoon//google-cloud/container-linux/kubernetes?ref=v1.17.4"
|
source = "git::https://github.com/poseidon/typhoon//google-cloud/fedora-coreos/kubernetes?ref=v1.19.0"
|
||||||
|
|
||||||
# Google Cloud
|
# Google Cloud
|
||||||
cluster_name = "yavin"
|
cluster_name = "yavin"
|
||||||
@ -98,9 +93,9 @@ In 4-8 minutes (varies by platform), the cluster will be ready. This Google Clou
|
|||||||
$ export KUBECONFIG=/home/user/.kube/configs/yavin-config
|
$ export KUBECONFIG=/home/user/.kube/configs/yavin-config
|
||||||
$ kubectl get nodes
|
$ kubectl get nodes
|
||||||
NAME ROLES STATUS AGE VERSION
|
NAME ROLES STATUS AGE VERSION
|
||||||
yavin-controller-0.c.example-com.internal <none> Ready 6m v1.17.4
|
yavin-controller-0.c.example-com.internal <none> Ready 6m v1.19.0
|
||||||
yavin-worker-jrbf.c.example-com.internal <none> Ready 5m v1.17.4
|
yavin-worker-jrbf.c.example-com.internal <none> Ready 5m v1.19.0
|
||||||
yavin-worker-mzdm.c.example-com.internal <none> Ready 5m v1.17.4
|
yavin-worker-mzdm.c.example-com.internal <none> Ready 5m v1.19.0
|
||||||
```
|
```
|
||||||
|
|
||||||
List the pods.
|
List the pods.
|
||||||
|
@ -72,7 +72,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(rate(coredns_dns_request_count_total{instance=~\"$instance\"}[5m])) by (proto)",
|
"expr": "sum(rate(coredns_dns_requests_total{instance=~\"$instance\"}[5m])) by (proto)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{proto}}",
|
"legendFormat": "{{proto}}",
|
||||||
@ -163,7 +163,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(rate(coredns_dns_request_type_count_total{instance=~\"$instance\"}[5m])) by (type)",
|
"expr": "sum(rate(coredns_dns_requests_total{instance=~\"$instance\"}[5m])) by (type)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{type}}",
|
"legendFormat": "{{type}}",
|
||||||
@ -254,7 +254,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(rate(coredns_dns_request_count_total{instance=~\"$instance\"}[5m])) by (zone)",
|
"expr": "sum(rate(coredns_dns_requests_total{instance=~\"$instance\"}[5m])) by (zone)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{zone}}",
|
"legendFormat": "{{zone}}",
|
||||||
@ -463,7 +463,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(rate(coredns_dns_response_rcode_count_total{instance=~\"$instance\"}[5m])) by (rcode)",
|
"expr": "sum(rate(coredns_dns_responses_total{instance=~\"$instance\"}[5m])) by (rcode)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{rcode}}",
|
"legendFormat": "{{rcode}}",
|
||||||
@ -790,7 +790,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(coredns_cache_size{instance=~\"$instance\"}) by (type)",
|
"expr": "sum(coredns_cache_entries{instance=~\"$instance\"}) by (type)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{type}}",
|
"legendFormat": "{{type}}",
|
||||||
|
@ -59,7 +59,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "1 - avg(rate(node_cpu_seconds_total{mode=\"idle\", cluster=\"$cluster\"}[1m]))",
|
"expr": "1 - avg(rate(node_cpu_seconds_total{mode=\"idle\", cluster=\"$cluster\"}[$__interval]))",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -1561,7 +1561,7 @@ data:
|
|||||||
],
|
],
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -1570,7 +1570,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -1579,7 +1579,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -1588,7 +1588,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -1597,7 +1597,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -1606,7 +1606,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -1706,7 +1706,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{namespace}}",
|
"legendFormat": "{{namespace}}",
|
||||||
@ -1804,7 +1804,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{namespace}}",
|
"legendFormat": "{{namespace}}",
|
||||||
@ -1902,7 +1902,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "avg(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "avg(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{namespace}}",
|
"legendFormat": "{{namespace}}",
|
||||||
@ -2000,7 +2000,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "avg(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "avg(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{namespace}}",
|
"legendFormat": "{{namespace}}",
|
||||||
@ -2098,7 +2098,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{namespace}}",
|
"legendFormat": "{{namespace}}",
|
||||||
@ -2196,7 +2196,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{namespace}}",
|
"legendFormat": "{{namespace}}",
|
||||||
@ -2294,7 +2294,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{namespace}}",
|
"legendFormat": "{{namespace}}",
|
||||||
@ -2392,7 +2392,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\".+\"}[$interval])) by (namespace)",
|
"expr": "sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\".+\"}[$__interval])) by (namespace)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{namespace}}",
|
"legendFormat": "{{namespace}}",
|
||||||
@ -2499,41 +2499,6 @@ data:
|
|||||||
"type": "query",
|
"type": "query",
|
||||||
"useTags": false
|
"useTags": false
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allValue": null,
|
|
||||||
"auto": false,
|
|
||||||
"auto_count": 30,
|
|
||||||
"auto_min": "10s",
|
|
||||||
"current": {
|
|
||||||
"text": "5m",
|
|
||||||
"value": "5m"
|
|
||||||
},
|
|
||||||
"datasource": "$datasource",
|
|
||||||
"hide": 2,
|
|
||||||
"includeAll": false,
|
|
||||||
"label": null,
|
|
||||||
"multi": false,
|
|
||||||
"name": "interval",
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"selected": true,
|
|
||||||
"text": "4h",
|
|
||||||
"value": "4h"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"query": "4h",
|
|
||||||
"refresh": 2,
|
|
||||||
"regex": "",
|
|
||||||
"skipUrlSync": false,
|
|
||||||
"sort": 1,
|
|
||||||
"tagValuesQuery": "",
|
|
||||||
"tags": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tagsQuery": "",
|
|
||||||
"type": "interval",
|
|
||||||
"useTags": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allValue": null,
|
"allValue": null,
|
||||||
"current": {
|
"current": {
|
||||||
@ -4033,7 +3998,7 @@ data:
|
|||||||
],
|
],
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4042,7 +4007,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4051,7 +4016,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4060,7 +4025,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4069,7 +4034,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4078,7 +4043,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4178,7 +4143,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -4276,7 +4241,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -4374,7 +4339,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -4472,7 +4437,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -4570,7 +4535,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -4668,7 +4633,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -4748,41 +4713,6 @@ data:
|
|||||||
"regex": "",
|
"regex": "",
|
||||||
"type": "datasource"
|
"type": "datasource"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allValue": null,
|
|
||||||
"auto": false,
|
|
||||||
"auto_count": 30,
|
|
||||||
"auto_min": "10s",
|
|
||||||
"current": {
|
|
||||||
"text": "5m",
|
|
||||||
"value": "5m"
|
|
||||||
},
|
|
||||||
"datasource": "$datasource",
|
|
||||||
"hide": 2,
|
|
||||||
"includeAll": false,
|
|
||||||
"label": null,
|
|
||||||
"multi": false,
|
|
||||||
"name": "interval",
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"selected": true,
|
|
||||||
"text": "4h",
|
|
||||||
"value": "4h"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"query": "4h",
|
|
||||||
"refresh": 2,
|
|
||||||
"regex": "",
|
|
||||||
"skipUrlSync": false,
|
|
||||||
"sort": 1,
|
|
||||||
"tagValuesQuery": "",
|
|
||||||
"tags": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tagsQuery": "",
|
|
||||||
"type": "interval",
|
|
||||||
"useTags": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allValue": null,
|
"allValue": null,
|
||||||
"current": {
|
"current": {
|
||||||
@ -5724,41 +5654,6 @@ data:
|
|||||||
"regex": "",
|
"regex": "",
|
||||||
"type": "datasource"
|
"type": "datasource"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allValue": null,
|
|
||||||
"auto": false,
|
|
||||||
"auto_count": 30,
|
|
||||||
"auto_min": "10s",
|
|
||||||
"current": {
|
|
||||||
"text": "5m",
|
|
||||||
"value": "5m"
|
|
||||||
},
|
|
||||||
"datasource": "$datasource",
|
|
||||||
"hide": 2,
|
|
||||||
"includeAll": false,
|
|
||||||
"label": null,
|
|
||||||
"multi": false,
|
|
||||||
"name": "interval",
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"selected": true,
|
|
||||||
"text": "4h",
|
|
||||||
"value": "4h"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"query": "4h",
|
|
||||||
"refresh": 2,
|
|
||||||
"regex": "",
|
|
||||||
"skipUrlSync": false,
|
|
||||||
"sort": 1,
|
|
||||||
"tagValuesQuery": "",
|
|
||||||
"tags": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tagsQuery": "",
|
|
||||||
"type": "interval",
|
|
||||||
"useTags": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allValue": null,
|
"allValue": null,
|
||||||
"current": {
|
"current": {
|
||||||
|
@ -1042,7 +1042,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_bytes_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_bytes_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -1140,7 +1140,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_bytes_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_transmit_bytes_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -1238,7 +1238,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_packets_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -1336,7 +1336,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_packets_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_transmit_packets_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -1434,7 +1434,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_receive_packets_dropped_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_receive_packets_dropped_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -1532,7 +1532,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "sum(irate(container_network_transmit_packets_dropped_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$interval])) by (pod)",
|
"expr": "sum(irate(container_network_transmit_packets_dropped_total{namespace=~\"$namespace\", pod=~\"$pod\"}[$__interval])) by (pod)",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -1612,41 +1612,6 @@ data:
|
|||||||
"regex": "",
|
"regex": "",
|
||||||
"type": "datasource"
|
"type": "datasource"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allValue": null,
|
|
||||||
"auto": false,
|
|
||||||
"auto_count": 30,
|
|
||||||
"auto_min": "10s",
|
|
||||||
"current": {
|
|
||||||
"text": "5m",
|
|
||||||
"value": "5m"
|
|
||||||
},
|
|
||||||
"datasource": "$datasource",
|
|
||||||
"hide": 2,
|
|
||||||
"includeAll": false,
|
|
||||||
"label": null,
|
|
||||||
"multi": false,
|
|
||||||
"name": "interval",
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"selected": true,
|
|
||||||
"text": "4h",
|
|
||||||
"value": "4h"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"query": "4h",
|
|
||||||
"refresh": 2,
|
|
||||||
"regex": "",
|
|
||||||
"skipUrlSync": false,
|
|
||||||
"sort": 1,
|
|
||||||
"tagValuesQuery": "",
|
|
||||||
"tags": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tagsQuery": "",
|
|
||||||
"type": "interval",
|
|
||||||
"useTags": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allValue": null,
|
"allValue": null,
|
||||||
"current": {
|
"current": {
|
||||||
@ -2701,7 +2666,7 @@ data:
|
|||||||
],
|
],
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -2710,7 +2675,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -2719,7 +2684,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -2728,7 +2693,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -2737,7 +2702,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -2746,7 +2711,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -2846,7 +2811,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -2944,7 +2909,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -3042,7 +3007,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(avg(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(avg(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -3140,7 +3105,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(avg(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(avg(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -3238,7 +3203,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -3336,7 +3301,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -3434,7 +3399,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -3532,7 +3497,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod) \ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
"expr": "(sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\"$workload\", workload_type=\"$type\"}) by (pod))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{pod}}",
|
"legendFormat": "{{pod}}",
|
||||||
@ -3612,41 +3577,6 @@ data:
|
|||||||
"regex": "",
|
"regex": "",
|
||||||
"type": "datasource"
|
"type": "datasource"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allValue": null,
|
|
||||||
"auto": false,
|
|
||||||
"auto_count": 30,
|
|
||||||
"auto_min": "10s",
|
|
||||||
"current": {
|
|
||||||
"text": "5m",
|
|
||||||
"value": "5m"
|
|
||||||
},
|
|
||||||
"datasource": "$datasource",
|
|
||||||
"hide": 2,
|
|
||||||
"includeAll": false,
|
|
||||||
"label": null,
|
|
||||||
"multi": false,
|
|
||||||
"name": "interval",
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"selected": true,
|
|
||||||
"text": "4h",
|
|
||||||
"value": "4h"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"query": "4h",
|
|
||||||
"refresh": 2,
|
|
||||||
"regex": "",
|
|
||||||
"skipUrlSync": false,
|
|
||||||
"sort": 1,
|
|
||||||
"tagValuesQuery": "",
|
|
||||||
"tags": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tagsQuery": "",
|
|
||||||
"type": "interval",
|
|
||||||
"useTags": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allValue": null,
|
"allValue": null,
|
||||||
"current": {
|
"current": {
|
||||||
@ -3708,7 +3638,7 @@ data:
|
|||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
"datasource": "$datasource",
|
"datasource": "$datasource",
|
||||||
"hide": 2,
|
"hide": 0,
|
||||||
"includeAll": false,
|
"includeAll": false,
|
||||||
"label": null,
|
"label": null,
|
||||||
"multi": false,
|
"multi": false,
|
||||||
@ -4906,7 +4836,7 @@ data:
|
|||||||
],
|
],
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4915,7 +4845,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4924,7 +4854,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4933,7 +4863,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4942,7 +4872,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -4951,7 +4881,7 @@ data:
|
|||||||
"step": 10
|
"step": 10
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
@ -5051,7 +4981,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{workload}}",
|
"legendFormat": "{{workload}}",
|
||||||
@ -5149,7 +5079,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{workload}}",
|
"legendFormat": "{{workload}}",
|
||||||
@ -5247,7 +5177,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(avg(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(avg(irate(container_network_receive_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{workload}}",
|
"legendFormat": "{{workload}}",
|
||||||
@ -5345,7 +5275,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(avg(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(avg(irate(container_network_transmit_bytes_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{workload}}",
|
"legendFormat": "{{workload}}",
|
||||||
@ -5443,7 +5373,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_receive_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{workload}}",
|
"legendFormat": "{{workload}}",
|
||||||
@ -5541,7 +5471,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_transmit_packets_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{workload}}",
|
"legendFormat": "{{workload}}",
|
||||||
@ -5639,7 +5569,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_receive_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod)\ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{workload}}",
|
"legendFormat": "{{workload}}",
|
||||||
@ -5737,7 +5667,7 @@ data:
|
|||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"expr": "(sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$interval])\n* on (namespace,pod) \ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
"expr": "(sum(irate(container_network_transmit_packets_dropped_total{cluster=\"$cluster\", namespace=~\"$namespace\"}[$__interval])\n* on (namespace,pod) \ngroup_left(workload,workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=~\"$namespace\", workload=~\".+\", workload_type=\"$type\"}) by (workload))\n",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "{{workload}}",
|
"legendFormat": "{{workload}}",
|
||||||
@ -5817,41 +5747,6 @@ data:
|
|||||||
"regex": "",
|
"regex": "",
|
||||||
"type": "datasource"
|
"type": "datasource"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allValue": null,
|
|
||||||
"auto": false,
|
|
||||||
"auto_count": 30,
|
|
||||||
"auto_min": "10s",
|
|
||||||
"current": {
|
|
||||||
"text": "5m",
|
|
||||||
"value": "5m"
|
|
||||||
},
|
|
||||||
"datasource": "$datasource",
|
|
||||||
"hide": 2,
|
|
||||||
"includeAll": false,
|
|
||||||
"label": null,
|
|
||||||
"multi": false,
|
|
||||||
"name": "interval",
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"selected": true,
|
|
||||||
"text": "4h",
|
|
||||||
"value": "4h"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"query": "4h",
|
|
||||||
"refresh": 2,
|
|
||||||
"regex": "",
|
|
||||||
"skipUrlSync": false,
|
|
||||||
"sort": 1,
|
|
||||||
"tagValuesQuery": "",
|
|
||||||
"tags": [
|
|
||||||
|
|
||||||
],
|
|
||||||
"tagsQuery": "",
|
|
||||||
"type": "interval",
|
|
||||||
"useTags": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allValue": null,
|
"allValue": null,
|
||||||
"auto": false,
|
"auto": false,
|
||||||
|
@ -23,7 +23,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: grafana
|
- name: grafana
|
||||||
image: docker.io/grafana/grafana:6.6.2
|
image: docker.io/grafana/grafana:7.1.5
|
||||||
env:
|
env:
|
||||||
- name: GF_PATHS_CONFIG
|
- name: GF_PATHS_CONFIG
|
||||||
value: "/etc/grafana/custom.ini"
|
value: "/etc/grafana/custom.ini"
|
||||||
|
6
addons/nginx-ingress/aws/class.yaml
Normal file
6
addons/nginx-ingress/aws/class.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
kind: IngressClass
|
||||||
|
metadata:
|
||||||
|
name: public
|
||||||
|
spec:
|
||||||
|
controller: k8s.io/ingress-nginx
|
@ -22,7 +22,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nginx-ingress-controller
|
- name: nginx-ingress-controller
|
||||||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.30.0
|
image: k8s.gcr.io/ingress-nginx/controller:v0.35.0
|
||||||
args:
|
args:
|
||||||
- /nginx-ingress-controller
|
- /nginx-ingress-controller
|
||||||
- --ingress-class=public
|
- --ingress-class=public
|
||||||
@ -47,7 +47,6 @@ spec:
|
|||||||
containerPort: 10254
|
containerPort: 10254
|
||||||
hostPort: 10254
|
hostPort: 10254
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 3
|
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: 10254
|
port: 10254
|
||||||
@ -55,15 +54,16 @@ spec:
|
|||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 3
|
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: 10254
|
port: 10254
|
||||||
scheme: HTTP
|
scheme: HTTP
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
lifecycle:
|
lifecycle:
|
||||||
preStop:
|
preStop:
|
||||||
|
@ -51,3 +51,12 @@ rules:
|
|||||||
- ingresses/status
|
- ingresses/status
|
||||||
verbs:
|
verbs:
|
||||||
- update
|
- update
|
||||||
|
- apiGroups:
|
||||||
|
- "networking.k8s.io"
|
||||||
|
resources:
|
||||||
|
- ingressclasses
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
|
||||||
|
6
addons/nginx-ingress/azure/class.yaml
Normal file
6
addons/nginx-ingress/azure/class.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
kind: IngressClass
|
||||||
|
metadata:
|
||||||
|
name: public
|
||||||
|
spec:
|
||||||
|
controller: k8s.io/ingress-nginx
|
@ -22,7 +22,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nginx-ingress-controller
|
- name: nginx-ingress-controller
|
||||||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.30.0
|
image: k8s.gcr.io/ingress-nginx/controller:v0.35.0
|
||||||
args:
|
args:
|
||||||
- /nginx-ingress-controller
|
- /nginx-ingress-controller
|
||||||
- --ingress-class=public
|
- --ingress-class=public
|
||||||
@ -47,7 +47,6 @@ spec:
|
|||||||
containerPort: 10254
|
containerPort: 10254
|
||||||
hostPort: 10254
|
hostPort: 10254
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 3
|
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: 10254
|
port: 10254
|
||||||
@ -55,15 +54,16 @@ spec:
|
|||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 3
|
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: 10254
|
port: 10254
|
||||||
scheme: HTTP
|
scheme: HTTP
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
lifecycle:
|
lifecycle:
|
||||||
preStop:
|
preStop:
|
||||||
|
@ -51,3 +51,12 @@ rules:
|
|||||||
- ingresses/status
|
- ingresses/status
|
||||||
verbs:
|
verbs:
|
||||||
- update
|
- update
|
||||||
|
- apiGroups:
|
||||||
|
- "networking.k8s.io"
|
||||||
|
resources:
|
||||||
|
- ingressclasses
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
|
||||||
|
6
addons/nginx-ingress/bare-metal/class.yaml
Normal file
6
addons/nginx-ingress/bare-metal/class.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
kind: IngressClass
|
||||||
|
metadata:
|
||||||
|
name: public
|
||||||
|
spec:
|
||||||
|
controller: k8s.io/ingress-nginx
|
@ -1,7 +1,7 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: ingress-controller-public
|
name: nginx-ingress-controller
|
||||||
namespace: ingress
|
namespace: ingress
|
||||||
spec:
|
spec:
|
||||||
replicas: 2
|
replicas: 2
|
||||||
@ -10,19 +10,19 @@ spec:
|
|||||||
maxUnavailable: 1
|
maxUnavailable: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
name: ingress-controller-public
|
name: nginx-ingress-controller
|
||||||
phase: prod
|
phase: prod
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
name: ingress-controller-public
|
name: nginx-ingress-controller
|
||||||
phase: prod
|
phase: prod
|
||||||
annotations:
|
annotations:
|
||||||
seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
|
seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nginx-ingress-controller
|
- name: nginx-ingress-controller
|
||||||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.30.0
|
image: k8s.gcr.io/ingress-nginx/controller:v0.35.0
|
||||||
args:
|
args:
|
||||||
- /nginx-ingress-controller
|
- /nginx-ingress-controller
|
||||||
- --ingress-class=public
|
- --ingress-class=public
|
||||||
@ -76,4 +76,3 @@ spec:
|
|||||||
runAsUser: 101 # www-data
|
runAsUser: 101 # www-data
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
terminationGracePeriodSeconds: 300
|
terminationGracePeriodSeconds: 300
|
||||||
|
|
||||||
|
@ -51,3 +51,12 @@ rules:
|
|||||||
- ingresses/status
|
- ingresses/status
|
||||||
verbs:
|
verbs:
|
||||||
- update
|
- update
|
||||||
|
- apiGroups:
|
||||||
|
- "networking.k8s.io"
|
||||||
|
resources:
|
||||||
|
- ingressclasses
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
|
||||||
|
6
addons/nginx-ingress/digital-ocean/class.yaml
Normal file
6
addons/nginx-ingress/digital-ocean/class.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
kind: IngressClass
|
||||||
|
metadata:
|
||||||
|
name: public
|
||||||
|
spec:
|
||||||
|
controller: k8s.io/ingress-nginx
|
@ -22,7 +22,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nginx-ingress-controller
|
- name: nginx-ingress-controller
|
||||||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.30.0
|
image: k8s.gcr.io/ingress-nginx/controller:v0.35.0
|
||||||
args:
|
args:
|
||||||
- /nginx-ingress-controller
|
- /nginx-ingress-controller
|
||||||
- --ingress-class=public
|
- --ingress-class=public
|
||||||
@ -47,7 +47,6 @@ spec:
|
|||||||
containerPort: 10254
|
containerPort: 10254
|
||||||
hostPort: 10254
|
hostPort: 10254
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 3
|
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: 10254
|
port: 10254
|
||||||
@ -55,15 +54,16 @@ spec:
|
|||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 3
|
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: 10254
|
port: 10254
|
||||||
scheme: HTTP
|
scheme: HTTP
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
lifecycle:
|
lifecycle:
|
||||||
preStop:
|
preStop:
|
||||||
|
@ -51,3 +51,12 @@ rules:
|
|||||||
- ingresses/status
|
- ingresses/status
|
||||||
verbs:
|
verbs:
|
||||||
- update
|
- update
|
||||||
|
- apiGroups:
|
||||||
|
- "networking.k8s.io"
|
||||||
|
resources:
|
||||||
|
- ingressclasses
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
|
||||||
|
6
addons/nginx-ingress/google-cloud/class.yaml
Normal file
6
addons/nginx-ingress/google-cloud/class.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
kind: IngressClass
|
||||||
|
metadata:
|
||||||
|
name: public
|
||||||
|
spec:
|
||||||
|
controller: k8s.io/ingress-nginx
|
@ -22,7 +22,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nginx-ingress-controller
|
- name: nginx-ingress-controller
|
||||||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.30.0
|
image: k8s.gcr.io/ingress-nginx/controller:v0.35.0
|
||||||
args:
|
args:
|
||||||
- /nginx-ingress-controller
|
- /nginx-ingress-controller
|
||||||
- --ingress-class=public
|
- --ingress-class=public
|
||||||
@ -47,7 +47,6 @@ spec:
|
|||||||
containerPort: 10254
|
containerPort: 10254
|
||||||
hostPort: 10254
|
hostPort: 10254
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 3
|
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: 10254
|
port: 10254
|
||||||
@ -55,15 +54,16 @@ spec:
|
|||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 3
|
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
port: 10254
|
port: 10254
|
||||||
scheme: HTTP
|
scheme: HTTP
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
lifecycle:
|
lifecycle:
|
||||||
preStop:
|
preStop:
|
||||||
|
@ -51,3 +51,12 @@ rules:
|
|||||||
- ingresses/status
|
- ingresses/status
|
||||||
verbs:
|
verbs:
|
||||||
- update
|
- update
|
||||||
|
- apiGroups:
|
||||||
|
- "networking.k8s.io"
|
||||||
|
resources:
|
||||||
|
- ingressclasses
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ spec:
|
|||||||
serviceAccountName: prometheus
|
serviceAccountName: prometheus
|
||||||
containers:
|
containers:
|
||||||
- name: prometheus
|
- name: prometheus
|
||||||
image: quay.io/prometheus/prometheus:v2.16.0
|
image: quay.io/prometheus/prometheus:v2.20.0
|
||||||
args:
|
args:
|
||||||
- --web.listen-address=0.0.0.0:9090
|
- --web.listen-address=0.0.0.0:9090
|
||||||
- --config.file=/etc/prometheus/prometheus.yaml
|
- --config.file=/etc/prometheus/prometheus.yaml
|
||||||
|
@ -24,7 +24,7 @@ spec:
|
|||||||
serviceAccountName: kube-state-metrics
|
serviceAccountName: kube-state-metrics
|
||||||
containers:
|
containers:
|
||||||
- name: kube-state-metrics
|
- name: kube-state-metrics
|
||||||
image: quay.io/coreos/kube-state-metrics:v1.9.5
|
image: quay.io/coreos/kube-state-metrics:v1.9.7
|
||||||
ports:
|
ports:
|
||||||
- name: metrics
|
- name: metrics
|
||||||
containerPort: 8080
|
containerPort: 8080
|
||||||
|
@ -28,7 +28,7 @@ spec:
|
|||||||
hostPID: true
|
hostPID: true
|
||||||
containers:
|
containers:
|
||||||
- name: node-exporter
|
- name: node-exporter
|
||||||
image: quay.io/prometheus/node-exporter:v1.0.0-rc.0
|
image: quay.io/prometheus/node-exporter:v1.0.1
|
||||||
args:
|
args:
|
||||||
- --path.procfs=/host/proc
|
- --path.procfs=/host/proc
|
||||||
- --path.sysfs=/host/sys
|
- --path.sysfs=/host/sys
|
||||||
|
@ -252,25 +252,25 @@ data:
|
|||||||
"name": "kube-apiserver.rules",
|
"name": "kube-apiserver.rules",
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"expr": "sum(rate(apiserver_request_duration_seconds_sum{subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|PROXY|CONNECT\"}[5m])) without(instance, pod)\n/\nsum(rate(apiserver_request_duration_seconds_count{subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|PROXY|CONNECT\"}[5m])) without(instance, pod)\n",
|
"expr": "sum(rate(apiserver_request_duration_seconds_sum{subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|DELETECOLLECTION|PROXY|CONNECT\"}[5m])) without(instance, pod)\n/\nsum(rate(apiserver_request_duration_seconds_count{subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|DELETECOLLECTION|PROXY|CONNECT\"}[5m])) without(instance, pod)\n",
|
||||||
"record": "cluster:apiserver_request_duration_seconds:mean5m"
|
"record": "cluster:apiserver_request_duration_seconds:mean5m"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{job=\"apiserver\",subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|PROXY|CONNECT\"}[5m])) without(instance, pod))\n",
|
"expr": "histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{job=\"apiserver\",subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|DELETECOLLECTION|PROXY|CONNECT\"}[5m])) without(instance, pod))\n",
|
||||||
"labels": {
|
"labels": {
|
||||||
"quantile": "0.99"
|
"quantile": "0.99"
|
||||||
},
|
},
|
||||||
"record": "cluster_quantile:apiserver_request_duration_seconds:histogram_quantile"
|
"record": "cluster_quantile:apiserver_request_duration_seconds:histogram_quantile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "histogram_quantile(0.9, sum(rate(apiserver_request_duration_seconds_bucket{job=\"apiserver\",subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|PROXY|CONNECT\"}[5m])) without(instance, pod))\n",
|
"expr": "histogram_quantile(0.9, sum(rate(apiserver_request_duration_seconds_bucket{job=\"apiserver\",subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|DELETECOLLECTION|PROXY|CONNECT\"}[5m])) without(instance, pod))\n",
|
||||||
"labels": {
|
"labels": {
|
||||||
"quantile": "0.9"
|
"quantile": "0.9"
|
||||||
},
|
},
|
||||||
"record": "cluster_quantile:apiserver_request_duration_seconds:histogram_quantile"
|
"record": "cluster_quantile:apiserver_request_duration_seconds:histogram_quantile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"expr": "histogram_quantile(0.5, sum(rate(apiserver_request_duration_seconds_bucket{job=\"apiserver\",subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|PROXY|CONNECT\"}[5m])) without(instance, pod))\n",
|
"expr": "histogram_quantile(0.5, sum(rate(apiserver_request_duration_seconds_bucket{job=\"apiserver\",subresource!=\"log\",verb!~\"LIST|WATCH|WATCHLIST|DELETECOLLECTION|PROXY|CONNECT\"}[5m])) without(instance, pod))\n",
|
||||||
"labels": {
|
"labels": {
|
||||||
"quantile": "0.5"
|
"quantile": "0.5"
|
||||||
},
|
},
|
||||||
@ -805,6 +805,7 @@ data:
|
|||||||
{
|
{
|
||||||
"alert": "ErrorBudgetBurn",
|
"alert": "ErrorBudgetBurn",
|
||||||
"annotations": {
|
"annotations": {
|
||||||
|
"message": "High requests error budget burn for job=apiserver (current value: {{ $value }})",
|
||||||
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-errorbudgetburn"
|
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-errorbudgetburn"
|
||||||
},
|
},
|
||||||
"expr": "(\n status_class_5xx:apiserver_request_total:ratio_rate1h{job=\"apiserver\"} > (14.4*0.010000)\n and\n status_class_5xx:apiserver_request_total:ratio_rate5m{job=\"apiserver\"} > (14.4*0.010000)\n)\nor\n(\n status_class_5xx:apiserver_request_total:ratio_rate6h{job=\"apiserver\"} > (6*0.010000)\n and\n status_class_5xx:apiserver_request_total:ratio_rate30m{job=\"apiserver\"} > (6*0.010000)\n)\n",
|
"expr": "(\n status_class_5xx:apiserver_request_total:ratio_rate1h{job=\"apiserver\"} > (14.4*0.010000)\n and\n status_class_5xx:apiserver_request_total:ratio_rate5m{job=\"apiserver\"} > (14.4*0.010000)\n)\nor\n(\n status_class_5xx:apiserver_request_total:ratio_rate6h{job=\"apiserver\"} > (6*0.010000)\n and\n status_class_5xx:apiserver_request_total:ratio_rate30m{job=\"apiserver\"} > (6*0.010000)\n)\n",
|
||||||
@ -816,6 +817,7 @@ data:
|
|||||||
{
|
{
|
||||||
"alert": "ErrorBudgetBurn",
|
"alert": "ErrorBudgetBurn",
|
||||||
"annotations": {
|
"annotations": {
|
||||||
|
"message": "High requests error budget burn for job=apiserver (current value: {{ $value }})",
|
||||||
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-errorbudgetburn"
|
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-errorbudgetburn"
|
||||||
},
|
},
|
||||||
"expr": "(\n status_class_5xx:apiserver_request_total:ratio_rate1d{job=\"apiserver\"} > (3*0.010000)\n and\n status_class_5xx:apiserver_request_total:ratio_rate2h{job=\"apiserver\"} > (3*0.010000)\n)\nor\n(\n status_class_5xx:apiserver_request_total:ratio_rate3d{job=\"apiserver\"} > (0.010000)\n and\n status_class_5xx:apiserver_request_total:ratio_rate6h{job=\"apiserver\"} > (0.010000)\n)\n",
|
"expr": "(\n status_class_5xx:apiserver_request_total:ratio_rate1d{job=\"apiserver\"} > (3*0.010000)\n and\n status_class_5xx:apiserver_request_total:ratio_rate2h{job=\"apiserver\"} > (3*0.010000)\n)\nor\n(\n status_class_5xx:apiserver_request_total:ratio_rate3d{job=\"apiserver\"} > (0.010000)\n and\n status_class_5xx:apiserver_request_total:ratio_rate6h{job=\"apiserver\"} > (0.010000)\n)\n",
|
||||||
@ -853,30 +855,6 @@ data:
|
|||||||
"severity": "critical"
|
"severity": "critical"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"alert": "KubeAPIErrorsHigh",
|
|
||||||
"annotations": {
|
|
||||||
"message": "API server is returning errors for {{ $value | humanizePercentage }} of requests.",
|
|
||||||
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeapierrorshigh"
|
|
||||||
},
|
|
||||||
"expr": "sum(rate(apiserver_request_total{job=\"apiserver\",code=~\"5..\"}[5m]))\n /\nsum(rate(apiserver_request_total{job=\"apiserver\"}[5m])) > 0.03\n",
|
|
||||||
"for": "10m",
|
|
||||||
"labels": {
|
|
||||||
"severity": "critical"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"alert": "KubeAPIErrorsHigh",
|
|
||||||
"annotations": {
|
|
||||||
"message": "API server is returning errors for {{ $value | humanizePercentage }} of requests.",
|
|
||||||
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeapierrorshigh"
|
|
||||||
},
|
|
||||||
"expr": "sum(rate(apiserver_request_total{job=\"apiserver\",code=~\"5..\"}[5m]))\n /\nsum(rate(apiserver_request_total{job=\"apiserver\"}[5m])) > 0.01\n",
|
|
||||||
"for": "10m",
|
|
||||||
"labels": {
|
|
||||||
"severity": "warning"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alert": "KubeAPIErrorsHigh",
|
"alert": "KubeAPIErrorsHigh",
|
||||||
"annotations": {
|
"annotations": {
|
||||||
@ -904,10 +882,10 @@ data:
|
|||||||
{
|
{
|
||||||
"alert": "KubeClientCertificateExpiration",
|
"alert": "KubeClientCertificateExpiration",
|
||||||
"annotations": {
|
"annotations": {
|
||||||
"message": "A client certificate used to authenticate to the apiserver is expiring in less than 7.0 days.",
|
"message": "A client certificate used to authenticate to the apiserver is expiring in less than 1.0 hours.",
|
||||||
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeclientcertificateexpiration"
|
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeclientcertificateexpiration"
|
||||||
},
|
},
|
||||||
"expr": "apiserver_client_certificate_expiration_seconds_count{job=\"apiserver\"} > 0 and on(job) histogram_quantile(0.01, sum by (job, le) (rate(apiserver_client_certificate_expiration_seconds_bucket{job=\"apiserver\"}[5m]))) < 604800\n",
|
"expr": "apiserver_client_certificate_expiration_seconds_count{job=\"apiserver\"} > 0 and on(job) histogram_quantile(0.01, sum by (job, le) (rate(apiserver_client_certificate_expiration_seconds_bucket{job=\"apiserver\"}[5m]))) < 3600\n",
|
||||||
"labels": {
|
"labels": {
|
||||||
"severity": "warning"
|
"severity": "warning"
|
||||||
}
|
}
|
||||||
@ -915,10 +893,10 @@ data:
|
|||||||
{
|
{
|
||||||
"alert": "KubeClientCertificateExpiration",
|
"alert": "KubeClientCertificateExpiration",
|
||||||
"annotations": {
|
"annotations": {
|
||||||
"message": "A client certificate used to authenticate to the apiserver is expiring in less than 24.0 hours.",
|
"message": "A client certificate used to authenticate to the apiserver is expiring in less than 0.1 hours.",
|
||||||
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeclientcertificateexpiration"
|
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeclientcertificateexpiration"
|
||||||
},
|
},
|
||||||
"expr": "apiserver_client_certificate_expiration_seconds_count{job=\"apiserver\"} > 0 and on(job) histogram_quantile(0.01, sum by (job, le) (rate(apiserver_client_certificate_expiration_seconds_bucket{job=\"apiserver\"}[5m]))) < 86400\n",
|
"expr": "apiserver_client_certificate_expiration_seconds_count{job=\"apiserver\"} > 0 and on(job) histogram_quantile(0.01, sum by (job, le) (rate(apiserver_client_certificate_expiration_seconds_bucket{job=\"apiserver\"}[5m]))) < 300\n",
|
||||||
"labels": {
|
"labels": {
|
||||||
"severity": "critical"
|
"severity": "critical"
|
||||||
}
|
}
|
||||||
@ -993,7 +971,7 @@ data:
|
|||||||
"message": "Kubelet '{{ $labels.node }}' is running at {{ $value | humanizePercentage }} of its Pod capacity.",
|
"message": "Kubelet '{{ $labels.node }}' is running at {{ $value | humanizePercentage }} of its Pod capacity.",
|
||||||
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubelettoomanypods"
|
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubelettoomanypods"
|
||||||
},
|
},
|
||||||
"expr": "max(max(kubelet_running_pod_count{job=\"kubelet\"}) by(instance) * on(instance) group_left(node) kubelet_node_name{job=\"kubelet\"}) by(node) / max(kube_node_status_capacity_pods{job=\"kube-state-metrics\"}) by(node) > 0.95\n",
|
"expr": "max(max(kubelet_running_pod_count{job=\"kubelet\"}) by(instance) * on(instance) group_left(node) kubelet_node_name{job=\"kubelet\"}) by(node) / max(kube_node_status_capacity_pods{job=\"kube-state-metrics\"} != 1) by(node) > 0.95\n",
|
||||||
"for": "15m",
|
"for": "15m",
|
||||||
"labels": {
|
"labels": {
|
||||||
"severity": "warning"
|
"severity": "warning"
|
||||||
@ -1029,7 +1007,7 @@ data:
|
|||||||
"message": "Kubelet Pod startup 99th percentile latency is {{ $value }} seconds on node {{ $labels.node }}.",
|
"message": "Kubelet Pod startup 99th percentile latency is {{ $value }} seconds on node {{ $labels.node }}.",
|
||||||
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeletpodstartuplatencyhigh"
|
"runbook_url": "https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeletpodstartuplatencyhigh"
|
||||||
},
|
},
|
||||||
"expr": "histogram_quantile(0.99, sum(rate(kubelet_pod_worker_duration_seconds_bucket{job=\"kubelet\"}[5m])) by (instance, le)) * on(instance) group_left(node) kubelet_node_name > 5\n",
|
"expr": "histogram_quantile(0.99, sum(rate(kubelet_pod_worker_duration_seconds_bucket{job=\"kubelet\"}[5m])) by (instance, le)) * on(instance) group_left(node) kubelet_node_name > 60\n",
|
||||||
"for": "15m",
|
"for": "15m",
|
||||||
"labels": {
|
"labels": {
|
||||||
"severity": "warning"
|
"severity": "warning"
|
||||||
@ -1085,9 +1063,167 @@ data:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
loki.yaml: |-
|
||||||
|
{
|
||||||
|
"groups": [
|
||||||
|
{
|
||||||
|
"name": "loki_rules",
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, job))",
|
||||||
|
"record": "job:loki_request_duration_seconds:99quantile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, job))",
|
||||||
|
"record": "job:loki_request_duration_seconds:50quantile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_sum[1m])) by (job) / sum(rate(loki_request_duration_seconds_count[1m])) by (job)",
|
||||||
|
"record": "job:loki_request_duration_seconds:avg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, job)",
|
||||||
|
"record": "job:loki_request_duration_seconds_bucket:sum_rate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_sum[1m])) by (job)",
|
||||||
|
"record": "job:loki_request_duration_seconds_sum:sum_rate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_count[1m])) by (job)",
|
||||||
|
"record": "job:loki_request_duration_seconds_count:sum_rate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, job, route))",
|
||||||
|
"record": "job_route:loki_request_duration_seconds:99quantile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, job, route))",
|
||||||
|
"record": "job_route:loki_request_duration_seconds:50quantile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_sum[1m])) by (job, route) / sum(rate(loki_request_duration_seconds_count[1m])) by (job, route)",
|
||||||
|
"record": "job_route:loki_request_duration_seconds:avg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, job, route)",
|
||||||
|
"record": "job_route:loki_request_duration_seconds_bucket:sum_rate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_sum[1m])) by (job, route)",
|
||||||
|
"record": "job_route:loki_request_duration_seconds_sum:sum_rate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_count[1m])) by (job, route)",
|
||||||
|
"record": "job_route:loki_request_duration_seconds_count:sum_rate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.99, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, namespace, job, route))",
|
||||||
|
"record": "namespace_job_route:loki_request_duration_seconds:99quantile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.50, sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, namespace, job, route))",
|
||||||
|
"record": "namespace_job_route:loki_request_duration_seconds:50quantile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_sum[1m])) by (namespace, job, route) / sum(rate(loki_request_duration_seconds_count[1m])) by (namespace, job, route)",
|
||||||
|
"record": "namespace_job_route:loki_request_duration_seconds:avg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_bucket[1m])) by (le, namespace, job, route)",
|
||||||
|
"record": "namespace_job_route:loki_request_duration_seconds_bucket:sum_rate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_sum[1m])) by (namespace, job, route)",
|
||||||
|
"record": "namespace_job_route:loki_request_duration_seconds_sum:sum_rate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(loki_request_duration_seconds_count[1m])) by (namespace, job, route)",
|
||||||
|
"record": "namespace_job_route:loki_request_duration_seconds_count:sum_rate"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "loki_alerts",
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"alert": "LokiRequestErrors",
|
||||||
|
"annotations": {
|
||||||
|
"message": "{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf \"%.2f\" $value }}% errors.\n"
|
||||||
|
},
|
||||||
|
"expr": "100 * sum(rate(loki_request_duration_seconds_count{status_code=~\"5..\"}[1m])) by (namespace, job, route)\n /\nsum(rate(loki_request_duration_seconds_count[1m])) by (namespace, job, route)\n > 10\n",
|
||||||
|
"for": "15m",
|
||||||
|
"labels": {
|
||||||
|
"severity": "critical"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alert": "LokiRequestLatency",
|
||||||
|
"annotations": {
|
||||||
|
"message": "{{ $labels.job }} {{ $labels.route }} is experiencing {{ printf \"%.2f\" $value }}s 99th percentile latency.\n"
|
||||||
|
},
|
||||||
|
"expr": "namespace_job_route:loki_request_duration_seconds:99quantile{route!~\"(?i).*tail.*\"} > 1\n",
|
||||||
|
"for": "15m",
|
||||||
|
"labels": {
|
||||||
|
"severity": "critical"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
node-exporter.yaml: |-
|
node-exporter.yaml: |-
|
||||||
{
|
{
|
||||||
"groups": [
|
"groups": [
|
||||||
|
{
|
||||||
|
"name": "node-exporter.rules",
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"expr": "count without (cpu) (\n count without (mode) (\n node_cpu_seconds_total{job=\"node-exporter\"}\n )\n)\n",
|
||||||
|
"record": "instance:node_num_cpu:sum"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "1 - avg without (cpu, mode) (\n rate(node_cpu_seconds_total{job=\"node-exporter\", mode=\"idle\"}[1m])\n)\n",
|
||||||
|
"record": "instance:node_cpu_utilisation:rate1m"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "(\n node_load1{job=\"node-exporter\"}\n/\n instance:node_num_cpu:sum{job=\"node-exporter\"}\n)\n",
|
||||||
|
"record": "instance:node_load1_per_cpu:ratio"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "1 - (\n node_memory_MemAvailable_bytes{job=\"node-exporter\"}\n/\n node_memory_MemTotal_bytes{job=\"node-exporter\"}\n)\n",
|
||||||
|
"record": "instance:node_memory_utilisation:ratio"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "rate(node_vmstat_pgmajfault{job=\"node-exporter\"}[1m])\n",
|
||||||
|
"record": "instance:node_vmstat_pgmajfault:rate1m"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "rate(node_disk_io_time_seconds_total{job=\"node-exporter\", device!~\"dm.*\"}[1m])\n",
|
||||||
|
"record": "instance_device:node_disk_io_time_seconds:rate1m"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "rate(node_disk_io_time_weighted_seconds_total{job=\"node-exporter\", device!~\"dm.*\"}[1m])\n",
|
||||||
|
"record": "instance_device:node_disk_io_time_weighted_seconds:rate1m"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum without (device) (\n rate(node_network_receive_bytes_total{job=\"node-exporter\", device!=\"lo\"}[1m])\n)\n",
|
||||||
|
"record": "instance:node_network_receive_bytes_excluding_lo:rate1m"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum without (device) (\n rate(node_network_transmit_bytes_total{job=\"node-exporter\", device!=\"lo\"}[1m])\n)\n",
|
||||||
|
"record": "instance:node_network_transmit_bytes_excluding_lo:rate1m"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum without (device) (\n rate(node_network_receive_drop_total{job=\"node-exporter\", device!=\"lo\"}[1m])\n)\n",
|
||||||
|
"record": "instance:node_network_receive_drop_excluding_lo:rate1m"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "sum without (device) (\n rate(node_network_transmit_drop_total{job=\"node-exporter\", device!=\"lo\"}[1m])\n)\n",
|
||||||
|
"record": "instance:node_network_transmit_drop_excluding_lo:rate1m"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "node-exporter",
|
"name": "node-exporter",
|
||||||
"rules": [
|
"rules": [
|
||||||
@ -1210,6 +1346,41 @@ data:
|
|||||||
"labels": {
|
"labels": {
|
||||||
"severity": "warning"
|
"severity": "warning"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alert": "NodeHighNumberConntrackEntriesUsed",
|
||||||
|
"annotations": {
|
||||||
|
"description": "{{ $value | humanizePercentage }} of conntrack entries are used",
|
||||||
|
"summary": "Number of conntrack are getting close to the limit"
|
||||||
|
},
|
||||||
|
"expr": "(node_nf_conntrack_entries / node_nf_conntrack_entries_limit) > 0.75\n",
|
||||||
|
"labels": {
|
||||||
|
"severity": "warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alert": "NodeClockSkewDetected",
|
||||||
|
"annotations": {
|
||||||
|
"message": "Clock on {{ $labels.instance }} is out of sync by more than 300s. Ensure NTP is configured correctly on this host.",
|
||||||
|
"summary": "Clock skew detected."
|
||||||
|
},
|
||||||
|
"expr": "(\n node_timex_offset_seconds > 0.05\nand\n deriv(node_timex_offset_seconds[5m]) >= 0\n)\nor\n(\n node_timex_offset_seconds < -0.05\nand\n deriv(node_timex_offset_seconds[5m]) <= 0\n)\n",
|
||||||
|
"for": "10m",
|
||||||
|
"labels": {
|
||||||
|
"severity": "warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alert": "NodeClockNotSynchronising",
|
||||||
|
"annotations": {
|
||||||
|
"message": "Clock on {{ $labels.instance }} is not synchronising. Ensure NTP is configured on this host.",
|
||||||
|
"summary": "Clock not synchronising."
|
||||||
|
},
|
||||||
|
"expr": "min_over_time(node_timex_sync_status[5m]) == 0\n",
|
||||||
|
"for": "10m",
|
||||||
|
"labels": {
|
||||||
|
"severity": "warning"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,11 @@ Typhoon distributes upstream Kubernetes, architectural conventions, and cluster
|
|||||||
|
|
||||||
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
||||||
|
|
||||||
* Kubernetes v1.17.4 (upstream)
|
* Kubernetes v1.19.0 (upstream)
|
||||||
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [flannel](https://github.com/coreos/flannel) networking
|
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [Cilium](https://github.com/cilium/cilium) or [flannel](https://github.com/coreos/flannel) networking
|
||||||
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
||||||
* Advanced features like [worker pools](https://typhoon.psdn.io/advanced/worker-pools/), [spot](https://typhoon.psdn.io/cl/aws/#spot) workers, and [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
* Advanced features like [worker pools](https://typhoon.psdn.io/advanced/worker-pools/), [spot](https://typhoon.psdn.io/cl/aws/#spot) workers, and [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
||||||
* Ready for Ingress, Prometheus, Grafana, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
* Ready for Ingress, Prometheus, Grafana, CSI, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
||||||
|
|
||||||
## Docs
|
## Docs
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Kubernetes assets (kubeconfig, manifests)
|
# Kubernetes assets (kubeconfig, manifests)
|
||||||
module "bootstrap" {
|
module "bootstrap" {
|
||||||
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=73784c1b2c791d9ba586a1478979ac34dd324dad"
|
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=79343f02aea7c69bb03dab2051aa95248c0471d7"
|
||||||
|
|
||||||
cluster_name = var.cluster_name
|
cluster_name = var.cluster_name
|
||||||
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]
|
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
systemd:
|
systemd:
|
||||||
units:
|
units:
|
||||||
- name: etcd-member.service
|
- name: etcd-member.service
|
||||||
enable: true
|
enabled: true
|
||||||
dropins:
|
dropins:
|
||||||
- name: 40-etcd-cluster.conf
|
- name: 40-etcd-cluster.conf
|
||||||
contents: |
|
contents: |
|
||||||
[Service]
|
[Service]
|
||||||
Environment="ETCD_IMAGE_TAG=v3.4.4"
|
Environment="ETCD_IMAGE_TAG=v3.4.12"
|
||||||
Environment="ETCD_IMAGE_URL=docker://quay.io/coreos/etcd"
|
Environment="ETCD_IMAGE_URL=docker://quay.io/coreos/etcd"
|
||||||
Environment="RKT_RUN_ARGS=--insecure-options=image"
|
Environment="RKT_RUN_ARGS=--insecure-options=image"
|
||||||
Environment="ETCD_NAME=${etcd_name}"
|
Environment="ETCD_NAME=${etcd_name}"
|
||||||
@ -28,11 +28,11 @@ systemd:
|
|||||||
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key"
|
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key"
|
||||||
Environment="ETCD_PEER_CLIENT_CERT_AUTH=true"
|
Environment="ETCD_PEER_CLIENT_CERT_AUTH=true"
|
||||||
- name: docker.service
|
- name: docker.service
|
||||||
enable: true
|
enabled: true
|
||||||
- name: locksmithd.service
|
- name: locksmithd.service
|
||||||
mask: true
|
mask: true
|
||||||
- name: wait-for-dns.service
|
- name: wait-for-dns.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Wait for DNS entries
|
Description=Wait for DNS entries
|
||||||
@ -46,12 +46,13 @@ systemd:
|
|||||||
RequiredBy=kubelet.service
|
RequiredBy=kubelet.service
|
||||||
RequiredBy=etcd-member.service
|
RequiredBy=etcd-member.service
|
||||||
- name: kubelet.service
|
- name: kubelet.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube
|
Description=Kubelet
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=docker://quay.io/poseidon/kubelet:v1.19.0
|
||||||
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
@ -91,26 +92,24 @@ systemd:
|
|||||||
--mount volume=var-log,target=/var/log \
|
--mount volume=var-log,target=/var/log \
|
||||||
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
||||||
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
$${KUBELET_IMAGE} -- \
|
||||||
--exec=/usr/local/bin/kubelet -- \
|
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
||||||
--client-ca-file=/etc/kubernetes/ca.crt \
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/master \
|
|
||||||
--node-labels=node.kubernetes.io/controller="true" \
|
--node-labels=node.kubernetes.io/controller="true" \
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
|
--register-with-taints=node-role.kubernetes.io/controller=:NoSchedule \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
||||||
Restart=always
|
Restart=always
|
||||||
@ -126,7 +125,6 @@ systemd:
|
|||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
WorkingDirectory=/opt/bootstrap
|
WorkingDirectory=/opt/bootstrap
|
||||||
ExecStartPre=-/usr/bin/bash -c 'set -x && [ -n "$(ls /opt/bootstrap/assets/manifests-*/* 2>/dev/null)" ] && mv /opt/bootstrap/assets/manifests-*/* /opt/bootstrap/assets/manifests && rm -rf /opt/bootstrap/assets/manifests-*'
|
|
||||||
ExecStart=/usr/bin/rkt run \
|
ExecStart=/usr/bin/rkt run \
|
||||||
--trust-keys-from-https \
|
--trust-keys-from-https \
|
||||||
--volume config,kind=host,source=/etc/kubernetes/bootstrap-secrets \
|
--volume config,kind=host,source=/etc/kubernetes/bootstrap-secrets \
|
||||||
@ -136,7 +134,7 @@ systemd:
|
|||||||
--volume script,kind=host,source=/opt/bootstrap/apply \
|
--volume script,kind=host,source=/opt/bootstrap/apply \
|
||||||
--mount volume=script,target=/apply \
|
--mount volume=script,target=/apply \
|
||||||
--insecure-options=image \
|
--insecure-options=image \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
docker://quay.io/poseidon/kubelet:v1.19.0 \
|
||||||
--net=host \
|
--net=host \
|
||||||
--dns=host \
|
--dns=host \
|
||||||
--exec=/apply
|
--exec=/apply
|
||||||
@ -144,6 +142,11 @@ systemd:
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
storage:
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /var/lib/etcd
|
||||||
|
filesystem: root
|
||||||
|
mode: 0700
|
||||||
|
overwrite: true
|
||||||
files:
|
files:
|
||||||
- path: /etc/kubernetes/kubeconfig
|
- path: /etc/kubernetes/kubeconfig
|
||||||
filesystem: root
|
filesystem: root
|
||||||
@ -165,14 +168,15 @@ storage:
|
|||||||
mv tls/etcd/etcd-client* /etc/kubernetes/bootstrap-secrets/
|
mv tls/etcd/etcd-client* /etc/kubernetes/bootstrap-secrets/
|
||||||
chown -R etcd:etcd /etc/ssl/etcd
|
chown -R etcd:etcd /etc/ssl/etcd
|
||||||
chmod -R 500 /etc/ssl/etcd
|
chmod -R 500 /etc/ssl/etcd
|
||||||
|
chmod -R 700 /var/lib/etcd
|
||||||
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
||||||
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
||||||
sudo mkdir -p /etc/kubernetes/manifests
|
mkdir -p /etc/kubernetes/manifests
|
||||||
sudo mv static-manifests/* /etc/kubernetes/manifests/
|
mv static-manifests/* /etc/kubernetes/manifests/
|
||||||
sudo mkdir -p /opt/bootstrap/assets
|
mkdir -p /opt/bootstrap/assets
|
||||||
sudo mv manifests /opt/bootstrap/assets/manifests
|
mv manifests /opt/bootstrap/assets/manifests
|
||||||
sudo mv manifests-networking /opt/bootstrap/assets/manifests-networking
|
mv manifests-networking/* /opt/bootstrap/assets/manifests/
|
||||||
rm -rf assets auth static-manifests tls
|
rm -rf assets auth static-manifests tls manifests-networking
|
||||||
- path: /opt/bootstrap/apply
|
- path: /opt/bootstrap/apply
|
||||||
filesystem: root
|
filesystem: root
|
||||||
mode: 0544
|
mode: 0544
|
||||||
@ -190,6 +194,7 @@ storage:
|
|||||||
done
|
done
|
||||||
- path: /etc/sysctl.d/max-user-watches.conf
|
- path: /etc/sysctl.d/max-user-watches.conf
|
||||||
filesystem: root
|
filesystem: root
|
||||||
|
mode: 0644
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
|
@ -36,7 +36,7 @@ resource "aws_instance" "controllers" {
|
|||||||
|
|
||||||
# network
|
# network
|
||||||
associate_public_ip_address = true
|
associate_public_ip_address = true
|
||||||
subnet_id = aws_subnet.public.*.id[count.index]
|
subnet_id = element(aws_subnet.public.*.id, count.index)
|
||||||
vpc_security_group_ids = [aws_security_group.controller.id]
|
vpc_security_group_ids = [aws_security_group.controller.id]
|
||||||
|
|
||||||
lifecycle {
|
lifecycle {
|
||||||
@ -49,10 +49,10 @@ resource "aws_instance" "controllers" {
|
|||||||
|
|
||||||
# Controller Ignition configs
|
# Controller Ignition configs
|
||||||
data "ct_config" "controller-ignitions" {
|
data "ct_config" "controller-ignitions" {
|
||||||
count = var.controller_count
|
count = var.controller_count
|
||||||
content = data.template_file.controller-configs.*.rendered[count.index]
|
content = data.template_file.controller-configs.*.rendered[count.index]
|
||||||
pretty_print = false
|
strict = true
|
||||||
snippets = var.controller_clc_snippets
|
snippets = var.controller_snippets
|
||||||
}
|
}
|
||||||
|
|
||||||
# Controller Container Linux configs
|
# Controller Container Linux configs
|
||||||
|
@ -31,15 +31,15 @@ resource "aws_route_table" "default" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_route" "egress-ipv4" {
|
resource "aws_route" "egress-ipv4" {
|
||||||
route_table_id = aws_route_table.default.id
|
route_table_id = aws_route_table.default.id
|
||||||
destination_cidr_block = "0.0.0.0/0"
|
destination_cidr_block = "0.0.0.0/0"
|
||||||
gateway_id = aws_internet_gateway.gateway.id
|
gateway_id = aws_internet_gateway.gateway.id
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_route" "egress-ipv6" {
|
resource "aws_route" "egress-ipv6" {
|
||||||
route_table_id = aws_route_table.default.id
|
route_table_id = aws_route_table.default.id
|
||||||
destination_ipv6_cidr_block = "::/0"
|
destination_ipv6_cidr_block = "::/0"
|
||||||
gateway_id = aws_internet_gateway.gateway.id
|
gateway_id = aws_internet_gateway.gateway.id
|
||||||
}
|
}
|
||||||
|
|
||||||
# Subnets (one per availability zone)
|
# Subnets (one per availability zone)
|
||||||
|
@ -13,6 +13,30 @@ resource "aws_security_group" "controller" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "controller-icmp" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "icmp"
|
||||||
|
from_port = 8
|
||||||
|
to_port = 0
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "controller-icmp-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "icmp"
|
||||||
|
from_port = 8
|
||||||
|
to_port = 0
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
resource "aws_security_group_rule" "controller-ssh" {
|
resource "aws_security_group_rule" "controller-ssh" {
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
@ -44,39 +68,31 @@ resource "aws_security_group_rule" "controller-etcd-metrics" {
|
|||||||
source_security_group_id = aws_security_group.worker.id
|
source_security_group_id = aws_security_group.worker.id
|
||||||
}
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape kube-proxy
|
resource "aws_security_group_rule" "controller-cilium-health" {
|
||||||
resource "aws_security_group_rule" "kube-proxy-metrics" {
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
type = "ingress"
|
type = "ingress"
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
from_port = 10249
|
from_port = 4240
|
||||||
to_port = 10249
|
to_port = 4240
|
||||||
source_security_group_id = aws_security_group.worker.id
|
source_security_group_id = aws_security_group.worker.id
|
||||||
}
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape kube-scheduler
|
resource "aws_security_group_rule" "controller-cilium-health-self" {
|
||||||
resource "aws_security_group_rule" "controller-scheduler-metrics" {
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
type = "ingress"
|
type = "ingress"
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
from_port = 10251
|
from_port = 4240
|
||||||
to_port = 10251
|
to_port = 4240
|
||||||
source_security_group_id = aws_security_group.worker.id
|
self = true
|
||||||
}
|
|
||||||
|
|
||||||
# Allow Prometheus to scrape kube-controller-manager
|
|
||||||
resource "aws_security_group_rule" "controller-manager-metrics" {
|
|
||||||
security_group_id = aws_security_group.controller.id
|
|
||||||
|
|
||||||
type = "ingress"
|
|
||||||
protocol = "tcp"
|
|
||||||
from_port = 10252
|
|
||||||
to_port = 10252
|
|
||||||
source_security_group_id = aws_security_group.worker.id
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# IANA VXLAN default
|
||||||
resource "aws_security_group_rule" "controller-vxlan" {
|
resource "aws_security_group_rule" "controller-vxlan" {
|
||||||
count = var.networking == "flannel" ? 1 : 0
|
count = var.networking == "flannel" ? 1 : 0
|
||||||
|
|
||||||
@ -111,6 +127,31 @@ resource "aws_security_group_rule" "controller-apiserver" {
|
|||||||
cidr_blocks = ["0.0.0.0/0"]
|
cidr_blocks = ["0.0.0.0/0"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Linux VXLAN default
|
||||||
|
resource "aws_security_group_rule" "controller-linux-vxlan" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "udp"
|
||||||
|
from_port = 8472
|
||||||
|
to_port = 8472
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "controller-linux-vxlan-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "udp"
|
||||||
|
from_port = 8472
|
||||||
|
to_port = 8472
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape node-exporter daemonset
|
# Allow Prometheus to scrape node-exporter daemonset
|
||||||
resource "aws_security_group_rule" "controller-node-exporter" {
|
resource "aws_security_group_rule" "controller-node-exporter" {
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
@ -122,6 +163,17 @@ resource "aws_security_group_rule" "controller-node-exporter" {
|
|||||||
source_security_group_id = aws_security_group.worker.id
|
source_security_group_id = aws_security_group.worker.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape kube-proxy
|
||||||
|
resource "aws_security_group_rule" "kube-proxy-metrics" {
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 10249
|
||||||
|
to_port = 10249
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
# Allow apiserver to access kubelets for exec, log, port-forward
|
# Allow apiserver to access kubelets for exec, log, port-forward
|
||||||
resource "aws_security_group_rule" "controller-kubelet" {
|
resource "aws_security_group_rule" "controller-kubelet" {
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
@ -143,6 +195,28 @@ resource "aws_security_group_rule" "controller-kubelet-self" {
|
|||||||
self = true
|
self = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape kube-scheduler
|
||||||
|
resource "aws_security_group_rule" "controller-scheduler-metrics" {
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 10251
|
||||||
|
to_port = 10251
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape kube-controller-manager
|
||||||
|
resource "aws_security_group_rule" "controller-manager-metrics" {
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 10252
|
||||||
|
to_port = 10252
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
resource "aws_security_group_rule" "controller-bgp" {
|
resource "aws_security_group_rule" "controller-bgp" {
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
@ -227,6 +301,30 @@ resource "aws_security_group" "worker" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-icmp" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "icmp"
|
||||||
|
from_port = 8
|
||||||
|
to_port = 0
|
||||||
|
source_security_group_id = aws_security_group.controller.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-icmp-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "icmp"
|
||||||
|
from_port = 8
|
||||||
|
to_port = 0
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
resource "aws_security_group_rule" "worker-ssh" {
|
resource "aws_security_group_rule" "worker-ssh" {
|
||||||
security_group_id = aws_security_group.worker.id
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
@ -257,6 +355,31 @@ resource "aws_security_group_rule" "worker-https" {
|
|||||||
cidr_blocks = ["0.0.0.0/0"]
|
cidr_blocks = ["0.0.0.0/0"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-cilium-health" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 4240
|
||||||
|
to_port = 4240
|
||||||
|
source_security_group_id = aws_security_group.controller.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-cilium-health-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 4240
|
||||||
|
to_port = 4240
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
|
# IANA VXLAN default
|
||||||
resource "aws_security_group_rule" "worker-vxlan" {
|
resource "aws_security_group_rule" "worker-vxlan" {
|
||||||
count = var.networking == "flannel" ? 1 : 0
|
count = var.networking == "flannel" ? 1 : 0
|
||||||
|
|
||||||
@ -281,6 +404,31 @@ resource "aws_security_group_rule" "worker-vxlan-self" {
|
|||||||
self = true
|
self = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Linux VXLAN default
|
||||||
|
resource "aws_security_group_rule" "worker-linux-vxlan" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "udp"
|
||||||
|
from_port = 8472
|
||||||
|
to_port = 8472
|
||||||
|
source_security_group_id = aws_security_group.controller.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-linux-vxlan-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "udp"
|
||||||
|
from_port = 8472
|
||||||
|
to_port = 8472
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape node-exporter daemonset
|
# Allow Prometheus to scrape node-exporter daemonset
|
||||||
resource "aws_security_group_rule" "worker-node-exporter" {
|
resource "aws_security_group_rule" "worker-node-exporter" {
|
||||||
security_group_id = aws_security_group.worker.id
|
security_group_id = aws_security_group.worker.id
|
||||||
|
@ -44,7 +44,7 @@ variable "worker_type" {
|
|||||||
variable "os_image" {
|
variable "os_image" {
|
||||||
type = string
|
type = string
|
||||||
description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)"
|
description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)"
|
||||||
default = "coreos-stable"
|
default = "flatcar-stable"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "disk_size" {
|
variable "disk_size" {
|
||||||
@ -77,13 +77,13 @@ variable "worker_target_groups" {
|
|||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "controller_clc_snippets" {
|
variable "controller_snippets" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Controller Container Linux Config snippets"
|
description = "Controller Container Linux Config snippets"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_clc_snippets" {
|
variable "worker_snippets" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Worker Container Linux Config snippets"
|
description = "Worker Container Linux Config snippets"
|
||||||
default = []
|
default = []
|
||||||
@ -96,12 +96,6 @@ variable "ssh_authorized_key" {
|
|||||||
description = "SSH public key for user 'core'"
|
description = "SSH public key for user 'core'"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "asset_dir" {
|
|
||||||
type = string
|
|
||||||
description = "Absolute path to a directory where generated assets should be placed (contains secrets)"
|
|
||||||
default = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "networking" {
|
variable "networking" {
|
||||||
type = string
|
type = string
|
||||||
description = "Choice of networking provider (calico or flannel)"
|
description = "Choice of networking provider (calico or flannel)"
|
||||||
@ -155,6 +149,12 @@ variable "worker_node_labels" {
|
|||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
|
variable "asset_dir" {
|
||||||
|
type = string
|
||||||
|
description = "Absolute path to a directory where generated assets should be placed (contains secrets)"
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
variable "cluster_domain_suffix" {
|
||||||
type = string
|
type = string
|
||||||
description = "Queries for domains with the suffix will be answered by CoreDNS. Default is cluster.local (e.g. foo.default.svc.cluster.local)"
|
description = "Queries for domains with the suffix will be answered by CoreDNS. Default is cluster.local (e.g. foo.default.svc.cluster.local)"
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
# Terraform version and plugin versions
|
# Terraform version and plugin versions
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
required_version = "~> 0.12.6"
|
required_version = ">= 0.12.26, < 0.14.0"
|
||||||
required_providers {
|
required_providers {
|
||||||
aws = "~> 2.23"
|
aws = ">= 2.23, <= 4.0"
|
||||||
ct = "~> 0.3"
|
|
||||||
template = "~> 2.1"
|
template = "~> 2.1"
|
||||||
null = "~> 2.1"
|
null = "~> 2.1"
|
||||||
|
|
||||||
|
ct = {
|
||||||
|
source = "poseidon/ct"
|
||||||
|
version = "~> 0.6.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ module "workers" {
|
|||||||
ssh_authorized_key = var.ssh_authorized_key
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
service_cidr = var.service_cidr
|
service_cidr = var.service_cidr
|
||||||
cluster_domain_suffix = var.cluster_domain_suffix
|
cluster_domain_suffix = var.cluster_domain_suffix
|
||||||
clc_snippets = var.worker_clc_snippets
|
snippets = var.worker_snippets
|
||||||
node_labels = var.worker_node_labels
|
node_labels = var.worker_node_labels
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
systemd:
|
systemd:
|
||||||
units:
|
units:
|
||||||
- name: docker.service
|
- name: docker.service
|
||||||
enable: true
|
enabled: true
|
||||||
- name: locksmithd.service
|
- name: locksmithd.service
|
||||||
mask: true
|
mask: true
|
||||||
- name: wait-for-dns.service
|
- name: wait-for-dns.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Wait for DNS entries
|
Description=Wait for DNS entries
|
||||||
@ -19,12 +19,13 @@ systemd:
|
|||||||
[Install]
|
[Install]
|
||||||
RequiredBy=kubelet.service
|
RequiredBy=kubelet.service
|
||||||
- name: kubelet.service
|
- name: kubelet.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube
|
Description=Kubelet
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=docker://quay.io/poseidon/kubelet:v1.19.0
|
||||||
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
@ -64,27 +65,26 @@ systemd:
|
|||||||
--mount volume=var-log,target=/var/log \
|
--mount volume=var-log,target=/var/log \
|
||||||
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
||||||
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
$${KUBELET_IMAGE} -- \
|
||||||
--exec=/usr/local/bin/kubelet -- \
|
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
||||||
--client-ca-file=/etc/kubernetes/ca.crt \
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/node \
|
--node-labels=node.kubernetes.io/node \
|
||||||
%{ for label in split(",", node_labels) }
|
%{~ for label in split(",", node_labels) ~}
|
||||||
--node-labels=${label} \
|
--node-labels=${label} \
|
||||||
%{ endfor ~}
|
%{~ endfor ~}
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
||||||
Restart=always
|
Restart=always
|
||||||
@ -113,6 +113,7 @@ storage:
|
|||||||
${kubeconfig}
|
${kubeconfig}
|
||||||
- path: /etc/sysctl.d/max-user-watches.conf
|
- path: /etc/sysctl.d/max-user-watches.conf
|
||||||
filesystem: root
|
filesystem: root
|
||||||
|
mode: 0644
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
@ -128,11 +129,10 @@ storage:
|
|||||||
--volume config,kind=host,source=/etc/kubernetes \
|
--volume config,kind=host,source=/etc/kubernetes \
|
||||||
--mount volume=config,target=/etc/kubernetes \
|
--mount volume=config,target=/etc/kubernetes \
|
||||||
--insecure-options=image \
|
--insecure-options=image \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
docker://quay.io/poseidon/kubelet:v1.19.0 \
|
||||||
--net=host \
|
--net=host \
|
||||||
--dns=host \
|
--dns=host \
|
||||||
-- \
|
--exec=/usr/local/bin/kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname)
|
||||||
kubectl --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname)
|
|
||||||
passwd:
|
passwd:
|
||||||
users:
|
users:
|
||||||
- name: core
|
- name: core
|
||||||
|
@ -37,7 +37,7 @@ variable "instance_type" {
|
|||||||
variable "os_image" {
|
variable "os_image" {
|
||||||
type = string
|
type = string
|
||||||
description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)"
|
description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)"
|
||||||
default = "coreos-stable"
|
default = "flatcar-stable"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "disk_size" {
|
variable "disk_size" {
|
||||||
@ -70,7 +70,7 @@ variable "target_groups" {
|
|||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "clc_snippets" {
|
variable "snippets" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Container Linux Config snippets"
|
description = "Container Linux Config snippets"
|
||||||
default = []
|
default = []
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
|
# Terraform version and plugin versions
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
required_version = ">= 0.12"
|
required_version = ">= 0.12.26, < 0.14.0"
|
||||||
|
required_providers {
|
||||||
|
aws = ">= 2.23, <= 4.0"
|
||||||
|
template = "~> 2.1"
|
||||||
|
|
||||||
|
ct = {
|
||||||
|
source = "poseidon/ct"
|
||||||
|
version = "~> 0.6.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,9 +71,9 @@ resource "aws_launch_configuration" "worker" {
|
|||||||
|
|
||||||
# Worker Ignition config
|
# Worker Ignition config
|
||||||
data "ct_config" "worker-ignition" {
|
data "ct_config" "worker-ignition" {
|
||||||
content = data.template_file.worker-config.rendered
|
content = data.template_file.worker-config.rendered
|
||||||
pretty_print = false
|
strict = true
|
||||||
snippets = var.clc_snippets
|
snippets = var.snippets
|
||||||
}
|
}
|
||||||
|
|
||||||
# Worker Container Linux config
|
# Worker Container Linux config
|
||||||
|
@ -11,11 +11,11 @@ Typhoon distributes upstream Kubernetes, architectural conventions, and cluster
|
|||||||
|
|
||||||
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
||||||
|
|
||||||
* Kubernetes v1.17.4 (upstream)
|
* Kubernetes v1.19.0 (upstream)
|
||||||
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [flannel](https://github.com/coreos/flannel) networking
|
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [Cilium](https://github.com/cilium/cilium) or [flannel](https://github.com/coreos/flannel) networking
|
||||||
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/), SELinux enforcing
|
||||||
* Advanced features like [worker pools](https://typhoon.psdn.io/advanced/worker-pools/), [spot](https://typhoon.psdn.io/cl/aws/#spot) workers, and [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
* Advanced features like [worker pools](https://typhoon.psdn.io/advanced/worker-pools/), [spot](https://typhoon.psdn.io/cl/aws/#spot) workers, and [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
||||||
* Ready for Ingress, Prometheus, Grafana, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
* Ready for Ingress, Prometheus, Grafana, CSI, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
||||||
|
|
||||||
## Docs
|
## Docs
|
||||||
|
|
||||||
|
@ -14,10 +14,7 @@ data "aws_ami" "fedora-coreos" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
filter {
|
filter {
|
||||||
name = "name"
|
name = "description"
|
||||||
values = ["fedora-coreos-31.*.*.*-hvm"]
|
values = ["Fedora CoreOS ${var.os_stream} *"]
|
||||||
}
|
}
|
||||||
|
|
||||||
# try to filter out dev images (AWS filters can't)
|
|
||||||
name_regex = "^fedora-coreos-31.[0-9]*.[0-9]*.[0-9]*-hvm*"
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Kubernetes assets (kubeconfig, manifests)
|
# Kubernetes assets (kubeconfig, manifests)
|
||||||
module "bootstrap" {
|
module "bootstrap" {
|
||||||
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=73784c1b2c791d9ba586a1478979ac34dd324dad"
|
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=79343f02aea7c69bb03dab2051aa95248c0471d7"
|
||||||
|
|
||||||
cluster_name = var.cluster_name
|
cluster_name = var.cluster_name
|
||||||
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]
|
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]
|
||||||
|
@ -36,7 +36,7 @@ resource "aws_instance" "controllers" {
|
|||||||
|
|
||||||
# network
|
# network
|
||||||
associate_public_ip_address = true
|
associate_public_ip_address = true
|
||||||
subnet_id = aws_subnet.public.*.id[count.index]
|
subnet_id = element(aws_subnet.public.*.id, count.index)
|
||||||
vpc_security_group_ids = [aws_security_group.controller.id]
|
vpc_security_group_ids = [aws_security_group.controller.id]
|
||||||
|
|
||||||
lifecycle {
|
lifecycle {
|
||||||
|
@ -28,7 +28,7 @@ systemd:
|
|||||||
--network host \
|
--network host \
|
||||||
--volume /var/lib/etcd:/var/lib/etcd:rw,Z \
|
--volume /var/lib/etcd:/var/lib/etcd:rw,Z \
|
||||||
--volume /etc/ssl/etcd:/etc/ssl/certs:ro,Z \
|
--volume /etc/ssl/etcd:/etc/ssl/certs:ro,Z \
|
||||||
quay.io/coreos/etcd:v3.4.4
|
quay.io/coreos/etcd:v3.4.12
|
||||||
ExecStop=/usr/bin/podman stop etcd
|
ExecStop=/usr/bin/podman stop etcd
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@ -38,11 +38,12 @@ systemd:
|
|||||||
enabled: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Wait for DNS entries
|
Description=Wait for DNS and hostname
|
||||||
Before=kubelet.service
|
Before=kubelet.service
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
|
ExecStartPre=/bin/sh -c 'while [ `hostname -s` == "localhost" ]; do sleep 1; done;'
|
||||||
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
|
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
|
||||||
[Install]
|
[Install]
|
||||||
RequiredBy=kubelet.service
|
RequiredBy=kubelet.service
|
||||||
@ -51,9 +52,10 @@ systemd:
|
|||||||
enabled: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube (System Container)
|
Description=Kubelet (System Container)
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=quay.io/poseidon/kubelet:v1.19.0
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
||||||
@ -79,10 +81,11 @@ systemd:
|
|||||||
--volume /var/log:/var/log \
|
--volume /var/log:/var/log \
|
||||||
--volume /var/run/lock:/var/run/lock:z \
|
--volume /var/run/lock:/var/run/lock:z \
|
||||||
--volume /opt/cni/bin:/opt/cni/bin:z \
|
--volume /opt/cni/bin:/opt/cni/bin:z \
|
||||||
k8s.gcr.io/hyperkube:v1.17.4 kubelet \
|
$${KUBELET_IMAGE} \
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
--cgroup-driver=systemd \
|
--cgroup-driver=systemd \
|
||||||
--cgroups-per-qos=true \
|
--cgroups-per-qos=true \
|
||||||
--enforce-node-allocatable=pods \
|
--enforce-node-allocatable=pods \
|
||||||
@ -90,16 +93,14 @@ systemd:
|
|||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/master \
|
|
||||||
--node-labels=node.kubernetes.io/controller="true" \
|
--node-labels=node.kubernetes.io/controller="true" \
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
|
--register-with-taints=node-role.kubernetes.io/controller=:NoSchedule \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/podman stop kubelet
|
ExecStop=-/usr/bin/podman stop kubelet
|
||||||
Delegate=yes
|
Delegate=yes
|
||||||
@ -116,18 +117,20 @@ systemd:
|
|||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
WorkingDirectory=/opt/bootstrap
|
WorkingDirectory=/opt/bootstrap
|
||||||
ExecStartPre=-/usr/bin/bash -c 'set -x && [ -n "$(ls /opt/bootstrap/assets/manifests-*/* 2>/dev/null)" ] && mv /opt/bootstrap/assets/manifests-*/* /opt/bootstrap/assets/manifests && rm -rf /opt/bootstrap/assets/manifests-*'
|
ExecStartPre=-/usr/bin/podman rm bootstrap
|
||||||
ExecStart=/usr/bin/podman run --name bootstrap \
|
ExecStart=/usr/bin/podman run --name bootstrap \
|
||||||
--network host \
|
--network host \
|
||||||
--volume /etc/kubernetes/bootstrap-secrets:/etc/kubernetes/secrets:ro,Z \
|
--volume /etc/kubernetes/bootstrap-secrets:/etc/kubernetes/secrets:ro,z \
|
||||||
--volume /opt/bootstrap/assets:/assets:ro,Z \
|
--volume /opt/bootstrap/assets:/assets:ro,Z \
|
||||||
--volume /opt/bootstrap/apply:/apply:ro,Z \
|
--volume /opt/bootstrap/apply:/apply:ro,Z \
|
||||||
--entrypoint=/apply \
|
--entrypoint=/apply \
|
||||||
k8s.gcr.io/hyperkube:v1.17.4
|
quay.io/poseidon/kubelet:v1.19.0
|
||||||
ExecStartPost=/bin/touch /opt/bootstrap/bootstrap.done
|
ExecStartPost=/bin/touch /opt/bootstrap/bootstrap.done
|
||||||
ExecStartPost=-/usr/bin/podman stop bootstrap
|
ExecStartPost=-/usr/bin/podman stop bootstrap
|
||||||
storage:
|
storage:
|
||||||
directories:
|
directories:
|
||||||
|
- path: /var/lib/etcd
|
||||||
|
mode: 0700
|
||||||
- path: /etc/kubernetes
|
- path: /etc/kubernetes
|
||||||
- path: /opt/bootstrap
|
- path: /opt/bootstrap
|
||||||
files:
|
files:
|
||||||
@ -151,12 +154,13 @@ storage:
|
|||||||
chmod -R 500 /etc/ssl/etcd
|
chmod -R 500 /etc/ssl/etcd
|
||||||
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
||||||
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
||||||
sudo mkdir -p /etc/kubernetes/manifests
|
mkdir -p /etc/kubernetes/manifests
|
||||||
sudo mv static-manifests/* /etc/kubernetes/manifests/
|
mv static-manifests/* /etc/kubernetes/manifests/
|
||||||
sudo mkdir -p /opt/bootstrap/assets
|
mkdir -p /opt/bootstrap/assets
|
||||||
sudo mv manifests /opt/bootstrap/assets/manifests
|
mv manifests /opt/bootstrap/assets/manifests
|
||||||
sudo mv manifests-networking /opt/bootstrap/assets/manifests-networking
|
mv manifests-networking/* /opt/bootstrap/assets/manifests/
|
||||||
rm -rf assets auth static-manifests tls
|
rm -rf assets auth static-manifests tls manifests-networking
|
||||||
|
chcon -R -u system_u -t container_file_t /etc/kubernetes/bootstrap-secrets
|
||||||
- path: /opt/bootstrap/apply
|
- path: /opt/bootstrap/apply
|
||||||
mode: 0544
|
mode: 0544
|
||||||
contents:
|
contents:
|
||||||
@ -175,6 +179,18 @@ storage:
|
|||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
|
- path: /etc/sysctl.d/reverse-path-filter.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
net.ipv4.conf.default.rp_filter=0
|
||||||
|
net.ipv4.conf.*.rp_filter=0
|
||||||
|
- path: /etc/systemd/network/50-flannel.link
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
[Match]
|
||||||
|
OriginalName=flannel*
|
||||||
|
[Link]
|
||||||
|
MACAddressPolicy=none
|
||||||
- path: /etc/systemd/system.conf.d/accounting.conf
|
- path: /etc/systemd/system.conf.d/accounting.conf
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
@ -182,19 +198,6 @@ storage:
|
|||||||
DefaultCPUAccounting=yes
|
DefaultCPUAccounting=yes
|
||||||
DefaultMemoryAccounting=yes
|
DefaultMemoryAccounting=yes
|
||||||
DefaultBlockIOAccounting=yes
|
DefaultBlockIOAccounting=yes
|
||||||
- path: /etc/sysconfig/docker
|
|
||||||
mode: 0644
|
|
||||||
overwrite: true
|
|
||||||
contents:
|
|
||||||
inline: |
|
|
||||||
# Modify these options if you want to change the way the docker daemon runs
|
|
||||||
OPTIONS="--selinux-enabled \
|
|
||||||
--log-driver=json-file \
|
|
||||||
--live-restore \
|
|
||||||
--default-ulimit nofile=1024:1024 \
|
|
||||||
--init-path /usr/libexec/docker/docker-init \
|
|
||||||
--userland-proxy-path /usr/libexec/docker/docker-proxy \
|
|
||||||
"
|
|
||||||
- path: /etc/etcd/etcd.env
|
- path: /etc/etcd/etcd.env
|
||||||
mode: 0644
|
mode: 0644
|
||||||
contents:
|
contents:
|
||||||
|
@ -31,15 +31,15 @@ resource "aws_route_table" "default" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_route" "egress-ipv4" {
|
resource "aws_route" "egress-ipv4" {
|
||||||
route_table_id = aws_route_table.default.id
|
route_table_id = aws_route_table.default.id
|
||||||
destination_cidr_block = "0.0.0.0/0"
|
destination_cidr_block = "0.0.0.0/0"
|
||||||
gateway_id = aws_internet_gateway.gateway.id
|
gateway_id = aws_internet_gateway.gateway.id
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_route" "egress-ipv6" {
|
resource "aws_route" "egress-ipv6" {
|
||||||
route_table_id = aws_route_table.default.id
|
route_table_id = aws_route_table.default.id
|
||||||
destination_ipv6_cidr_block = "::/0"
|
destination_ipv6_cidr_block = "::/0"
|
||||||
gateway_id = aws_internet_gateway.gateway.id
|
gateway_id = aws_internet_gateway.gateway.id
|
||||||
}
|
}
|
||||||
|
|
||||||
# Subnets (one per availability zone)
|
# Subnets (one per availability zone)
|
||||||
|
@ -13,6 +13,30 @@ resource "aws_security_group" "controller" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "controller-icmp" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "icmp"
|
||||||
|
from_port = 8
|
||||||
|
to_port = 0
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "controller-icmp-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "icmp"
|
||||||
|
from_port = 8
|
||||||
|
to_port = 0
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
resource "aws_security_group_rule" "controller-ssh" {
|
resource "aws_security_group_rule" "controller-ssh" {
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
@ -44,39 +68,31 @@ resource "aws_security_group_rule" "controller-etcd-metrics" {
|
|||||||
source_security_group_id = aws_security_group.worker.id
|
source_security_group_id = aws_security_group.worker.id
|
||||||
}
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape kube-proxy
|
resource "aws_security_group_rule" "controller-cilium-health" {
|
||||||
resource "aws_security_group_rule" "kube-proxy-metrics" {
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
type = "ingress"
|
type = "ingress"
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
from_port = 10249
|
from_port = 4240
|
||||||
to_port = 10249
|
to_port = 4240
|
||||||
source_security_group_id = aws_security_group.worker.id
|
source_security_group_id = aws_security_group.worker.id
|
||||||
}
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape kube-scheduler
|
resource "aws_security_group_rule" "controller-cilium-health-self" {
|
||||||
resource "aws_security_group_rule" "controller-scheduler-metrics" {
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
type = "ingress"
|
type = "ingress"
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
from_port = 10251
|
from_port = 4240
|
||||||
to_port = 10251
|
to_port = 4240
|
||||||
source_security_group_id = aws_security_group.worker.id
|
self = true
|
||||||
}
|
|
||||||
|
|
||||||
# Allow Prometheus to scrape kube-controller-manager
|
|
||||||
resource "aws_security_group_rule" "controller-manager-metrics" {
|
|
||||||
security_group_id = aws_security_group.controller.id
|
|
||||||
|
|
||||||
type = "ingress"
|
|
||||||
protocol = "tcp"
|
|
||||||
from_port = 10252
|
|
||||||
to_port = 10252
|
|
||||||
source_security_group_id = aws_security_group.worker.id
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# IANA VXLAN default
|
||||||
resource "aws_security_group_rule" "controller-vxlan" {
|
resource "aws_security_group_rule" "controller-vxlan" {
|
||||||
count = var.networking == "flannel" ? 1 : 0
|
count = var.networking == "flannel" ? 1 : 0
|
||||||
|
|
||||||
@ -111,6 +127,31 @@ resource "aws_security_group_rule" "controller-apiserver" {
|
|||||||
cidr_blocks = ["0.0.0.0/0"]
|
cidr_blocks = ["0.0.0.0/0"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Linux VXLAN default
|
||||||
|
resource "aws_security_group_rule" "controller-linux-vxlan" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "udp"
|
||||||
|
from_port = 8472
|
||||||
|
to_port = 8472
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "controller-linux-vxlan-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "udp"
|
||||||
|
from_port = 8472
|
||||||
|
to_port = 8472
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape node-exporter daemonset
|
# Allow Prometheus to scrape node-exporter daemonset
|
||||||
resource "aws_security_group_rule" "controller-node-exporter" {
|
resource "aws_security_group_rule" "controller-node-exporter" {
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
@ -122,6 +163,17 @@ resource "aws_security_group_rule" "controller-node-exporter" {
|
|||||||
source_security_group_id = aws_security_group.worker.id
|
source_security_group_id = aws_security_group.worker.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape kube-proxy
|
||||||
|
resource "aws_security_group_rule" "kube-proxy-metrics" {
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 10249
|
||||||
|
to_port = 10249
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
# Allow apiserver to access kubelets for exec, log, port-forward
|
# Allow apiserver to access kubelets for exec, log, port-forward
|
||||||
resource "aws_security_group_rule" "controller-kubelet" {
|
resource "aws_security_group_rule" "controller-kubelet" {
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
@ -143,6 +195,28 @@ resource "aws_security_group_rule" "controller-kubelet-self" {
|
|||||||
self = true
|
self = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape kube-scheduler
|
||||||
|
resource "aws_security_group_rule" "controller-scheduler-metrics" {
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 10251
|
||||||
|
to_port = 10251
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape kube-controller-manager
|
||||||
|
resource "aws_security_group_rule" "controller-manager-metrics" {
|
||||||
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 10252
|
||||||
|
to_port = 10252
|
||||||
|
source_security_group_id = aws_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
resource "aws_security_group_rule" "controller-bgp" {
|
resource "aws_security_group_rule" "controller-bgp" {
|
||||||
security_group_id = aws_security_group.controller.id
|
security_group_id = aws_security_group.controller.id
|
||||||
|
|
||||||
@ -227,6 +301,30 @@ resource "aws_security_group" "worker" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-icmp" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "icmp"
|
||||||
|
from_port = 8
|
||||||
|
to_port = 0
|
||||||
|
source_security_group_id = aws_security_group.controller.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-icmp-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "icmp"
|
||||||
|
from_port = 8
|
||||||
|
to_port = 0
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
resource "aws_security_group_rule" "worker-ssh" {
|
resource "aws_security_group_rule" "worker-ssh" {
|
||||||
security_group_id = aws_security_group.worker.id
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
@ -257,6 +355,31 @@ resource "aws_security_group_rule" "worker-https" {
|
|||||||
cidr_blocks = ["0.0.0.0/0"]
|
cidr_blocks = ["0.0.0.0/0"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-cilium-health" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 4240
|
||||||
|
to_port = 4240
|
||||||
|
source_security_group_id = aws_security_group.controller.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-cilium-health-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "tcp"
|
||||||
|
from_port = 4240
|
||||||
|
to_port = 4240
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
|
# IANA VXLAN default
|
||||||
resource "aws_security_group_rule" "worker-vxlan" {
|
resource "aws_security_group_rule" "worker-vxlan" {
|
||||||
count = var.networking == "flannel" ? 1 : 0
|
count = var.networking == "flannel" ? 1 : 0
|
||||||
|
|
||||||
@ -281,6 +404,31 @@ resource "aws_security_group_rule" "worker-vxlan-self" {
|
|||||||
self = true
|
self = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Linux VXLAN default
|
||||||
|
resource "aws_security_group_rule" "worker-linux-vxlan" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "udp"
|
||||||
|
from_port = 8472
|
||||||
|
to_port = 8472
|
||||||
|
source_security_group_id = aws_security_group.controller.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "aws_security_group_rule" "worker-linux-vxlan-self" {
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
security_group_id = aws_security_group.worker.id
|
||||||
|
|
||||||
|
type = "ingress"
|
||||||
|
protocol = "udp"
|
||||||
|
from_port = 8472
|
||||||
|
to_port = 8472
|
||||||
|
self = true
|
||||||
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape node-exporter daemonset
|
# Allow Prometheus to scrape node-exporter daemonset
|
||||||
resource "aws_security_group_rule" "worker-node-exporter" {
|
resource "aws_security_group_rule" "worker-node-exporter" {
|
||||||
security_group_id = aws_security_group.worker.id
|
security_group_id = aws_security_group.worker.id
|
||||||
|
@ -41,10 +41,10 @@ variable "worker_type" {
|
|||||||
default = "t3.small"
|
default = "t3.small"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "os_image" {
|
variable "os_stream" {
|
||||||
type = string
|
type = string
|
||||||
description = "AMI channel for Fedora CoreOS (not yet used)"
|
description = "Fedora CoreOs image stream for instances (e.g. stable, testing, next)"
|
||||||
default = "coreos-stable"
|
default = "stable"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "disk_size" {
|
variable "disk_size" {
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
# Terraform version and plugin versions
|
# Terraform version and plugin versions
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
required_version = "~> 0.12.6"
|
required_version = ">= 0.12.26, < 0.14.0"
|
||||||
required_providers {
|
required_providers {
|
||||||
aws = "~> 2.23"
|
aws = ">= 2.23, <= 4.0"
|
||||||
ct = "~> 0.4"
|
|
||||||
template = "~> 2.1"
|
template = "~> 2.1"
|
||||||
null = "~> 2.1"
|
null = "~> 2.1"
|
||||||
|
|
||||||
|
ct = {
|
||||||
|
source = "poseidon/ct"
|
||||||
|
version = "~> 0.6.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ module "workers" {
|
|||||||
security_groups = [aws_security_group.worker.id]
|
security_groups = [aws_security_group.worker.id]
|
||||||
worker_count = var.worker_count
|
worker_count = var.worker_count
|
||||||
instance_type = var.worker_type
|
instance_type = var.worker_type
|
||||||
os_image = var.os_image
|
os_stream = var.os_stream
|
||||||
disk_size = var.disk_size
|
disk_size = var.disk_size
|
||||||
spot_price = var.worker_price
|
spot_price = var.worker_price
|
||||||
target_groups = var.worker_target_groups
|
target_groups = var.worker_target_groups
|
||||||
|
@ -14,10 +14,7 @@ data "aws_ami" "fedora-coreos" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
filter {
|
filter {
|
||||||
name = "name"
|
name = "description"
|
||||||
values = ["fedora-coreos-31.*.*.*-hvm"]
|
values = ["Fedora CoreOS ${var.os_stream} *"]
|
||||||
}
|
}
|
||||||
|
|
||||||
# try to filter out dev images (AWS filters can't)
|
|
||||||
name_regex = "^fedora-coreos-31.[0-9]*.[0-9]*.[0-9]*-hvm*"
|
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,12 @@ systemd:
|
|||||||
enabled: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Wait for DNS entries
|
Description=Wait for DNS and hostname
|
||||||
Before=kubelet.service
|
Before=kubelet.service
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
|
ExecStartPre=/bin/sh -c 'while [ `hostname -s` == "localhost" ]; do sleep 1; done;'
|
||||||
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
|
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
|
||||||
[Install]
|
[Install]
|
||||||
RequiredBy=kubelet.service
|
RequiredBy=kubelet.service
|
||||||
@ -21,9 +22,10 @@ systemd:
|
|||||||
enabled: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube (System Container)
|
Description=Kubelet (System Container)
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=quay.io/poseidon/kubelet:v1.19.0
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
||||||
@ -49,10 +51,11 @@ systemd:
|
|||||||
--volume /var/log:/var/log \
|
--volume /var/log:/var/log \
|
||||||
--volume /var/run/lock:/var/run/lock:z \
|
--volume /var/run/lock:/var/run/lock:z \
|
||||||
--volume /opt/cni/bin:/opt/cni/bin:z \
|
--volume /opt/cni/bin:/opt/cni/bin:z \
|
||||||
k8s.gcr.io/hyperkube:v1.17.4 kubelet \
|
$${KUBELET_IMAGE} \
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
--cgroup-driver=systemd \
|
--cgroup-driver=systemd \
|
||||||
--cgroups-per-qos=true \
|
--cgroups-per-qos=true \
|
||||||
--enforce-node-allocatable=pods \
|
--enforce-node-allocatable=pods \
|
||||||
@ -60,10 +63,8 @@ systemd:
|
|||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/node \
|
--node-labels=node.kubernetes.io/node \
|
||||||
%{~ for label in split(",", node_labels) ~}
|
%{~ for label in split(",", node_labels) ~}
|
||||||
@ -71,6 +72,7 @@ systemd:
|
|||||||
%{~ endfor ~}
|
%{~ endfor ~}
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/podman stop kubelet
|
ExecStop=-/usr/bin/podman stop kubelet
|
||||||
Delegate=yes
|
Delegate=yes
|
||||||
@ -87,7 +89,7 @@ systemd:
|
|||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
ExecStart=/bin/true
|
ExecStart=/bin/true
|
||||||
ExecStop=/bin/bash -c '/usr/bin/podman run --volume /etc/kubernetes:/etc/kubernetes:ro,z k8s.gcr.io/hyperkube:v1.17.4 kubectl --kubeconfig=/etc/kubernetes/kubeconfig delete node $HOSTNAME'
|
ExecStop=/bin/bash -c '/usr/bin/podman run --volume /etc/kubernetes:/etc/kubernetes:ro,z --entrypoint /usr/local/bin/kubectl quay.io/poseidon/kubelet:v1.19.0 --kubeconfig=/etc/kubernetes/kubeconfig delete node $HOSTNAME'
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
storage:
|
storage:
|
||||||
@ -103,6 +105,18 @@ storage:
|
|||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
|
- path: /etc/sysctl.d/reverse-path-filter.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
net.ipv4.conf.default.rp_filter=0
|
||||||
|
net.ipv4.conf.*.rp_filter=0
|
||||||
|
- path: /etc/systemd/network/50-flannel.link
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
[Match]
|
||||||
|
OriginalName=flannel*
|
||||||
|
[Link]
|
||||||
|
MACAddressPolicy=none
|
||||||
- path: /etc/systemd/system.conf.d/accounting.conf
|
- path: /etc/systemd/system.conf.d/accounting.conf
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
@ -110,19 +124,6 @@ storage:
|
|||||||
DefaultCPUAccounting=yes
|
DefaultCPUAccounting=yes
|
||||||
DefaultMemoryAccounting=yes
|
DefaultMemoryAccounting=yes
|
||||||
DefaultBlockIOAccounting=yes
|
DefaultBlockIOAccounting=yes
|
||||||
- path: /etc/sysconfig/docker
|
|
||||||
mode: 0644
|
|
||||||
overwrite: true
|
|
||||||
contents:
|
|
||||||
inline: |
|
|
||||||
# Modify these options if you want to change the way the docker daemon runs
|
|
||||||
OPTIONS="--selinux-enabled \
|
|
||||||
--log-driver=json-file \
|
|
||||||
--live-restore \
|
|
||||||
--default-ulimit nofile=1024:1024 \
|
|
||||||
--init-path /usr/libexec/docker/docker-init \
|
|
||||||
--userland-proxy-path /usr/libexec/docker/docker-proxy \
|
|
||||||
"
|
|
||||||
passwd:
|
passwd:
|
||||||
users:
|
users:
|
||||||
- name: core
|
- name: core
|
||||||
|
@ -34,10 +34,10 @@ variable "instance_type" {
|
|||||||
default = "t3.small"
|
default = "t3.small"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "os_image" {
|
variable "os_stream" {
|
||||||
type = string
|
type = string
|
||||||
description = "AMI channel for Fedora CoreOS (not yet used)"
|
description = "Fedora CoreOs image stream for instances (e.g. stable, testing, next)"
|
||||||
default = "coreos-stable"
|
default = "stable"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "disk_size" {
|
variable "disk_size" {
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
|
# Terraform version and plugin versions
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
required_version = ">= 0.12"
|
required_version = ">= 0.12.26, < 0.14.0"
|
||||||
|
required_providers {
|
||||||
|
aws = ">= 2.23, <= 4.0"
|
||||||
|
template = "~> 2.1"
|
||||||
|
|
||||||
|
ct = {
|
||||||
|
source = "poseidon/ct"
|
||||||
|
version = "~> 0.6.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@ Typhoon distributes upstream Kubernetes, architectural conventions, and cluster
|
|||||||
|
|
||||||
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
||||||
|
|
||||||
* Kubernetes v1.17.4 (upstream)
|
* Kubernetes v1.19.0 (upstream)
|
||||||
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [flannel](https://github.com/coreos/flannel) networking
|
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [Cilium](https://github.com/cilium/cilium) or [flannel](https://github.com/coreos/flannel) networking
|
||||||
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
||||||
* Advanced features like [worker pools](https://typhoon.psdn.io/advanced/worker-pools/), [low-priority](https://typhoon.psdn.io/cl/azure/#low-priority) workers, and [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
* Advanced features like [worker pools](https://typhoon.psdn.io/advanced/worker-pools/), [low-priority](https://typhoon.psdn.io/cl/azure/#low-priority) workers, and [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
||||||
* Ready for Ingress, Prometheus, Grafana, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
* Ready for Ingress, Prometheus, Grafana, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Kubernetes assets (kubeconfig, manifests)
|
# Kubernetes assets (kubeconfig, manifests)
|
||||||
module "bootstrap" {
|
module "bootstrap" {
|
||||||
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=73784c1b2c791d9ba586a1478979ac34dd324dad"
|
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=79343f02aea7c69bb03dab2051aa95248c0471d7"
|
||||||
|
|
||||||
cluster_name = var.cluster_name
|
cluster_name = var.cluster_name
|
||||||
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]
|
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
systemd:
|
systemd:
|
||||||
units:
|
units:
|
||||||
- name: etcd-member.service
|
- name: etcd-member.service
|
||||||
enable: true
|
enabled: true
|
||||||
dropins:
|
dropins:
|
||||||
- name: 40-etcd-cluster.conf
|
- name: 40-etcd-cluster.conf
|
||||||
contents: |
|
contents: |
|
||||||
[Service]
|
[Service]
|
||||||
Environment="ETCD_IMAGE_TAG=v3.4.4"
|
Environment="ETCD_IMAGE_TAG=v3.4.12"
|
||||||
Environment="ETCD_IMAGE_URL=docker://quay.io/coreos/etcd"
|
Environment="ETCD_IMAGE_URL=docker://quay.io/coreos/etcd"
|
||||||
Environment="RKT_RUN_ARGS=--insecure-options=image"
|
Environment="RKT_RUN_ARGS=--insecure-options=image"
|
||||||
Environment="ETCD_NAME=${etcd_name}"
|
Environment="ETCD_NAME=${etcd_name}"
|
||||||
@ -28,11 +28,11 @@ systemd:
|
|||||||
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key"
|
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key"
|
||||||
Environment="ETCD_PEER_CLIENT_CERT_AUTH=true"
|
Environment="ETCD_PEER_CLIENT_CERT_AUTH=true"
|
||||||
- name: docker.service
|
- name: docker.service
|
||||||
enable: true
|
enabled: true
|
||||||
- name: locksmithd.service
|
- name: locksmithd.service
|
||||||
mask: true
|
mask: true
|
||||||
- name: wait-for-dns.service
|
- name: wait-for-dns.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Wait for DNS entries
|
Description=Wait for DNS entries
|
||||||
@ -46,12 +46,14 @@ systemd:
|
|||||||
RequiredBy=kubelet.service
|
RequiredBy=kubelet.service
|
||||||
RequiredBy=etcd-member.service
|
RequiredBy=etcd-member.service
|
||||||
- name: kubelet.service
|
- name: kubelet.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube
|
Description=Kubelet
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=docker://quay.io/poseidon/kubelet:v1.19.0
|
||||||
|
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
||||||
@ -90,25 +92,24 @@ systemd:
|
|||||||
--mount volume=var-log,target=/var/log \
|
--mount volume=var-log,target=/var/log \
|
||||||
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
||||||
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
$${KUBELET_IMAGE} -- \
|
||||||
--exec=/usr/local/bin/kubelet -- \
|
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
|
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
||||||
--client-ca-file=/etc/kubernetes/ca.crt \
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/master \
|
|
||||||
--node-labels=node.kubernetes.io/controller="true" \
|
--node-labels=node.kubernetes.io/controller="true" \
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
|
--register-with-taints=node-role.kubernetes.io/controller=:NoSchedule \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
||||||
Restart=always
|
Restart=always
|
||||||
@ -124,7 +125,6 @@ systemd:
|
|||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
WorkingDirectory=/opt/bootstrap
|
WorkingDirectory=/opt/bootstrap
|
||||||
ExecStartPre=-/usr/bin/bash -c 'set -x && [ -n "$(ls /opt/bootstrap/assets/manifests-*/* 2>/dev/null)" ] && mv /opt/bootstrap/assets/manifests-*/* /opt/bootstrap/assets/manifests && rm -rf /opt/bootstrap/assets/manifests-*'
|
|
||||||
ExecStart=/usr/bin/rkt run \
|
ExecStart=/usr/bin/rkt run \
|
||||||
--trust-keys-from-https \
|
--trust-keys-from-https \
|
||||||
--volume config,kind=host,source=/etc/kubernetes/bootstrap-secrets \
|
--volume config,kind=host,source=/etc/kubernetes/bootstrap-secrets \
|
||||||
@ -134,7 +134,7 @@ systemd:
|
|||||||
--volume script,kind=host,source=/opt/bootstrap/apply \
|
--volume script,kind=host,source=/opt/bootstrap/apply \
|
||||||
--mount volume=script,target=/apply \
|
--mount volume=script,target=/apply \
|
||||||
--insecure-options=image \
|
--insecure-options=image \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
docker://quay.io/poseidon/kubelet:v1.19.0 \
|
||||||
--net=host \
|
--net=host \
|
||||||
--dns=host \
|
--dns=host \
|
||||||
--exec=/apply
|
--exec=/apply
|
||||||
@ -142,6 +142,11 @@ systemd:
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
storage:
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /var/lib/etcd
|
||||||
|
filesystem: root
|
||||||
|
mode: 0700
|
||||||
|
overwrite: true
|
||||||
files:
|
files:
|
||||||
- path: /etc/kubernetes/kubeconfig
|
- path: /etc/kubernetes/kubeconfig
|
||||||
filesystem: root
|
filesystem: root
|
||||||
@ -163,14 +168,15 @@ storage:
|
|||||||
mv tls/etcd/etcd-client* /etc/kubernetes/bootstrap-secrets/
|
mv tls/etcd/etcd-client* /etc/kubernetes/bootstrap-secrets/
|
||||||
chown -R etcd:etcd /etc/ssl/etcd
|
chown -R etcd:etcd /etc/ssl/etcd
|
||||||
chmod -R 500 /etc/ssl/etcd
|
chmod -R 500 /etc/ssl/etcd
|
||||||
|
chmod -R 700 /var/lib/etcd
|
||||||
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
||||||
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
||||||
sudo mkdir -p /etc/kubernetes/manifests
|
mkdir -p /etc/kubernetes/manifests
|
||||||
sudo mv static-manifests/* /etc/kubernetes/manifests/
|
mv static-manifests/* /etc/kubernetes/manifests/
|
||||||
sudo mkdir -p /opt/bootstrap/assets
|
mkdir -p /opt/bootstrap/assets
|
||||||
sudo mv manifests /opt/bootstrap/assets/manifests
|
mv manifests /opt/bootstrap/assets/manifests
|
||||||
sudo mv manifests-networking /opt/bootstrap/assets/manifests-networking
|
mv manifests-networking/* /opt/bootstrap/assets/manifests/
|
||||||
rm -rf assets auth static-manifests tls
|
rm -rf assets auth static-manifests tls manifests-networking
|
||||||
- path: /opt/bootstrap/apply
|
- path: /opt/bootstrap/apply
|
||||||
filesystem: root
|
filesystem: root
|
||||||
mode: 0544
|
mode: 0544
|
||||||
@ -188,6 +194,7 @@ storage:
|
|||||||
done
|
done
|
||||||
- path: /etc/sysctl.d/max-user-watches.conf
|
- path: /etc/sysctl.d/max-user-watches.conf
|
||||||
filesystem: root
|
filesystem: root
|
||||||
|
mode: 0644
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
|
@ -53,21 +53,22 @@ resource "azurerm_linux_virtual_machine" "controllers" {
|
|||||||
storage_account_type = "Premium_LRS"
|
storage_account_type = "Premium_LRS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# CoreOS Container Linux or Flatcar Container Linux
|
||||||
source_image_reference {
|
source_image_reference {
|
||||||
publisher = local.flavor == "flatcar" ? "Kinvolk" : "CoreOS"
|
publisher = local.flavor == "flatcar" ? "Kinvolk" : "CoreOS"
|
||||||
offer = local.flavor == "flatcar" ? "flatcar-container-linux" : "CoreOS"
|
offer = local.flavor == "flatcar" ? "flatcar-container-linux-free" : "CoreOS"
|
||||||
sku = local.channel
|
sku = local.channel
|
||||||
version = "latest"
|
version = "latest"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Gross hack just for Flatcar Linux
|
# Gross hack for Flatcar Linux
|
||||||
dynamic "plan" {
|
dynamic "plan" {
|
||||||
for_each = local.flavor == "flatcar" ? [1] : []
|
for_each = local.flavor == "flatcar" ? [1] : []
|
||||||
|
|
||||||
content {
|
content {
|
||||||
name = local.channel
|
name = local.channel
|
||||||
publisher = "kinvolk"
|
publisher = "kinvolk"
|
||||||
product = "flatcar-container-linux"
|
product = "flatcar-container-linux-free"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,10 +139,10 @@ resource "azurerm_network_interface_backend_address_pool_association" "controlle
|
|||||||
|
|
||||||
# Controller Ignition configs
|
# Controller Ignition configs
|
||||||
data "ct_config" "controller-ignitions" {
|
data "ct_config" "controller-ignitions" {
|
||||||
count = var.controller_count
|
count = var.controller_count
|
||||||
content = data.template_file.controller-configs.*.rendered[count.index]
|
content = data.template_file.controller-configs.*.rendered[count.index]
|
||||||
pretty_print = false
|
strict = true
|
||||||
snippets = var.controller_clc_snippets
|
snippets = var.controller_snippets
|
||||||
}
|
}
|
||||||
|
|
||||||
# Controller Container Linux configs
|
# Controller Container Linux configs
|
||||||
@ -156,6 +157,7 @@ data "template_file" "controller-configs" {
|
|||||||
etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}"
|
etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}"
|
||||||
# etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,...
|
# etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,...
|
||||||
etcd_initial_cluster = join(",", data.template_file.etcds.*.rendered)
|
etcd_initial_cluster = join(",", data.template_file.etcds.*.rendered)
|
||||||
|
cgroup_driver = local.flavor == "flatcar" && local.channel == "edge" ? "systemd" : "cgroupfs"
|
||||||
kubeconfig = indent(10, module.bootstrap.kubeconfig-kubelet)
|
kubeconfig = indent(10, module.bootstrap.kubeconfig-kubelet)
|
||||||
ssh_authorized_key = var.ssh_authorized_key
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
|
cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
|
||||||
|
@ -72,6 +72,7 @@ resource "azurerm_lb_rule" "ingress-http" {
|
|||||||
name = "ingress-http"
|
name = "ingress-http"
|
||||||
loadbalancer_id = azurerm_lb.cluster.id
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
frontend_ip_configuration_name = "ingress"
|
frontend_ip_configuration_name = "ingress"
|
||||||
|
disable_outbound_snat = true
|
||||||
|
|
||||||
protocol = "Tcp"
|
protocol = "Tcp"
|
||||||
frontend_port = 80
|
frontend_port = 80
|
||||||
@ -86,6 +87,7 @@ resource "azurerm_lb_rule" "ingress-https" {
|
|||||||
name = "ingress-https"
|
name = "ingress-https"
|
||||||
loadbalancer_id = azurerm_lb.cluster.id
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
frontend_ip_configuration_name = "ingress"
|
frontend_ip_configuration_name = "ingress"
|
||||||
|
disable_outbound_snat = true
|
||||||
|
|
||||||
protocol = "Tcp"
|
protocol = "Tcp"
|
||||||
frontend_port = 443
|
frontend_port = 443
|
||||||
@ -94,6 +96,20 @@ resource "azurerm_lb_rule" "ingress-https" {
|
|||||||
probe_id = azurerm_lb_probe.ingress.id
|
probe_id = azurerm_lb_probe.ingress.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Worker outbound TCP/UDP SNAT
|
||||||
|
resource "azurerm_lb_outbound_rule" "worker-outbound" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "worker"
|
||||||
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
|
frontend_ip_configuration {
|
||||||
|
name = "ingress"
|
||||||
|
}
|
||||||
|
|
||||||
|
protocol = "All"
|
||||||
|
backend_address_pool_id = azurerm_lb_backend_address_pool.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
# Address pool of controllers
|
# Address pool of controllers
|
||||||
resource "azurerm_lb_backend_address_pool" "controller" {
|
resource "azurerm_lb_backend_address_pool" "controller" {
|
||||||
resource_group_name = azurerm_resource_group.cluster.name
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
@ -21,7 +21,7 @@ resource "azurerm_subnet" "controller" {
|
|||||||
|
|
||||||
name = "controller"
|
name = "controller"
|
||||||
virtual_network_name = azurerm_virtual_network.network.name
|
virtual_network_name = azurerm_virtual_network.network.name
|
||||||
address_prefix = cidrsubnet(var.host_cidr, 1, 0)
|
address_prefixes = [cidrsubnet(var.host_cidr, 1, 0)]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_subnet_network_security_group_association" "controller" {
|
resource "azurerm_subnet_network_security_group_association" "controller" {
|
||||||
@ -34,7 +34,7 @@ resource "azurerm_subnet" "worker" {
|
|||||||
|
|
||||||
name = "worker"
|
name = "worker"
|
||||||
virtual_network_name = azurerm_virtual_network.network.name
|
virtual_network_name = azurerm_virtual_network.network.name
|
||||||
address_prefix = cidrsubnet(var.host_cidr, 1, 1)
|
address_prefixes = [cidrsubnet(var.host_cidr, 1, 1)]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_subnet_network_security_group_association" "worker" {
|
resource "azurerm_subnet_network_security_group_association" "worker" {
|
||||||
|
@ -7,6 +7,21 @@ resource "azurerm_network_security_group" "controller" {
|
|||||||
location = azurerm_resource_group.cluster.location
|
location = azurerm_resource_group.cluster.location
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-icmp" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-icmp"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "1995"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Icmp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "*"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
resource "azurerm_network_security_rule" "controller-ssh" {
|
resource "azurerm_network_security_rule" "controller-ssh" {
|
||||||
resource_group_name = azurerm_resource_group.cluster.name
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
@ -100,6 +115,22 @@ resource "azurerm_network_security_rule" "controller-apiserver" {
|
|||||||
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-cilium-health" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
name = "allow-cilium-health"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2019"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "4240"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
resource "azurerm_network_security_rule" "controller-vxlan" {
|
resource "azurerm_network_security_rule" "controller-vxlan" {
|
||||||
resource_group_name = azurerm_resource_group.cluster.name
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
@ -115,6 +146,21 @@ resource "azurerm_network_security_rule" "controller-vxlan" {
|
|||||||
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-linux-vxlan" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-linux-vxlan"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2021"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Udp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "8472"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape node-exporter daemonset
|
# Allow Prometheus to scrape node-exporter daemonset
|
||||||
resource "azurerm_network_security_rule" "controller-node-exporter" {
|
resource "azurerm_network_security_rule" "controller-node-exporter" {
|
||||||
resource_group_name = azurerm_resource_group.cluster.name
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
@ -191,6 +237,21 @@ resource "azurerm_network_security_group" "worker" {
|
|||||||
location = azurerm_resource_group.cluster.location
|
location = azurerm_resource_group.cluster.location
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-icmp" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-icmp"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "1995"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Icmp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "*"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
resource "azurerm_network_security_rule" "worker-ssh" {
|
resource "azurerm_network_security_rule" "worker-ssh" {
|
||||||
resource_group_name = azurerm_resource_group.cluster.name
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
@ -236,6 +297,22 @@ resource "azurerm_network_security_rule" "worker-https" {
|
|||||||
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-cilium-health" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
name = "allow-cilium-health"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2014"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "4240"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
resource "azurerm_network_security_rule" "worker-vxlan" {
|
resource "azurerm_network_security_rule" "worker-vxlan" {
|
||||||
resource_group_name = azurerm_resource_group.cluster.name
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
@ -251,6 +328,21 @@ resource "azurerm_network_security_rule" "worker-vxlan" {
|
|||||||
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-linux-vxlan" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-linux-vxlan"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2016"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Udp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "8472"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
# Allow Prometheus to scrape node-exporter daemonset
|
# Allow Prometheus to scrape node-exporter daemonset
|
||||||
resource "azurerm_network_security_rule" "worker-node-exporter" {
|
resource "azurerm_network_security_rule" "worker-node-exporter" {
|
||||||
resource_group_name = azurerm_resource_group.cluster.name
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
@ -48,8 +48,8 @@ variable "worker_type" {
|
|||||||
|
|
||||||
variable "os_image" {
|
variable "os_image" {
|
||||||
type = string
|
type = string
|
||||||
default = "coreos-stable"
|
description = "Channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge, coreos-stable, coreos-beta, coreos-alpha)"
|
||||||
description = "Channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta)"
|
default = "flatcar-stable"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "disk_size" {
|
variable "disk_size" {
|
||||||
@ -60,17 +60,17 @@ variable "disk_size" {
|
|||||||
|
|
||||||
variable "worker_priority" {
|
variable "worker_priority" {
|
||||||
type = string
|
type = string
|
||||||
description = "Set worker priority to Low to use reduced cost surplus capacity, with the tradeoff that instances can be deallocated at any time."
|
description = "Set worker priority to Spot to use reduced cost surplus capacity, with the tradeoff that instances can be deallocated at any time."
|
||||||
default = "Regular"
|
default = "Regular"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "controller_clc_snippets" {
|
variable "controller_snippets" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Controller Container Linux Config snippets"
|
description = "Controller Container Linux Config snippets"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_clc_snippets" {
|
variable "worker_snippets" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Worker Container Linux Config snippets"
|
description = "Worker Container Linux Config snippets"
|
||||||
default = []
|
default = []
|
||||||
@ -83,12 +83,6 @@ variable "ssh_authorized_key" {
|
|||||||
description = "SSH public key for user 'core'"
|
description = "SSH public key for user 'core'"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "asset_dir" {
|
|
||||||
type = string
|
|
||||||
description = "Absolute path to a directory where generated assets should be placed (contains secrets)"
|
|
||||||
default = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "networking" {
|
variable "networking" {
|
||||||
type = string
|
type = string
|
||||||
description = "Choice of networking provider (flannel or calico)"
|
description = "Choice of networking provider (flannel or calico)"
|
||||||
@ -136,6 +130,12 @@ variable "worker_node_labels" {
|
|||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
|
variable "asset_dir" {
|
||||||
|
type = string
|
||||||
|
description = "Absolute path to a directory where generated assets should be placed (contains secrets)"
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
variable "cluster_domain_suffix" {
|
||||||
type = string
|
type = string
|
||||||
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
|
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
# Terraform version and plugin versions
|
# Terraform version and plugin versions
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
required_version = "~> 0.12.6"
|
required_version = ">= 0.12.26, < 0.14.0"
|
||||||
required_providers {
|
required_providers {
|
||||||
azurerm = "~> 2.0"
|
azurerm = "~> 2.8"
|
||||||
ct = "~> 0.3"
|
|
||||||
template = "~> 2.1"
|
template = "~> 2.1"
|
||||||
null = "~> 2.1"
|
null = "~> 2.1"
|
||||||
|
|
||||||
|
ct = {
|
||||||
|
source = "poseidon/ct"
|
||||||
|
version = "~> 0.6.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,6 @@ module "workers" {
|
|||||||
ssh_authorized_key = var.ssh_authorized_key
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
service_cidr = var.service_cidr
|
service_cidr = var.service_cidr
|
||||||
cluster_domain_suffix = var.cluster_domain_suffix
|
cluster_domain_suffix = var.cluster_domain_suffix
|
||||||
clc_snippets = var.worker_clc_snippets
|
snippets = var.worker_snippets
|
||||||
node_labels = var.worker_node_labels
|
node_labels = var.worker_node_labels
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
systemd:
|
systemd:
|
||||||
units:
|
units:
|
||||||
- name: docker.service
|
- name: docker.service
|
||||||
enable: true
|
enabled: true
|
||||||
- name: locksmithd.service
|
- name: locksmithd.service
|
||||||
mask: true
|
mask: true
|
||||||
- name: wait-for-dns.service
|
- name: wait-for-dns.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Wait for DNS entries
|
Description=Wait for DNS entries
|
||||||
@ -19,12 +19,14 @@ systemd:
|
|||||||
[Install]
|
[Install]
|
||||||
RequiredBy=kubelet.service
|
RequiredBy=kubelet.service
|
||||||
- name: kubelet.service
|
- name: kubelet.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube
|
Description=Kubelet
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=docker://quay.io/poseidon/kubelet:v1.19.0
|
||||||
|
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
||||||
@ -63,26 +65,26 @@ systemd:
|
|||||||
--mount volume=var-log,target=/var/log \
|
--mount volume=var-log,target=/var/log \
|
||||||
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
||||||
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
$${KUBELET_IMAGE} -- \
|
||||||
--exec=/usr/local/bin/kubelet -- \
|
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
|
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
||||||
--client-ca-file=/etc/kubernetes/ca.crt \
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/node \
|
--node-labels=node.kubernetes.io/node \
|
||||||
%{ for label in split(",", node_labels) }
|
%{~ for label in split(",", node_labels) ~}
|
||||||
--node-labels=${label} \
|
--node-labels=${label} \
|
||||||
%{ endfor ~}
|
%{~ endfor ~}
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
||||||
Restart=always
|
Restart=always
|
||||||
@ -90,7 +92,7 @@ systemd:
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
- name: delete-node.service
|
- name: delete-node.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Waiting to delete Kubernetes node on shutdown
|
Description=Waiting to delete Kubernetes node on shutdown
|
||||||
@ -111,6 +113,7 @@ storage:
|
|||||||
${kubeconfig}
|
${kubeconfig}
|
||||||
- path: /etc/sysctl.d/max-user-watches.conf
|
- path: /etc/sysctl.d/max-user-watches.conf
|
||||||
filesystem: root
|
filesystem: root
|
||||||
|
mode: 0644
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
@ -126,11 +129,10 @@ storage:
|
|||||||
--volume config,kind=host,source=/etc/kubernetes \
|
--volume config,kind=host,source=/etc/kubernetes \
|
||||||
--mount volume=config,target=/etc/kubernetes \
|
--mount volume=config,target=/etc/kubernetes \
|
||||||
--insecure-options=image \
|
--insecure-options=image \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
docker://quay.io/poseidon/kubelet:v1.19.0 \
|
||||||
--net=host \
|
--net=host \
|
||||||
--dns=host \
|
--dns=host \
|
||||||
-- \
|
--exec=/usr/local/bin/kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname | tr '[:upper:]' '[:lower:]')
|
||||||
kubectl -- --kubeconfig=/etc/kubernetes/kubeconfig delete node $(hostname | tr '[:upper:]' '[:lower:]')
|
|
||||||
passwd:
|
passwd:
|
||||||
users:
|
users:
|
||||||
- name: core
|
- name: core
|
||||||
|
@ -46,17 +46,17 @@ variable "vm_type" {
|
|||||||
|
|
||||||
variable "os_image" {
|
variable "os_image" {
|
||||||
type = string
|
type = string
|
||||||
description = "Channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha)"
|
description = "Channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge, coreos-stable, coreos-beta, coreos-alpha)"
|
||||||
default = "coreos-stable"
|
default = "flatcar-stable"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "priority" {
|
variable "priority" {
|
||||||
type = string
|
type = string
|
||||||
description = "Set priority to Low to use reduced cost surplus capacity, with the tradeoff that instances can be evicted at any time."
|
description = "Set priority to Spot to use reduced cost surplus capacity, with the tradeoff that instances can be evicted at any time."
|
||||||
default = "Regular"
|
default = "Regular"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "clc_snippets" {
|
variable "snippets" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Container Linux Config snippets"
|
description = "Container Linux Config snippets"
|
||||||
default = []
|
default = []
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
|
# Terraform version and plugin versions
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
required_version = ">= 0.12"
|
required_version = ">= 0.12.26, < 0.14.0"
|
||||||
|
required_providers {
|
||||||
|
azurerm = "~> 2.8"
|
||||||
|
template = "~> 2.1"
|
||||||
|
|
||||||
|
ct = {
|
||||||
|
source = "poseidon/ct"
|
||||||
|
version = "~> 0.6.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,43 +9,44 @@ locals {
|
|||||||
resource "azurerm_linux_virtual_machine_scale_set" "workers" {
|
resource "azurerm_linux_virtual_machine_scale_set" "workers" {
|
||||||
resource_group_name = var.resource_group_name
|
resource_group_name = var.resource_group_name
|
||||||
|
|
||||||
name = "${var.name}-worker"
|
name = "${var.name}-worker"
|
||||||
location = var.region
|
location = var.region
|
||||||
sku = var.vm_type
|
sku = var.vm_type
|
||||||
instances = var.worker_count
|
instances = var.worker_count
|
||||||
# instance name prefix for instances in the set
|
# instance name prefix for instances in the set
|
||||||
computer_name_prefix = "${var.name}-worker"
|
computer_name_prefix = "${var.name}-worker"
|
||||||
single_placement_group = false
|
single_placement_group = false
|
||||||
custom_data = base64encode(data.ct_config.worker-ignition.rendered)
|
custom_data = base64encode(data.ct_config.worker-ignition.rendered)
|
||||||
|
|
||||||
# storage
|
# storage
|
||||||
os_disk {
|
os_disk {
|
||||||
storage_account_type = "Standard_LRS"
|
storage_account_type = "Standard_LRS"
|
||||||
caching = "ReadWrite"
|
caching = "ReadWrite"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# CoreOS Container Linux or Flatcar Container Linux
|
||||||
source_image_reference {
|
source_image_reference {
|
||||||
publisher = local.flavor == "flatcar" ? "Kinvolk" : "CoreOS"
|
publisher = local.flavor == "flatcar" ? "Kinvolk" : "CoreOS"
|
||||||
offer = local.flavor == "flatcar" ? "flatcar-container-linux" : "CoreOS"
|
offer = local.flavor == "flatcar" ? "flatcar-container-linux-free" : "CoreOS"
|
||||||
sku = local.channel
|
sku = local.channel
|
||||||
version = "latest"
|
version = "latest"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Gross hack just for Flatcar Linux
|
# Gross hack for Flatcar Linux
|
||||||
dynamic "plan" {
|
dynamic "plan" {
|
||||||
for_each = local.flavor == "flatcar" ? [1] : []
|
for_each = local.flavor == "flatcar" ? [1] : []
|
||||||
|
|
||||||
content {
|
content {
|
||||||
name = local.channel
|
name = local.channel
|
||||||
publisher = "kinvolk"
|
publisher = "kinvolk"
|
||||||
product = "flatcar-container-linux"
|
product = "flatcar-container-linux-free"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Azure requires setting admin_ssh_key, though Ignition custom_data handles it too
|
# Azure requires setting admin_ssh_key, though Ignition custom_data handles it too
|
||||||
admin_username = "core"
|
admin_username = "core"
|
||||||
admin_ssh_key {
|
admin_ssh_key {
|
||||||
username = "core"
|
username = "core"
|
||||||
public_key = var.ssh_authorized_key
|
public_key = var.ssh_authorized_key
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,9 +97,9 @@ resource "azurerm_monitor_autoscale_setting" "workers" {
|
|||||||
|
|
||||||
# Worker Ignition configs
|
# Worker Ignition configs
|
||||||
data "ct_config" "worker-ignition" {
|
data "ct_config" "worker-ignition" {
|
||||||
content = data.template_file.worker-config.rendered
|
content = data.template_file.worker-config.rendered
|
||||||
pretty_print = false
|
strict = true
|
||||||
snippets = var.clc_snippets
|
snippets = var.snippets
|
||||||
}
|
}
|
||||||
|
|
||||||
# Worker Container Linux configs
|
# Worker Container Linux configs
|
||||||
@ -110,6 +111,7 @@ data "template_file" "worker-config" {
|
|||||||
ssh_authorized_key = var.ssh_authorized_key
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
|
cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
|
||||||
cluster_domain_suffix = var.cluster_domain_suffix
|
cluster_domain_suffix = var.cluster_domain_suffix
|
||||||
|
cgroup_driver = local.flavor == "flatcar" && local.channel == "edge" ? "systemd" : "cgroupfs"
|
||||||
node_labels = join(",", var.node_labels)
|
node_labels = join(",", var.node_labels)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
23
azure/fedora-coreos/kubernetes/LICENSE
Normal file
23
azure/fedora-coreos/kubernetes/LICENSE
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2020 Typhoon Authors
|
||||||
|
Copyright (c) 2020 Dalton Hubble
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
23
azure/fedora-coreos/kubernetes/README.md
Normal file
23
azure/fedora-coreos/kubernetes/README.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Typhoon <img align="right" src="https://storage.googleapis.com/poseidon/typhoon-logo.png">
|
||||||
|
|
||||||
|
Typhoon is a minimal and free Kubernetes distribution.
|
||||||
|
|
||||||
|
* Minimal, stable base Kubernetes distribution
|
||||||
|
* Declarative infrastructure and configuration
|
||||||
|
* Free (freedom and cost) and privacy-respecting
|
||||||
|
* Practical for labs, datacenters, and clouds
|
||||||
|
|
||||||
|
Typhoon distributes upstream Kubernetes, architectural conventions, and cluster addons, much like a GNU/Linux distribution provides the Linux kernel and userspace components.
|
||||||
|
|
||||||
|
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
||||||
|
|
||||||
|
* Kubernetes v1.19.0 (upstream)
|
||||||
|
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [Cilium](https://github.com/cilium/cilium) or [flannel](https://github.com/coreos/flannel) networking
|
||||||
|
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/), SELinux enforcing
|
||||||
|
* Advanced features like [worker pools](https://typhoon.psdn.io/advanced/worker-pools/), [spot priority](https://typhoon.psdn.io/fedora-coreos/azure/#low-priority) workers, and [snippets](https://typhoon.psdn.io/advanced/customization/) customization
|
||||||
|
* Ready for Ingress, Prometheus, Grafana, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
||||||
|
|
||||||
|
## Docs
|
||||||
|
|
||||||
|
Please see the [official docs](https://typhoon.psdn.io) and the Azure [tutorial](https://typhoon.psdn.io/fedora-coreos/azure/).
|
||||||
|
|
26
azure/fedora-coreos/kubernetes/bootstrap.tf
Normal file
26
azure/fedora-coreos/kubernetes/bootstrap.tf
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Kubernetes assets (kubeconfig, manifests)
|
||||||
|
module "bootstrap" {
|
||||||
|
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=79343f02aea7c69bb03dab2051aa95248c0471d7"
|
||||||
|
|
||||||
|
cluster_name = var.cluster_name
|
||||||
|
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]
|
||||||
|
etcd_servers = formatlist("%s.%s", azurerm_dns_a_record.etcds.*.name, var.dns_zone)
|
||||||
|
asset_dir = var.asset_dir
|
||||||
|
|
||||||
|
networking = var.networking
|
||||||
|
|
||||||
|
# only effective with Calico networking
|
||||||
|
# we should be able to use 1450 MTU, but in practice, 1410 was needed
|
||||||
|
network_encapsulation = "vxlan"
|
||||||
|
network_mtu = "1410"
|
||||||
|
|
||||||
|
pod_cidr = var.pod_cidr
|
||||||
|
service_cidr = var.service_cidr
|
||||||
|
cluster_domain_suffix = var.cluster_domain_suffix
|
||||||
|
enable_reporting = var.enable_reporting
|
||||||
|
enable_aggregation = var.enable_aggregation
|
||||||
|
|
||||||
|
# Fedora CoreOS
|
||||||
|
trusted_certs_dir = "/etc/pki/tls/certs"
|
||||||
|
}
|
||||||
|
|
151
azure/fedora-coreos/kubernetes/controllers.tf
Normal file
151
azure/fedora-coreos/kubernetes/controllers.tf
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
# Discrete DNS records for each controller's private IPv4 for etcd usage
|
||||||
|
resource "azurerm_dns_a_record" "etcds" {
|
||||||
|
count = var.controller_count
|
||||||
|
resource_group_name = var.dns_zone_group
|
||||||
|
|
||||||
|
# DNS Zone name where record should be created
|
||||||
|
zone_name = var.dns_zone
|
||||||
|
|
||||||
|
# DNS record
|
||||||
|
name = format("%s-etcd%d", var.cluster_name, count.index)
|
||||||
|
ttl = 300
|
||||||
|
|
||||||
|
# private IPv4 address for etcd
|
||||||
|
records = [azurerm_network_interface.controllers.*.private_ip_address[count.index]]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Controller availability set to spread controllers
|
||||||
|
resource "azurerm_availability_set" "controllers" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "${var.cluster_name}-controllers"
|
||||||
|
location = var.region
|
||||||
|
platform_fault_domain_count = 2
|
||||||
|
platform_update_domain_count = 4
|
||||||
|
managed = true
|
||||||
|
}
|
||||||
|
|
||||||
|
# Controller instances
|
||||||
|
resource "azurerm_linux_virtual_machine" "controllers" {
|
||||||
|
count = var.controller_count
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "${var.cluster_name}-controller-${count.index}"
|
||||||
|
location = var.region
|
||||||
|
availability_set_id = azurerm_availability_set.controllers.id
|
||||||
|
|
||||||
|
size = var.controller_type
|
||||||
|
custom_data = base64encode(data.ct_config.controller-ignitions.*.rendered[count.index])
|
||||||
|
|
||||||
|
# storage
|
||||||
|
source_image_id = var.os_image
|
||||||
|
os_disk {
|
||||||
|
name = "${var.cluster_name}-controller-${count.index}"
|
||||||
|
caching = "None"
|
||||||
|
disk_size_gb = var.disk_size
|
||||||
|
storage_account_type = "Premium_LRS"
|
||||||
|
}
|
||||||
|
|
||||||
|
# network
|
||||||
|
network_interface_ids = [
|
||||||
|
azurerm_network_interface.controllers.*.id[count.index]
|
||||||
|
]
|
||||||
|
|
||||||
|
# Azure requires setting admin_ssh_key, though Ignition custom_data handles it too
|
||||||
|
admin_username = "core"
|
||||||
|
admin_ssh_key {
|
||||||
|
username = "core"
|
||||||
|
public_key = var.ssh_authorized_key
|
||||||
|
}
|
||||||
|
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
os_disk,
|
||||||
|
custom_data,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Controller public IPv4 addresses
|
||||||
|
resource "azurerm_public_ip" "controllers" {
|
||||||
|
count = var.controller_count
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "${var.cluster_name}-controller-${count.index}"
|
||||||
|
location = azurerm_resource_group.cluster.location
|
||||||
|
sku = "Standard"
|
||||||
|
allocation_method = "Static"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Controller NICs with public and private IPv4
|
||||||
|
resource "azurerm_network_interface" "controllers" {
|
||||||
|
count = var.controller_count
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "${var.cluster_name}-controller-${count.index}"
|
||||||
|
location = azurerm_resource_group.cluster.location
|
||||||
|
|
||||||
|
ip_configuration {
|
||||||
|
name = "ip0"
|
||||||
|
subnet_id = azurerm_subnet.controller.id
|
||||||
|
private_ip_address_allocation = "Dynamic"
|
||||||
|
# instance public IPv4
|
||||||
|
public_ip_address_id = azurerm_public_ip.controllers.*.id[count.index]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Associate controller network interface with controller security group
|
||||||
|
resource "azurerm_network_interface_security_group_association" "controllers" {
|
||||||
|
count = var.controller_count
|
||||||
|
|
||||||
|
network_interface_id = azurerm_network_interface.controllers[count.index].id
|
||||||
|
network_security_group_id = azurerm_network_security_group.controller.id
|
||||||
|
}
|
||||||
|
|
||||||
|
# Associate controller network interface with controller backend address pool
|
||||||
|
resource "azurerm_network_interface_backend_address_pool_association" "controllers" {
|
||||||
|
count = var.controller_count
|
||||||
|
|
||||||
|
network_interface_id = azurerm_network_interface.controllers[count.index].id
|
||||||
|
ip_configuration_name = "ip0"
|
||||||
|
backend_address_pool_id = azurerm_lb_backend_address_pool.controller.id
|
||||||
|
}
|
||||||
|
|
||||||
|
# Controller Ignition configs
|
||||||
|
data "ct_config" "controller-ignitions" {
|
||||||
|
count = var.controller_count
|
||||||
|
content = data.template_file.controller-configs.*.rendered[count.index]
|
||||||
|
strict = true
|
||||||
|
snippets = var.controller_snippets
|
||||||
|
}
|
||||||
|
|
||||||
|
# Controller Fedora CoreOS configs
|
||||||
|
data "template_file" "controller-configs" {
|
||||||
|
count = var.controller_count
|
||||||
|
|
||||||
|
template = file("${path.module}/fcc/controller.yaml")
|
||||||
|
|
||||||
|
vars = {
|
||||||
|
# Cannot use cyclic dependencies on controllers or their DNS records
|
||||||
|
etcd_name = "etcd${count.index}"
|
||||||
|
etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}"
|
||||||
|
# etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,...
|
||||||
|
etcd_initial_cluster = join(",", data.template_file.etcds.*.rendered)
|
||||||
|
kubeconfig = indent(10, module.bootstrap.kubeconfig-kubelet)
|
||||||
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
|
cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
|
||||||
|
cluster_domain_suffix = var.cluster_domain_suffix
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data "template_file" "etcds" {
|
||||||
|
count = var.controller_count
|
||||||
|
template = "etcd$${index}=https://$${cluster_name}-etcd$${index}.$${dns_zone}:2380"
|
||||||
|
|
||||||
|
vars = {
|
||||||
|
index = count.index
|
||||||
|
cluster_name = var.cluster_name
|
||||||
|
dns_zone = var.dns_zone
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
228
azure/fedora-coreos/kubernetes/fcc/controller.yaml
Normal file
228
azure/fedora-coreos/kubernetes/fcc/controller.yaml
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
---
|
||||||
|
variant: fcos
|
||||||
|
version: 1.0.0
|
||||||
|
systemd:
|
||||||
|
units:
|
||||||
|
- name: etcd-member.service
|
||||||
|
enabled: true
|
||||||
|
contents: |
|
||||||
|
[Unit]
|
||||||
|
Description=etcd (System Container)
|
||||||
|
Documentation=https://github.com/coreos/etcd
|
||||||
|
Wants=network-online.target network.target
|
||||||
|
After=network-online.target
|
||||||
|
[Service]
|
||||||
|
# https://github.com/opencontainers/runc/pull/1807
|
||||||
|
# Type=notify
|
||||||
|
# NotifyAccess=exec
|
||||||
|
Type=exec
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=10s
|
||||||
|
TimeoutStartSec=0
|
||||||
|
LimitNOFILE=40000
|
||||||
|
ExecStartPre=/bin/mkdir -p /var/lib/etcd
|
||||||
|
ExecStartPre=-/usr/bin/podman rm etcd
|
||||||
|
#--volume $${NOTIFY_SOCKET}:/run/systemd/notify \
|
||||||
|
ExecStart=/usr/bin/podman run --name etcd \
|
||||||
|
--env-file /etc/etcd/etcd.env \
|
||||||
|
--network host \
|
||||||
|
--volume /var/lib/etcd:/var/lib/etcd:rw,Z \
|
||||||
|
--volume /etc/ssl/etcd:/etc/ssl/certs:ro,Z \
|
||||||
|
quay.io/coreos/etcd:v3.4.12
|
||||||
|
ExecStop=/usr/bin/podman stop etcd
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
- name: docker.service
|
||||||
|
enabled: true
|
||||||
|
- name: wait-for-dns.service
|
||||||
|
enabled: true
|
||||||
|
contents: |
|
||||||
|
[Unit]
|
||||||
|
Description=Wait for DNS entries
|
||||||
|
Before=kubelet.service
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=true
|
||||||
|
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
|
||||||
|
[Install]
|
||||||
|
RequiredBy=kubelet.service
|
||||||
|
RequiredBy=etcd-member.service
|
||||||
|
- name: kubelet.service
|
||||||
|
enabled: true
|
||||||
|
contents: |
|
||||||
|
[Unit]
|
||||||
|
Description=Kubelet (System Container)
|
||||||
|
Wants=rpc-statd.service
|
||||||
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=quay.io/poseidon/kubelet:v1.19.0
|
||||||
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
||||||
|
ExecStartPre=/bin/mkdir -p /var/lib/calico
|
||||||
|
ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins
|
||||||
|
ExecStartPre=/usr/bin/bash -c "grep 'certificate-authority-data' /etc/kubernetes/kubeconfig | awk '{print $2}' | base64 -d > /etc/kubernetes/ca.crt"
|
||||||
|
ExecStartPre=-/usr/bin/podman rm kubelet
|
||||||
|
ExecStart=/usr/bin/podman run --name kubelet \
|
||||||
|
--privileged \
|
||||||
|
--pid host \
|
||||||
|
--network host \
|
||||||
|
--volume /etc/kubernetes:/etc/kubernetes:ro,z \
|
||||||
|
--volume /usr/lib/os-release:/etc/os-release:ro \
|
||||||
|
--volume /etc/ssl/certs:/etc/ssl/certs:ro \
|
||||||
|
--volume /lib/modules:/lib/modules:ro \
|
||||||
|
--volume /run:/run \
|
||||||
|
--volume /sys/fs/cgroup:/sys/fs/cgroup:ro \
|
||||||
|
--volume /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd \
|
||||||
|
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \
|
||||||
|
--volume /var/lib/calico:/var/lib/calico:ro \
|
||||||
|
--volume /var/lib/docker:/var/lib/docker \
|
||||||
|
--volume /var/lib/kubelet:/var/lib/kubelet:rshared,z \
|
||||||
|
--volume /var/log:/var/log \
|
||||||
|
--volume /var/run/lock:/var/run/lock:z \
|
||||||
|
--volume /opt/cni/bin:/opt/cni/bin:z \
|
||||||
|
$${KUBELET_IMAGE} \
|
||||||
|
--anonymous-auth=false \
|
||||||
|
--authentication-token-webhook \
|
||||||
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
|
--cgroup-driver=systemd \
|
||||||
|
--cgroups-per-qos=true \
|
||||||
|
--enforce-node-allocatable=pods \
|
||||||
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
||||||
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
|
--healthz-port=0 \
|
||||||
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
|
--network-plugin=cni \
|
||||||
|
--node-labels=node.kubernetes.io/controller="true" \
|
||||||
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
|
--read-only-port=0 \
|
||||||
|
--register-with-taints=node-role.kubernetes.io/controller=:NoSchedule \
|
||||||
|
--rotate-certificates \
|
||||||
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
|
ExecStop=-/usr/bin/podman stop kubelet
|
||||||
|
Delegate=yes
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
- name: bootstrap.service
|
||||||
|
contents: |
|
||||||
|
[Unit]
|
||||||
|
Description=Kubernetes control plane
|
||||||
|
ConditionPathExists=!/opt/bootstrap/bootstrap.done
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=true
|
||||||
|
WorkingDirectory=/opt/bootstrap
|
||||||
|
ExecStartPre=-/usr/bin/podman rm bootstrap
|
||||||
|
ExecStart=/usr/bin/podman run --name bootstrap \
|
||||||
|
--network host \
|
||||||
|
--volume /etc/kubernetes/bootstrap-secrets:/etc/kubernetes/secrets:ro,z \
|
||||||
|
--volume /opt/bootstrap/assets:/assets:ro,Z \
|
||||||
|
--volume /opt/bootstrap/apply:/apply:ro,Z \
|
||||||
|
--entrypoint=/apply \
|
||||||
|
quay.io/poseidon/kubelet:v1.19.0
|
||||||
|
ExecStartPost=/bin/touch /opt/bootstrap/bootstrap.done
|
||||||
|
ExecStartPost=-/usr/bin/podman stop bootstrap
|
||||||
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /var/lib/etcd
|
||||||
|
mode: 0700
|
||||||
|
- path: /etc/kubernetes
|
||||||
|
- path: /opt/bootstrap
|
||||||
|
files:
|
||||||
|
- path: /etc/kubernetes/kubeconfig
|
||||||
|
mode: 0644
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
${kubeconfig}
|
||||||
|
- path: /opt/bootstrap/layout
|
||||||
|
mode: 0544
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
#!/bin/bash -e
|
||||||
|
mkdir -p -- auth tls/etcd tls/k8s static-manifests manifests/coredns manifests-networking
|
||||||
|
awk '/#####/ {filename=$2; next} {print > filename}' assets
|
||||||
|
mkdir -p /etc/ssl/etcd/etcd
|
||||||
|
mkdir -p /etc/kubernetes/bootstrap-secrets
|
||||||
|
mv tls/etcd/{peer*,server*} /etc/ssl/etcd/etcd/
|
||||||
|
mv tls/etcd/etcd-client* /etc/kubernetes/bootstrap-secrets/
|
||||||
|
chown -R etcd:etcd /etc/ssl/etcd
|
||||||
|
chmod -R 500 /etc/ssl/etcd
|
||||||
|
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
||||||
|
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
||||||
|
mkdir -p /etc/kubernetes/manifests
|
||||||
|
mv static-manifests/* /etc/kubernetes/manifests/
|
||||||
|
mkdir -p /opt/bootstrap/assets
|
||||||
|
mv manifests /opt/bootstrap/assets/manifests
|
||||||
|
mv manifests-networking/* /opt/bootstrap/assets/manifests/
|
||||||
|
rm -rf assets auth static-manifests tls manifests-networking
|
||||||
|
chcon -R -u system_u -t container_file_t /etc/kubernetes/bootstrap-secrets
|
||||||
|
- path: /opt/bootstrap/apply
|
||||||
|
mode: 0544
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
#!/bin/bash -e
|
||||||
|
export KUBECONFIG=/etc/kubernetes/secrets/kubeconfig
|
||||||
|
until kubectl version; do
|
||||||
|
echo "Waiting for static pod control plane"
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
until kubectl apply -f /assets/manifests -R; do
|
||||||
|
echo "Retry applying manifests"
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
- path: /etc/sysctl.d/max-user-watches.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
fs.inotify.max_user_watches=16184
|
||||||
|
- path: /etc/sysctl.d/reverse-path-filter.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
net.ipv4.conf.default.rp_filter=0
|
||||||
|
net.ipv4.conf.*.rp_filter=0
|
||||||
|
- path: /etc/systemd/network/50-flannel.link
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
[Match]
|
||||||
|
OriginalName=flannel*
|
||||||
|
[Link]
|
||||||
|
MACAddressPolicy=none
|
||||||
|
- path: /etc/systemd/system.conf.d/accounting.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
[Manager]
|
||||||
|
DefaultCPUAccounting=yes
|
||||||
|
DefaultMemoryAccounting=yes
|
||||||
|
DefaultBlockIOAccounting=yes
|
||||||
|
- path: /etc/etcd/etcd.env
|
||||||
|
mode: 0644
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
# TODO: Use a systemd dropin once podman v1.4.5 is avail.
|
||||||
|
NOTIFY_SOCKET=/run/systemd/notify
|
||||||
|
ETCD_NAME=${etcd_name}
|
||||||
|
ETCD_DATA_DIR=/var/lib/etcd
|
||||||
|
ETCD_ADVERTISE_CLIENT_URLS=https://${etcd_domain}:2379
|
||||||
|
ETCD_INITIAL_ADVERTISE_PEER_URLS=https://${etcd_domain}:2380
|
||||||
|
ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379
|
||||||
|
ETCD_LISTEN_PEER_URLS=https://0.0.0.0:2380
|
||||||
|
ETCD_LISTEN_METRICS_URLS=http://0.0.0.0:2381
|
||||||
|
ETCD_INITIAL_CLUSTER=${etcd_initial_cluster}
|
||||||
|
ETCD_STRICT_RECONFIG_CHECK=true
|
||||||
|
ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/server-ca.crt
|
||||||
|
ETCD_CERT_FILE=/etc/ssl/certs/etcd/server.crt
|
||||||
|
ETCD_KEY_FILE=/etc/ssl/certs/etcd/server.key
|
||||||
|
ETCD_CLIENT_CERT_AUTH=true
|
||||||
|
ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/peer-ca.crt
|
||||||
|
ETCD_PEER_CERT_FILE=/etc/ssl/certs/etcd/peer.crt
|
||||||
|
ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key
|
||||||
|
ETCD_PEER_CLIENT_CERT_AUTH=true
|
||||||
|
passwd:
|
||||||
|
users:
|
||||||
|
- name: core
|
||||||
|
ssh_authorized_keys:
|
||||||
|
- ${ssh_authorized_key}
|
||||||
|
|
161
azure/fedora-coreos/kubernetes/lb.tf
Normal file
161
azure/fedora-coreos/kubernetes/lb.tf
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
# DNS record for the apiserver load balancer
|
||||||
|
resource "azurerm_dns_a_record" "apiserver" {
|
||||||
|
resource_group_name = var.dns_zone_group
|
||||||
|
|
||||||
|
# DNS Zone name where record should be created
|
||||||
|
zone_name = var.dns_zone
|
||||||
|
|
||||||
|
# DNS record
|
||||||
|
name = var.cluster_name
|
||||||
|
ttl = 300
|
||||||
|
|
||||||
|
# IPv4 address of apiserver load balancer
|
||||||
|
records = [azurerm_public_ip.apiserver-ipv4.ip_address]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Static IPv4 address for the apiserver frontend
|
||||||
|
resource "azurerm_public_ip" "apiserver-ipv4" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "${var.cluster_name}-apiserver-ipv4"
|
||||||
|
location = var.region
|
||||||
|
sku = "Standard"
|
||||||
|
allocation_method = "Static"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Static IPv4 address for the ingress frontend
|
||||||
|
resource "azurerm_public_ip" "ingress-ipv4" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "${var.cluster_name}-ingress-ipv4"
|
||||||
|
location = var.region
|
||||||
|
sku = "Standard"
|
||||||
|
allocation_method = "Static"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Network Load Balancer for apiservers and ingress
|
||||||
|
resource "azurerm_lb" "cluster" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = var.cluster_name
|
||||||
|
location = var.region
|
||||||
|
sku = "Standard"
|
||||||
|
|
||||||
|
frontend_ip_configuration {
|
||||||
|
name = "apiserver"
|
||||||
|
public_ip_address_id = azurerm_public_ip.apiserver-ipv4.id
|
||||||
|
}
|
||||||
|
|
||||||
|
frontend_ip_configuration {
|
||||||
|
name = "ingress"
|
||||||
|
public_ip_address_id = azurerm_public_ip.ingress-ipv4.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_lb_rule" "apiserver" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "apiserver"
|
||||||
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
|
frontend_ip_configuration_name = "apiserver"
|
||||||
|
|
||||||
|
protocol = "Tcp"
|
||||||
|
frontend_port = 6443
|
||||||
|
backend_port = 6443
|
||||||
|
backend_address_pool_id = azurerm_lb_backend_address_pool.controller.id
|
||||||
|
probe_id = azurerm_lb_probe.apiserver.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_lb_rule" "ingress-http" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "ingress-http"
|
||||||
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
|
frontend_ip_configuration_name = "ingress"
|
||||||
|
disable_outbound_snat = true
|
||||||
|
|
||||||
|
protocol = "Tcp"
|
||||||
|
frontend_port = 80
|
||||||
|
backend_port = 80
|
||||||
|
backend_address_pool_id = azurerm_lb_backend_address_pool.worker.id
|
||||||
|
probe_id = azurerm_lb_probe.ingress.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_lb_rule" "ingress-https" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "ingress-https"
|
||||||
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
|
frontend_ip_configuration_name = "ingress"
|
||||||
|
disable_outbound_snat = true
|
||||||
|
|
||||||
|
protocol = "Tcp"
|
||||||
|
frontend_port = 443
|
||||||
|
backend_port = 443
|
||||||
|
backend_address_pool_id = azurerm_lb_backend_address_pool.worker.id
|
||||||
|
probe_id = azurerm_lb_probe.ingress.id
|
||||||
|
}
|
||||||
|
|
||||||
|
# Worker outbound TCP/UDP SNAT
|
||||||
|
resource "azurerm_lb_outbound_rule" "worker-outbound" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "worker"
|
||||||
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
|
frontend_ip_configuration {
|
||||||
|
name = "ingress"
|
||||||
|
}
|
||||||
|
|
||||||
|
protocol = "All"
|
||||||
|
backend_address_pool_id = azurerm_lb_backend_address_pool.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
|
# Address pool of controllers
|
||||||
|
resource "azurerm_lb_backend_address_pool" "controller" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "controller"
|
||||||
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
|
}
|
||||||
|
|
||||||
|
# Address pool of workers
|
||||||
|
resource "azurerm_lb_backend_address_pool" "worker" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "worker"
|
||||||
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
|
}
|
||||||
|
|
||||||
|
# Health checks / probes
|
||||||
|
|
||||||
|
# TCP health check for apiserver
|
||||||
|
resource "azurerm_lb_probe" "apiserver" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "apiserver"
|
||||||
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
|
protocol = "Tcp"
|
||||||
|
port = 6443
|
||||||
|
|
||||||
|
# unhealthy threshold
|
||||||
|
number_of_probes = 3
|
||||||
|
|
||||||
|
interval_in_seconds = 5
|
||||||
|
}
|
||||||
|
|
||||||
|
# HTTP health check for ingress
|
||||||
|
resource "azurerm_lb_probe" "ingress" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "ingress"
|
||||||
|
loadbalancer_id = azurerm_lb.cluster.id
|
||||||
|
protocol = "Http"
|
||||||
|
port = 10254
|
||||||
|
request_path = "/healthz"
|
||||||
|
|
||||||
|
# unhealthy threshold
|
||||||
|
number_of_probes = 3
|
||||||
|
|
||||||
|
interval_in_seconds = 5
|
||||||
|
}
|
||||||
|
|
44
azure/fedora-coreos/kubernetes/network.tf
Normal file
44
azure/fedora-coreos/kubernetes/network.tf
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# Organize cluster into a resource group
|
||||||
|
resource "azurerm_resource_group" "cluster" {
|
||||||
|
name = var.cluster_name
|
||||||
|
location = var.region
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_virtual_network" "network" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = var.cluster_name
|
||||||
|
location = azurerm_resource_group.cluster.location
|
||||||
|
address_space = [var.host_cidr]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Subnets - separate subnets for controller and workers because Azure
|
||||||
|
# network security groups are based on IPv4 CIDR rather than instance
|
||||||
|
# tags like GCP or security group membership like AWS
|
||||||
|
|
||||||
|
resource "azurerm_subnet" "controller" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "controller"
|
||||||
|
virtual_network_name = azurerm_virtual_network.network.name
|
||||||
|
address_prefixes = [cidrsubnet(var.host_cidr, 1, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_subnet_network_security_group_association" "controller" {
|
||||||
|
subnet_id = azurerm_subnet.controller.id
|
||||||
|
network_security_group_id = azurerm_network_security_group.controller.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_subnet" "worker" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "worker"
|
||||||
|
virtual_network_name = azurerm_virtual_network.network.name
|
||||||
|
address_prefixes = [cidrsubnet(var.host_cidr, 1, 1)]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_subnet_network_security_group_association" "worker" {
|
||||||
|
subnet_id = azurerm_subnet.worker.id
|
||||||
|
network_security_group_id = azurerm_network_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
59
azure/fedora-coreos/kubernetes/outputs.tf
Normal file
59
azure/fedora-coreos/kubernetes/outputs.tf
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
output "kubeconfig-admin" {
|
||||||
|
value = module.bootstrap.kubeconfig-admin
|
||||||
|
}
|
||||||
|
|
||||||
|
# Outputs for Kubernetes Ingress
|
||||||
|
|
||||||
|
output "ingress_static_ipv4" {
|
||||||
|
value = azurerm_public_ip.ingress-ipv4.ip_address
|
||||||
|
description = "IPv4 address of the load balancer for distributing traffic to Ingress controllers"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Outputs for worker pools
|
||||||
|
|
||||||
|
output "region" {
|
||||||
|
value = azurerm_resource_group.cluster.location
|
||||||
|
}
|
||||||
|
|
||||||
|
output "resource_group_name" {
|
||||||
|
value = azurerm_resource_group.cluster.name
|
||||||
|
}
|
||||||
|
|
||||||
|
output "resource_group_id" {
|
||||||
|
value = azurerm_resource_group.cluster.id
|
||||||
|
}
|
||||||
|
|
||||||
|
output "subnet_id" {
|
||||||
|
value = azurerm_subnet.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
|
output "security_group_id" {
|
||||||
|
value = azurerm_network_security_group.worker.id
|
||||||
|
}
|
||||||
|
|
||||||
|
output "kubeconfig" {
|
||||||
|
value = module.bootstrap.kubeconfig-kubelet
|
||||||
|
}
|
||||||
|
|
||||||
|
# Outputs for custom firewalling
|
||||||
|
|
||||||
|
output "worker_security_group_name" {
|
||||||
|
value = azurerm_network_security_group.worker.name
|
||||||
|
}
|
||||||
|
|
||||||
|
output "worker_address_prefix" {
|
||||||
|
description = "Worker network subnet CIDR address (for source/destination)"
|
||||||
|
value = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Outputs for custom load balancing
|
||||||
|
|
||||||
|
output "loadbalancer_id" {
|
||||||
|
description = "ID of the cluster load balancer"
|
||||||
|
value = azurerm_lb.cluster.id
|
||||||
|
}
|
||||||
|
|
||||||
|
output "backend_address_pool_id" {
|
||||||
|
description = "ID of the worker backend address pool"
|
||||||
|
value = azurerm_lb_backend_address_pool.worker.id
|
||||||
|
}
|
428
azure/fedora-coreos/kubernetes/security.tf
Normal file
428
azure/fedora-coreos/kubernetes/security.tf
Normal file
@ -0,0 +1,428 @@
|
|||||||
|
# Controller security group
|
||||||
|
|
||||||
|
resource "azurerm_network_security_group" "controller" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "${var.cluster_name}-controller"
|
||||||
|
location = azurerm_resource_group.cluster.location
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-icmp" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-icmp"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "1995"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Icmp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "*"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-ssh" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-ssh"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2000"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "22"
|
||||||
|
source_address_prefix = "*"
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-etcd" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-etcd"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2005"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "2379-2380"
|
||||||
|
source_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape etcd metrics
|
||||||
|
resource "azurerm_network_security_rule" "controller-etcd-metrics" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-etcd-metrics"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2010"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "2381"
|
||||||
|
source_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape kube-proxy metrics
|
||||||
|
resource "azurerm_network_security_rule" "controller-kube-proxy" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-kube-proxy-metrics"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2011"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "10249"
|
||||||
|
source_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape kube-scheduler and kube-controller-manager metrics
|
||||||
|
resource "azurerm_network_security_rule" "controller-kube-metrics" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-kube-metrics"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2012"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "10251-10252"
|
||||||
|
source_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-apiserver" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-apiserver"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2015"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "6443"
|
||||||
|
source_address_prefix = "*"
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-cilium-health" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
name = "allow-cilium-health"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2019"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "4240"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-vxlan" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-vxlan"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2020"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Udp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "4789"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-linux-vxlan" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-linux-vxlan"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2021"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Udp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "8472"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape node-exporter daemonset
|
||||||
|
resource "azurerm_network_security_rule" "controller-node-exporter" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-node-exporter"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2025"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "9100"
|
||||||
|
source_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow apiserver to access kubelet's for exec, log, port-forward
|
||||||
|
resource "azurerm_network_security_rule" "controller-kubelet" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-kubelet"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "2030"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "10250"
|
||||||
|
|
||||||
|
# allow Prometheus to scrape kubelet metrics too
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Override Azure AllowVNetInBound and AllowAzureLoadBalancerInBound
|
||||||
|
# https://docs.microsoft.com/en-us/azure/virtual-network/security-overview#default-security-rules
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-allow-loadblancer" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-loadbalancer"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "3000"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "*"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "*"
|
||||||
|
source_address_prefix = "AzureLoadBalancer"
|
||||||
|
destination_address_prefix = "*"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "controller-deny-all" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "deny-all"
|
||||||
|
network_security_group_name = azurerm_network_security_group.controller.name
|
||||||
|
priority = "3005"
|
||||||
|
access = "Deny"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "*"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "*"
|
||||||
|
source_address_prefix = "*"
|
||||||
|
destination_address_prefix = "*"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Worker security group
|
||||||
|
|
||||||
|
resource "azurerm_network_security_group" "worker" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "${var.cluster_name}-worker"
|
||||||
|
location = azurerm_resource_group.cluster.location
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-icmp" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-icmp"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "1995"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Icmp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "*"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-ssh" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-ssh"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2000"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "22"
|
||||||
|
source_address_prefix = azurerm_subnet.controller.address_prefix
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-http" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-http"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2005"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "80"
|
||||||
|
source_address_prefix = "*"
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-https" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-https"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2010"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "443"
|
||||||
|
source_address_prefix = "*"
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-cilium-health" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
count = var.networking == "cilium" ? 1 : 0
|
||||||
|
|
||||||
|
name = "allow-cilium-health"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2014"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "4240"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-vxlan" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-vxlan"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2015"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Udp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "4789"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-linux-vxlan" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-linux-vxlan"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2016"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Udp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "8472"
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape node-exporter daemonset
|
||||||
|
resource "azurerm_network_security_rule" "worker-node-exporter" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-node-exporter"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2020"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "9100"
|
||||||
|
source_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow Prometheus to scrape kube-proxy
|
||||||
|
resource "azurerm_network_security_rule" "worker-kube-proxy" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-kube-proxy"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2024"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "10249"
|
||||||
|
source_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow apiserver to access kubelet's for exec, log, port-forward
|
||||||
|
resource "azurerm_network_security_rule" "worker-kubelet" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-kubelet"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "2025"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "Tcp"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "10250"
|
||||||
|
|
||||||
|
# allow Prometheus to scrape kubelet metrics too
|
||||||
|
source_address_prefixes = [azurerm_subnet.controller.address_prefix, azurerm_subnet.worker.address_prefix]
|
||||||
|
destination_address_prefix = azurerm_subnet.worker.address_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
# Override Azure AllowVNetInBound and AllowAzureLoadBalancerInBound
|
||||||
|
# https://docs.microsoft.com/en-us/azure/virtual-network/security-overview#default-security-rules
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-allow-loadblancer" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "allow-loadbalancer"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "3000"
|
||||||
|
access = "Allow"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "*"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "*"
|
||||||
|
source_address_prefix = "AzureLoadBalancer"
|
||||||
|
destination_address_prefix = "*"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_network_security_rule" "worker-deny-all" {
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
|
||||||
|
name = "deny-all"
|
||||||
|
network_security_group_name = azurerm_network_security_group.worker.name
|
||||||
|
priority = "3005"
|
||||||
|
access = "Deny"
|
||||||
|
direction = "Inbound"
|
||||||
|
protocol = "*"
|
||||||
|
source_port_range = "*"
|
||||||
|
destination_port_range = "*"
|
||||||
|
source_address_prefix = "*"
|
||||||
|
destination_address_prefix = "*"
|
||||||
|
}
|
||||||
|
|
59
azure/fedora-coreos/kubernetes/ssh.tf
Normal file
59
azure/fedora-coreos/kubernetes/ssh.tf
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
locals {
|
||||||
|
# format assets for distribution
|
||||||
|
assets_bundle = [
|
||||||
|
# header with the unpack location
|
||||||
|
for key, value in module.bootstrap.assets_dist :
|
||||||
|
format("##### %s\n%s", key, value)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Secure copy assets to controllers.
|
||||||
|
resource "null_resource" "copy-controller-secrets" {
|
||||||
|
count = var.controller_count
|
||||||
|
|
||||||
|
depends_on = [
|
||||||
|
module.bootstrap,
|
||||||
|
azurerm_linux_virtual_machine.controllers
|
||||||
|
]
|
||||||
|
|
||||||
|
connection {
|
||||||
|
type = "ssh"
|
||||||
|
host = azurerm_public_ip.controllers.*.ip_address[count.index]
|
||||||
|
user = "core"
|
||||||
|
timeout = "15m"
|
||||||
|
}
|
||||||
|
|
||||||
|
provisioner "file" {
|
||||||
|
content = join("\n", local.assets_bundle)
|
||||||
|
destination = "$HOME/assets"
|
||||||
|
}
|
||||||
|
|
||||||
|
provisioner "remote-exec" {
|
||||||
|
inline = [
|
||||||
|
"sudo /opt/bootstrap/layout",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Connect to a controller to perform one-time cluster bootstrap.
|
||||||
|
resource "null_resource" "bootstrap" {
|
||||||
|
depends_on = [
|
||||||
|
null_resource.copy-controller-secrets,
|
||||||
|
module.workers,
|
||||||
|
azurerm_dns_a_record.apiserver,
|
||||||
|
]
|
||||||
|
|
||||||
|
connection {
|
||||||
|
type = "ssh"
|
||||||
|
host = azurerm_public_ip.controllers.*.ip_address[0]
|
||||||
|
user = "core"
|
||||||
|
timeout = "15m"
|
||||||
|
}
|
||||||
|
|
||||||
|
provisioner "remote-exec" {
|
||||||
|
inline = [
|
||||||
|
"sudo systemctl start bootstrap",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
143
azure/fedora-coreos/kubernetes/variables.tf
Normal file
143
azure/fedora-coreos/kubernetes/variables.tf
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
variable "cluster_name" {
|
||||||
|
type = string
|
||||||
|
description = "Unique cluster name (prepended to dns_zone)"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Azure
|
||||||
|
|
||||||
|
variable "region" {
|
||||||
|
type = string
|
||||||
|
description = "Azure Region (e.g. centralus , see `az account list-locations --output table`)"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "dns_zone" {
|
||||||
|
type = string
|
||||||
|
description = "Azure DNS Zone (e.g. azure.example.com)"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "dns_zone_group" {
|
||||||
|
type = string
|
||||||
|
description = "Resource group where the Azure DNS Zone resides (e.g. global)"
|
||||||
|
}
|
||||||
|
|
||||||
|
# instances
|
||||||
|
|
||||||
|
variable "controller_count" {
|
||||||
|
type = number
|
||||||
|
description = "Number of controllers (i.e. masters)"
|
||||||
|
default = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "worker_count" {
|
||||||
|
type = number
|
||||||
|
description = "Number of workers"
|
||||||
|
default = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "controller_type" {
|
||||||
|
type = string
|
||||||
|
description = "Machine type for controllers (see `az vm list-skus --location centralus`)"
|
||||||
|
default = "Standard_B2s"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "worker_type" {
|
||||||
|
type = string
|
||||||
|
description = "Machine type for workers (see `az vm list-skus --location centralus`)"
|
||||||
|
default = "Standard_DS1_v2"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "os_image" {
|
||||||
|
type = string
|
||||||
|
description = "Fedora CoreOS image for instances"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "disk_size" {
|
||||||
|
type = number
|
||||||
|
description = "Size of the disk in GB"
|
||||||
|
default = 40
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "worker_priority" {
|
||||||
|
type = string
|
||||||
|
description = "Set worker priority to Spot to use reduced cost surplus capacity, with the tradeoff that instances can be deallocated at any time."
|
||||||
|
default = "Regular"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "controller_snippets" {
|
||||||
|
type = list(string)
|
||||||
|
description = "Controller Fedora CoreOS Config snippets"
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "worker_snippets" {
|
||||||
|
type = list(string)
|
||||||
|
description = "Worker Fedora CoreOS Config snippets"
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
|
# configuration
|
||||||
|
|
||||||
|
variable "ssh_authorized_key" {
|
||||||
|
type = string
|
||||||
|
description = "SSH public key for user 'core'"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "networking" {
|
||||||
|
type = string
|
||||||
|
description = "Choice of networking provider (flannel or calico)"
|
||||||
|
default = "calico"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "host_cidr" {
|
||||||
|
type = string
|
||||||
|
description = "CIDR IPv4 range to assign to instances"
|
||||||
|
default = "10.0.0.0/16"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "pod_cidr" {
|
||||||
|
type = string
|
||||||
|
description = "CIDR IPv4 range to assign Kubernetes pods"
|
||||||
|
default = "10.2.0.0/16"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "service_cidr" {
|
||||||
|
type = string
|
||||||
|
description = <<EOD
|
||||||
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
|
EOD
|
||||||
|
default = "10.3.0.0/16"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "enable_reporting" {
|
||||||
|
type = bool
|
||||||
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
||||||
|
default = false
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "enable_aggregation" {
|
||||||
|
type = bool
|
||||||
|
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
||||||
|
default = false
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "worker_node_labels" {
|
||||||
|
type = list(string)
|
||||||
|
description = "List of initial worker node labels"
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
|
variable "asset_dir" {
|
||||||
|
type = string
|
||||||
|
description = "Absolute path to a directory where generated assets should be placed (contains secrets)"
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "cluster_domain_suffix" {
|
||||||
|
type = string
|
||||||
|
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
|
||||||
|
default = "cluster.local"
|
||||||
|
}
|
||||||
|
|
16
azure/fedora-coreos/kubernetes/versions.tf
Normal file
16
azure/fedora-coreos/kubernetes/versions.tf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Terraform version and plugin versions
|
||||||
|
|
||||||
|
terraform {
|
||||||
|
required_version = ">= 0.12.26, < 0.14.0"
|
||||||
|
required_providers {
|
||||||
|
azurerm = "~> 2.8"
|
||||||
|
template = "~> 2.1"
|
||||||
|
null = "~> 2.1"
|
||||||
|
|
||||||
|
ct = {
|
||||||
|
source = "poseidon/ct"
|
||||||
|
version = "~> 0.6.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
24
azure/fedora-coreos/kubernetes/workers.tf
Normal file
24
azure/fedora-coreos/kubernetes/workers.tf
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
module "workers" {
|
||||||
|
source = "./workers"
|
||||||
|
name = var.cluster_name
|
||||||
|
|
||||||
|
# Azure
|
||||||
|
resource_group_name = azurerm_resource_group.cluster.name
|
||||||
|
region = azurerm_resource_group.cluster.location
|
||||||
|
subnet_id = azurerm_subnet.worker.id
|
||||||
|
security_group_id = azurerm_network_security_group.worker.id
|
||||||
|
backend_address_pool_id = azurerm_lb_backend_address_pool.worker.id
|
||||||
|
|
||||||
|
worker_count = var.worker_count
|
||||||
|
vm_type = var.worker_type
|
||||||
|
os_image = var.os_image
|
||||||
|
priority = var.worker_priority
|
||||||
|
|
||||||
|
# configuration
|
||||||
|
kubeconfig = module.bootstrap.kubeconfig-kubelet
|
||||||
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
|
service_cidr = var.service_cidr
|
||||||
|
cluster_domain_suffix = var.cluster_domain_suffix
|
||||||
|
snippets = var.worker_snippets
|
||||||
|
node_labels = var.worker_node_labels
|
||||||
|
}
|
132
azure/fedora-coreos/kubernetes/workers/fcc/worker.yaml
Normal file
132
azure/fedora-coreos/kubernetes/workers/fcc/worker.yaml
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
---
|
||||||
|
variant: fcos
|
||||||
|
version: 1.0.0
|
||||||
|
systemd:
|
||||||
|
units:
|
||||||
|
- name: docker.service
|
||||||
|
enabled: true
|
||||||
|
- name: wait-for-dns.service
|
||||||
|
enabled: true
|
||||||
|
contents: |
|
||||||
|
[Unit]
|
||||||
|
Description=Wait for DNS entries
|
||||||
|
Before=kubelet.service
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=true
|
||||||
|
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
|
||||||
|
[Install]
|
||||||
|
RequiredBy=kubelet.service
|
||||||
|
- name: kubelet.service
|
||||||
|
enabled: true
|
||||||
|
contents: |
|
||||||
|
[Unit]
|
||||||
|
Description=Kubelet (System Container)
|
||||||
|
Wants=rpc-statd.service
|
||||||
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=quay.io/poseidon/kubelet:v1.19.0
|
||||||
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
||||||
|
ExecStartPre=/bin/mkdir -p /var/lib/calico
|
||||||
|
ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins
|
||||||
|
ExecStartPre=/usr/bin/bash -c "grep 'certificate-authority-data' /etc/kubernetes/kubeconfig | awk '{print $2}' | base64 -d > /etc/kubernetes/ca.crt"
|
||||||
|
ExecStartPre=-/usr/bin/podman rm kubelet
|
||||||
|
ExecStart=/usr/bin/podman run --name kubelet \
|
||||||
|
--privileged \
|
||||||
|
--pid host \
|
||||||
|
--network host \
|
||||||
|
--volume /etc/kubernetes:/etc/kubernetes:ro,z \
|
||||||
|
--volume /usr/lib/os-release:/etc/os-release:ro \
|
||||||
|
--volume /etc/ssl/certs:/etc/ssl/certs:ro \
|
||||||
|
--volume /lib/modules:/lib/modules:ro \
|
||||||
|
--volume /run:/run \
|
||||||
|
--volume /sys/fs/cgroup:/sys/fs/cgroup:ro \
|
||||||
|
--volume /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd \
|
||||||
|
--volume /etc/pki/tls/certs:/usr/share/ca-certificates:ro \
|
||||||
|
--volume /var/lib/calico:/var/lib/calico:ro \
|
||||||
|
--volume /var/lib/docker:/var/lib/docker \
|
||||||
|
--volume /var/lib/kubelet:/var/lib/kubelet:rshared,z \
|
||||||
|
--volume /var/log:/var/log \
|
||||||
|
--volume /var/run/lock:/var/run/lock:z \
|
||||||
|
--volume /opt/cni/bin:/opt/cni/bin:z \
|
||||||
|
$${KUBELET_IMAGE} \
|
||||||
|
--anonymous-auth=false \
|
||||||
|
--authentication-token-webhook \
|
||||||
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
|
--cgroup-driver=systemd \
|
||||||
|
--cgroups-per-qos=true \
|
||||||
|
--enforce-node-allocatable=pods \
|
||||||
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
||||||
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
|
--healthz-port=0 \
|
||||||
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
|
--network-plugin=cni \
|
||||||
|
--node-labels=node.kubernetes.io/node \
|
||||||
|
%{~ for label in split(",", node_labels) ~}
|
||||||
|
--node-labels=${label} \
|
||||||
|
%{~ endfor ~}
|
||||||
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
|
--read-only-port=0 \
|
||||||
|
--rotate-certificates \
|
||||||
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
|
ExecStop=-/usr/bin/podman stop kubelet
|
||||||
|
Delegate=yes
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
- name: delete-node.service
|
||||||
|
enabled: true
|
||||||
|
contents: |
|
||||||
|
[Unit]
|
||||||
|
Description=Delete Kubernetes node on shutdown
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=true
|
||||||
|
ExecStart=/bin/true
|
||||||
|
ExecStop=/bin/bash -c '/usr/bin/podman run --volume /etc/kubernetes:/etc/kubernetes:ro,z --entrypoint /usr/local/bin/kubectl quay.io/poseidon/kubelet:v1.19.0 --kubeconfig=/etc/kubernetes/kubeconfig delete node $HOSTNAME'
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
storage:
|
||||||
|
directories:
|
||||||
|
- path: /etc/kubernetes
|
||||||
|
files:
|
||||||
|
- path: /etc/kubernetes/kubeconfig
|
||||||
|
mode: 0644
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
${kubeconfig}
|
||||||
|
- path: /etc/sysctl.d/max-user-watches.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
fs.inotify.max_user_watches=16184
|
||||||
|
- path: /etc/sysctl.d/reverse-path-filter.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
net.ipv4.conf.default.rp_filter=0
|
||||||
|
net.ipv4.conf.*.rp_filter=0
|
||||||
|
- path: /etc/systemd/network/50-flannel.link
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
[Match]
|
||||||
|
OriginalName=flannel*
|
||||||
|
[Link]
|
||||||
|
MACAddressPolicy=none
|
||||||
|
- path: /etc/systemd/system.conf.d/accounting.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
[Manager]
|
||||||
|
DefaultCPUAccounting=yes
|
||||||
|
DefaultMemoryAccounting=yes
|
||||||
|
DefaultBlockIOAccounting=yes
|
||||||
|
passwd:
|
||||||
|
users:
|
||||||
|
- name: core
|
||||||
|
ssh_authorized_keys:
|
||||||
|
- ${ssh_authorized_key}
|
||||||
|
|
||||||
|
|
98
azure/fedora-coreos/kubernetes/workers/variables.tf
Normal file
98
azure/fedora-coreos/kubernetes/workers/variables.tf
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
variable "name" {
|
||||||
|
type = string
|
||||||
|
description = "Unique name for the worker pool"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Azure
|
||||||
|
|
||||||
|
variable "region" {
|
||||||
|
type = string
|
||||||
|
description = "Must be set to the Azure Region of cluster"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "resource_group_name" {
|
||||||
|
type = string
|
||||||
|
description = "Must be set to the resource group name of cluster"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "subnet_id" {
|
||||||
|
type = string
|
||||||
|
description = "Must be set to the `worker_subnet_id` output by cluster"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "security_group_id" {
|
||||||
|
type = string
|
||||||
|
description = "Must be set to the `worker_security_group_id` output by cluster"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "backend_address_pool_id" {
|
||||||
|
type = string
|
||||||
|
description = "Must be set to the `worker_backend_address_pool_id` output by cluster"
|
||||||
|
}
|
||||||
|
|
||||||
|
# instances
|
||||||
|
|
||||||
|
variable "worker_count" {
|
||||||
|
type = number
|
||||||
|
description = "Number of instances"
|
||||||
|
default = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "vm_type" {
|
||||||
|
type = string
|
||||||
|
description = "Machine type for instances (see `az vm list-skus --location centralus`)"
|
||||||
|
default = "Standard_DS1_v2"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "os_image" {
|
||||||
|
type = string
|
||||||
|
description = "Fedora CoreOS image for instances"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "priority" {
|
||||||
|
type = string
|
||||||
|
description = "Set priority to Spot to use reduced cost surplus capacity, with the tradeoff that instances can be evicted at any time."
|
||||||
|
default = "Regular"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "snippets" {
|
||||||
|
type = list(string)
|
||||||
|
description = "Fedora CoreOS Config snippets"
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
|
# configuration
|
||||||
|
|
||||||
|
variable "kubeconfig" {
|
||||||
|
type = string
|
||||||
|
description = "Must be set to `kubeconfig` output by cluster"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "ssh_authorized_key" {
|
||||||
|
type = string
|
||||||
|
description = "SSH public key for user 'core'"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "service_cidr" {
|
||||||
|
type = string
|
||||||
|
description = <<EOD
|
||||||
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
|
EOD
|
||||||
|
default = "10.3.0.0/16"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "node_labels" {
|
||||||
|
type = list(string)
|
||||||
|
description = "List of initial node labels"
|
||||||
|
default = []
|
||||||
|
}
|
||||||
|
|
||||||
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
|
variable "cluster_domain_suffix" {
|
||||||
|
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
|
||||||
|
type = string
|
||||||
|
default = "cluster.local"
|
||||||
|
}
|
||||||
|
|
14
azure/fedora-coreos/kubernetes/workers/versions.tf
Normal file
14
azure/fedora-coreos/kubernetes/workers/versions.tf
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Terraform version and plugin versions
|
||||||
|
|
||||||
|
terraform {
|
||||||
|
required_version = ">= 0.12.26, < 0.14.0"
|
||||||
|
required_providers {
|
||||||
|
azurerm = "~> 2.8"
|
||||||
|
template = "~> 2.1"
|
||||||
|
|
||||||
|
ct = {
|
||||||
|
source = "poseidon/ct"
|
||||||
|
version = "~> 0.6.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
92
azure/fedora-coreos/kubernetes/workers/workers.tf
Normal file
92
azure/fedora-coreos/kubernetes/workers/workers.tf
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
# Workers scale set
|
||||||
|
resource "azurerm_linux_virtual_machine_scale_set" "workers" {
|
||||||
|
resource_group_name = var.resource_group_name
|
||||||
|
|
||||||
|
name = "${var.name}-worker"
|
||||||
|
location = var.region
|
||||||
|
sku = var.vm_type
|
||||||
|
instances = var.worker_count
|
||||||
|
# instance name prefix for instances in the set
|
||||||
|
computer_name_prefix = "${var.name}-worker"
|
||||||
|
single_placement_group = false
|
||||||
|
custom_data = base64encode(data.ct_config.worker-ignition.rendered)
|
||||||
|
|
||||||
|
# storage
|
||||||
|
source_image_id = var.os_image
|
||||||
|
os_disk {
|
||||||
|
storage_account_type = "Standard_LRS"
|
||||||
|
caching = "ReadWrite"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Azure requires setting admin_ssh_key, though Ignition custom_data handles it too
|
||||||
|
admin_username = "core"
|
||||||
|
admin_ssh_key {
|
||||||
|
username = "core"
|
||||||
|
public_key = var.ssh_authorized_key
|
||||||
|
}
|
||||||
|
|
||||||
|
# network
|
||||||
|
network_interface {
|
||||||
|
name = "nic0"
|
||||||
|
primary = true
|
||||||
|
network_security_group_id = var.security_group_id
|
||||||
|
|
||||||
|
ip_configuration {
|
||||||
|
name = "ip0"
|
||||||
|
primary = true
|
||||||
|
subnet_id = var.subnet_id
|
||||||
|
|
||||||
|
# backend address pool to which the NIC should be added
|
||||||
|
load_balancer_backend_address_pool_ids = [var.backend_address_pool_id]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# lifecycle
|
||||||
|
upgrade_mode = "Manual"
|
||||||
|
# eviction policy may only be set when priority is Spot
|
||||||
|
priority = var.priority
|
||||||
|
eviction_policy = var.priority == "Spot" ? "Delete" : null
|
||||||
|
}
|
||||||
|
|
||||||
|
# Scale up or down to maintain desired number, tolerating deallocations.
|
||||||
|
resource "azurerm_monitor_autoscale_setting" "workers" {
|
||||||
|
resource_group_name = var.resource_group_name
|
||||||
|
|
||||||
|
name = "${var.name}-maintain-desired"
|
||||||
|
location = var.region
|
||||||
|
|
||||||
|
# autoscale
|
||||||
|
enabled = true
|
||||||
|
target_resource_id = azurerm_linux_virtual_machine_scale_set.workers.id
|
||||||
|
|
||||||
|
profile {
|
||||||
|
name = "default"
|
||||||
|
|
||||||
|
capacity {
|
||||||
|
minimum = var.worker_count
|
||||||
|
default = var.worker_count
|
||||||
|
maximum = var.worker_count
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Worker Ignition configs
|
||||||
|
data "ct_config" "worker-ignition" {
|
||||||
|
content = data.template_file.worker-config.rendered
|
||||||
|
strict = true
|
||||||
|
snippets = var.snippets
|
||||||
|
}
|
||||||
|
|
||||||
|
# Worker Fedora CoreOS configs
|
||||||
|
data "template_file" "worker-config" {
|
||||||
|
template = file("${path.module}/fcc/worker.yaml")
|
||||||
|
|
||||||
|
vars = {
|
||||||
|
kubeconfig = indent(10, var.kubeconfig)
|
||||||
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
|
cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
|
||||||
|
cluster_domain_suffix = var.cluster_domain_suffix
|
||||||
|
node_labels = join(",", var.node_labels)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -11,8 +11,8 @@ Typhoon distributes upstream Kubernetes, architectural conventions, and cluster
|
|||||||
|
|
||||||
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
||||||
|
|
||||||
* Kubernetes v1.17.4 (upstream)
|
* Kubernetes v1.19.0 (upstream)
|
||||||
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [flannel](https://github.com/coreos/flannel) networking
|
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [Cilium](https://github.com/cilium/cilium) or [flannel](https://github.com/coreos/flannel) networking
|
||||||
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
||||||
* Advanced features like [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
* Advanced features like [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
||||||
* Ready for Ingress, Prometheus, Grafana, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
* Ready for Ingress, Prometheus, Grafana, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Kubernetes assets (kubeconfig, manifests)
|
# Kubernetes assets (kubeconfig, manifests)
|
||||||
module "bootstrap" {
|
module "bootstrap" {
|
||||||
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=73784c1b2c791d9ba586a1478979ac34dd324dad"
|
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=79343f02aea7c69bb03dab2051aa95248c0471d7"
|
||||||
|
|
||||||
cluster_name = var.cluster_name
|
cluster_name = var.cluster_name
|
||||||
api_servers = [var.k8s_domain_name]
|
api_servers = [var.k8s_domain_name]
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
systemd:
|
systemd:
|
||||||
units:
|
units:
|
||||||
- name: etcd-member.service
|
- name: etcd-member.service
|
||||||
enable: true
|
enabled: true
|
||||||
dropins:
|
dropins:
|
||||||
- name: 40-etcd-cluster.conf
|
- name: 40-etcd-cluster.conf
|
||||||
contents: |
|
contents: |
|
||||||
[Service]
|
[Service]
|
||||||
Environment="ETCD_IMAGE_TAG=v3.4.4"
|
Environment="ETCD_IMAGE_TAG=v3.4.12"
|
||||||
Environment="ETCD_IMAGE_URL=docker://quay.io/coreos/etcd"
|
Environment="ETCD_IMAGE_URL=docker://quay.io/coreos/etcd"
|
||||||
Environment="RKT_RUN_ARGS=--insecure-options=image"
|
Environment="RKT_RUN_ARGS=--insecure-options=image"
|
||||||
Environment="ETCD_NAME=${etcd_name}"
|
Environment="ETCD_NAME=${etcd_name}"
|
||||||
@ -28,11 +28,11 @@ systemd:
|
|||||||
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key"
|
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key"
|
||||||
Environment="ETCD_PEER_CLIENT_CERT_AUTH=true"
|
Environment="ETCD_PEER_CLIENT_CERT_AUTH=true"
|
||||||
- name: docker.service
|
- name: docker.service
|
||||||
enable: true
|
enabled: true
|
||||||
- name: locksmithd.service
|
- name: locksmithd.service
|
||||||
mask: true
|
mask: true
|
||||||
- name: kubelet.path
|
- name: kubelet.path
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Watch for kubeconfig
|
Description=Watch for kubeconfig
|
||||||
@ -41,7 +41,7 @@ systemd:
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
- name: wait-for-dns.service
|
- name: wait-for-dns.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Wait for DNS entries
|
Description=Wait for DNS entries
|
||||||
@ -57,9 +57,10 @@ systemd:
|
|||||||
- name: kubelet.service
|
- name: kubelet.service
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube
|
Description=Kubelet
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=docker://quay.io/poseidon/kubelet:v1.19.0
|
||||||
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
@ -103,27 +104,25 @@ systemd:
|
|||||||
--mount volume=etc-iscsi,target=/etc/iscsi \
|
--mount volume=etc-iscsi,target=/etc/iscsi \
|
||||||
--volume usr-sbin-iscsiadm,kind=host,source=/usr/sbin/iscsiadm \
|
--volume usr-sbin-iscsiadm,kind=host,source=/usr/sbin/iscsiadm \
|
||||||
--mount volume=usr-sbin-iscsiadm,target=/sbin/iscsiadm \
|
--mount volume=usr-sbin-iscsiadm,target=/sbin/iscsiadm \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
$${KUBELET_IMAGE} -- \
|
||||||
--exec=/usr/local/bin/kubelet -- \
|
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
||||||
--client-ca-file=/etc/kubernetes/ca.crt \
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--hostname-override=${domain_name} \
|
--hostname-override=${domain_name} \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/master \
|
|
||||||
--node-labels=node.kubernetes.io/controller="true" \
|
--node-labels=node.kubernetes.io/controller="true" \
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
|
--register-with-taints=node-role.kubernetes.io/controller=:NoSchedule \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
||||||
Restart=always
|
Restart=always
|
||||||
@ -139,7 +138,6 @@ systemd:
|
|||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
WorkingDirectory=/opt/bootstrap
|
WorkingDirectory=/opt/bootstrap
|
||||||
ExecStartPre=-/usr/bin/bash -c 'set -x && [ -n "$(ls /opt/bootstrap/assets/manifests-*/* 2>/dev/null)" ] && mv /opt/bootstrap/assets/manifests-*/* /opt/bootstrap/assets/manifests && rm -rf /opt/bootstrap/assets/manifests-*'
|
|
||||||
ExecStart=/usr/bin/rkt run \
|
ExecStart=/usr/bin/rkt run \
|
||||||
--trust-keys-from-https \
|
--trust-keys-from-https \
|
||||||
--volume config,kind=host,source=/etc/kubernetes/bootstrap-secrets \
|
--volume config,kind=host,source=/etc/kubernetes/bootstrap-secrets \
|
||||||
@ -149,7 +147,7 @@ systemd:
|
|||||||
--volume script,kind=host,source=/opt/bootstrap/apply \
|
--volume script,kind=host,source=/opt/bootstrap/apply \
|
||||||
--mount volume=script,target=/apply \
|
--mount volume=script,target=/apply \
|
||||||
--insecure-options=image \
|
--insecure-options=image \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
docker://quay.io/poseidon/kubelet:v1.19.0 \
|
||||||
--net=host \
|
--net=host \
|
||||||
--dns=host \
|
--dns=host \
|
||||||
--exec=/apply
|
--exec=/apply
|
||||||
@ -158,8 +156,13 @@ systemd:
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
storage:
|
storage:
|
||||||
directories:
|
directories:
|
||||||
|
- path: /var/lib/etcd
|
||||||
|
filesystem: root
|
||||||
|
mode: 0700
|
||||||
|
overwrite: true
|
||||||
- path: /etc/kubernetes
|
- path: /etc/kubernetes
|
||||||
filesystem: root
|
filesystem: root
|
||||||
|
mode: 0755
|
||||||
files:
|
files:
|
||||||
- path: /etc/hostname
|
- path: /etc/hostname
|
||||||
filesystem: root
|
filesystem: root
|
||||||
@ -181,14 +184,15 @@ storage:
|
|||||||
mv tls/etcd/etcd-client* /etc/kubernetes/bootstrap-secrets/
|
mv tls/etcd/etcd-client* /etc/kubernetes/bootstrap-secrets/
|
||||||
chown -R etcd:etcd /etc/ssl/etcd
|
chown -R etcd:etcd /etc/ssl/etcd
|
||||||
chmod -R 500 /etc/ssl/etcd
|
chmod -R 500 /etc/ssl/etcd
|
||||||
|
chmod -R 700 /var/lib/etcd
|
||||||
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
||||||
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
||||||
sudo mkdir -p /etc/kubernetes/manifests
|
mkdir -p /etc/kubernetes/manifests
|
||||||
sudo mv static-manifests/* /etc/kubernetes/manifests/
|
mv static-manifests/* /etc/kubernetes/manifests/
|
||||||
sudo mkdir -p /opt/bootstrap/assets
|
mkdir -p /opt/bootstrap/assets
|
||||||
sudo mv manifests /opt/bootstrap/assets/manifests
|
mv manifests /opt/bootstrap/assets/manifests
|
||||||
sudo mv manifests-networking /opt/bootstrap/assets/manifests-networking
|
mv manifests-networking/* /opt/bootstrap/assets/manifests/
|
||||||
rm -rf assets auth static-manifests tls
|
rm -rf assets auth static-manifests tls manifests-networking
|
||||||
- path: /opt/bootstrap/apply
|
- path: /opt/bootstrap/apply
|
||||||
filesystem: root
|
filesystem: root
|
||||||
mode: 0544
|
mode: 0544
|
||||||
@ -206,6 +210,7 @@ storage:
|
|||||||
done
|
done
|
||||||
- path: /etc/sysctl.d/max-user-watches.conf
|
- path: /etc/sysctl.d/max-user-watches.conf
|
||||||
filesystem: root
|
filesystem: root
|
||||||
|
mode: 0644
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
systemd:
|
systemd:
|
||||||
units:
|
units:
|
||||||
- name: installer.service
|
- name: installer.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Requires=network-online.target
|
Requires=network-online.target
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
systemd:
|
systemd:
|
||||||
units:
|
units:
|
||||||
- name: docker.service
|
- name: docker.service
|
||||||
enable: true
|
enabled: true
|
||||||
- name: locksmithd.service
|
- name: locksmithd.service
|
||||||
mask: true
|
mask: true
|
||||||
- name: kubelet.path
|
- name: kubelet.path
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Watch for kubeconfig
|
Description=Watch for kubeconfig
|
||||||
@ -15,7 +15,7 @@ systemd:
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
- name: wait-for-dns.service
|
- name: wait-for-dns.service
|
||||||
enable: true
|
enabled: true
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Wait for DNS entries
|
Description=Wait for DNS entries
|
||||||
@ -30,9 +30,10 @@ systemd:
|
|||||||
- name: kubelet.service
|
- name: kubelet.service
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube
|
Description=Kubelet
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=docker://quay.io/poseidon/kubelet:v1.19.0
|
||||||
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
Environment=KUBELET_CGROUP_DRIVER=${cgroup_driver}
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
@ -76,21 +77,19 @@ systemd:
|
|||||||
--mount volume=etc-iscsi,target=/etc/iscsi \
|
--mount volume=etc-iscsi,target=/etc/iscsi \
|
||||||
--volume usr-sbin-iscsiadm,kind=host,source=/usr/sbin/iscsiadm \
|
--volume usr-sbin-iscsiadm,kind=host,source=/usr/sbin/iscsiadm \
|
||||||
--mount volume=usr-sbin-iscsiadm,target=/sbin/iscsiadm \
|
--mount volume=usr-sbin-iscsiadm,target=/sbin/iscsiadm \
|
||||||
docker://k8s.gcr.io/hyperkube:v1.17.4 \
|
$${KUBELET_IMAGE} -- \
|
||||||
--exec=/usr/local/bin/kubelet -- \
|
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
--cgroup-driver=$${KUBELET_CGROUP_DRIVER} \
|
||||||
--client-ca-file=/etc/kubernetes/ca.crt \
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--hostname-override=${domain_name} \
|
--hostname-override=${domain_name} \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/node \
|
--node-labels=node.kubernetes.io/node \
|
||||||
%{~ for label in compact(split(",", node_labels)) ~}
|
%{~ for label in compact(split(",", node_labels)) ~}
|
||||||
@ -101,6 +100,7 @@ systemd:
|
|||||||
%{~ endfor ~}
|
%{~ endfor ~}
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
||||||
Restart=always
|
Restart=always
|
||||||
@ -112,6 +112,7 @@ storage:
|
|||||||
directories:
|
directories:
|
||||||
- path: /etc/kubernetes
|
- path: /etc/kubernetes
|
||||||
filesystem: root
|
filesystem: root
|
||||||
|
mode: 0755
|
||||||
files:
|
files:
|
||||||
- path: /etc/hostname
|
- path: /etc/hostname
|
||||||
filesystem: root
|
filesystem: root
|
||||||
@ -121,6 +122,7 @@ storage:
|
|||||||
${domain_name}
|
${domain_name}
|
||||||
- path: /etc/sysctl.d/max-user-watches.conf
|
- path: /etc/sysctl.d/max-user-watches.conf
|
||||||
filesystem: root
|
filesystem: root
|
||||||
|
mode: 0644
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
|
@ -141,10 +141,10 @@ resource "matchbox_profile" "controllers" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data "ct_config" "controller-ignitions" {
|
data "ct_config" "controller-ignitions" {
|
||||||
count = length(var.controllers)
|
count = length(var.controllers)
|
||||||
content = data.template_file.controller-configs.*.rendered[count.index]
|
content = data.template_file.controller-configs.*.rendered[count.index]
|
||||||
pretty_print = false
|
strict = true
|
||||||
snippets = local.clc_map[var.controllers.*.name[count.index]]
|
snippets = lookup(var.snippets, var.controllers.*.name[count.index], [])
|
||||||
}
|
}
|
||||||
|
|
||||||
data "template_file" "controller-configs" {
|
data "template_file" "controller-configs" {
|
||||||
@ -171,10 +171,10 @@ resource "matchbox_profile" "workers" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data "ct_config" "worker-ignitions" {
|
data "ct_config" "worker-ignitions" {
|
||||||
count = length(var.workers)
|
count = length(var.workers)
|
||||||
content = data.template_file.worker-configs.*.rendered[count.index]
|
content = data.template_file.worker-configs.*.rendered[count.index]
|
||||||
pretty_print = false
|
strict = true
|
||||||
snippets = local.clc_map[var.workers.*.name[count.index]]
|
snippets = lookup(var.snippets, var.workers.*.name[count.index], [])
|
||||||
}
|
}
|
||||||
|
|
||||||
data "template_file" "worker-configs" {
|
data "template_file" "worker-configs" {
|
||||||
@ -192,24 +192,3 @@ data "template_file" "worker-configs" {
|
|||||||
node_taints = join(",", lookup(var.worker_node_taints, var.workers.*.name[count.index], []))
|
node_taints = join(",", lookup(var.worker_node_taints, var.workers.*.name[count.index], []))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
locals {
|
|
||||||
# Hack to workaround https://github.com/hashicorp/terraform/issues/17251
|
|
||||||
# Still an issue in Terraform v0.12 https://github.com/hashicorp/terraform/issues/20572
|
|
||||||
# Default Container Linux config snippets map every node names to list("\n") so
|
|
||||||
# all lookups succeed
|
|
||||||
clc_defaults = zipmap(
|
|
||||||
concat(var.controllers.*.name, var.workers.*.name),
|
|
||||||
chunklist(data.template_file.clc-default-snippets.*.rendered, 1),
|
|
||||||
)
|
|
||||||
|
|
||||||
# Union of the default and user specific snippets, later overrides prior.
|
|
||||||
clc_map = merge(local.clc_defaults, var.clc_snippets)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Horrible hack to generate a Terraform list of node count length
|
|
||||||
data "template_file" "clc-default-snippets" {
|
|
||||||
count = length(var.controllers) + length(var.workers)
|
|
||||||
template = "\n"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -49,22 +49,22 @@ List of worker machine details (unique name, identifying MAC address, FQDN)
|
|||||||
EOD
|
EOD
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "clc_snippets" {
|
variable "snippets" {
|
||||||
type = map(list(string))
|
type = map(list(string))
|
||||||
description = "Map from machine names to lists of Container Linux Config snippets"
|
description = "Map from machine names to lists of Container Linux Config snippets"
|
||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_node_labels" {
|
variable "worker_node_labels" {
|
||||||
type = map(list(string))
|
type = map(list(string))
|
||||||
description = "Map from worker names to lists of initial node labels"
|
description = "Map from worker names to lists of initial node labels"
|
||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_node_taints" {
|
variable "worker_node_taints" {
|
||||||
type = map(list(string))
|
type = map(list(string))
|
||||||
description = "Map from worker names to lists of initial node taints"
|
description = "Map from worker names to lists of initial node taints"
|
||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
# configuration
|
# configuration
|
||||||
@ -79,12 +79,6 @@ variable "ssh_authorized_key" {
|
|||||||
description = "SSH public key for user 'core'"
|
description = "SSH public key for user 'core'"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "asset_dir" {
|
|
||||||
type = string
|
|
||||||
description = "Absolute path to a directory where generated assets should be placed (contains secrets)"
|
|
||||||
default = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "networking" {
|
variable "networking" {
|
||||||
type = string
|
type = string
|
||||||
description = "Choice of networking provider (flannel or calico)"
|
description = "Choice of networking provider (flannel or calico)"
|
||||||
@ -158,6 +152,12 @@ variable "enable_aggregation" {
|
|||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
|
variable "asset_dir" {
|
||||||
|
type = string
|
||||||
|
description = "Absolute path to a directory where generated assets should be placed (contains secrets)"
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
variable "cluster_domain_suffix" {
|
||||||
type = string
|
type = string
|
||||||
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
|
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
|
||||||
|
@ -1,12 +1,20 @@
|
|||||||
# Terraform version and plugin versions
|
# Terraform version and plugin versions
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
required_version = "~> 0.12.6"
|
required_version = ">= 0.12.26, < 0.14.0"
|
||||||
required_providers {
|
required_providers {
|
||||||
matchbox = "~> 0.3.0"
|
|
||||||
ct = "~> 0.3"
|
|
||||||
template = "~> 2.1"
|
template = "~> 2.1"
|
||||||
null = "~> 2.1"
|
null = "~> 2.1"
|
||||||
|
|
||||||
|
ct = {
|
||||||
|
source = "poseidon/ct"
|
||||||
|
version = "~> 0.6.1"
|
||||||
|
}
|
||||||
|
|
||||||
|
matchbox = {
|
||||||
|
source = "poseidon/matchbox"
|
||||||
|
version = "~> 0.4.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@ Typhoon distributes upstream Kubernetes, architectural conventions, and cluster
|
|||||||
|
|
||||||
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
## Features <a href="https://www.cncf.io/certification/software-conformance/"><img align="right" src="https://storage.googleapis.com/poseidon/certified-kubernetes.png"></a>
|
||||||
|
|
||||||
* Kubernetes v1.17.4 (upstream)
|
* Kubernetes v1.19.0 (upstream)
|
||||||
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [flannel](https://github.com/coreos/flannel) networking
|
* Single or multi-master, [Calico](https://www.projectcalico.org/) or [Cilium](https://github.com/cilium/cilium) or [flannel](https://github.com/coreos/flannel) networking
|
||||||
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/)
|
* On-cluster etcd with TLS, [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)-enabled, [network policy](https://kubernetes.io/docs/concepts/services-networking/network-policies/), SELinux enforcing
|
||||||
* Advanced features like [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
* Advanced features like [snippets](https://typhoon.psdn.io/advanced/customization/#container-linux) customization
|
||||||
* Ready for Ingress, Prometheus, Grafana, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
* Ready for Ingress, Prometheus, Grafana, and other optional [addons](https://typhoon.psdn.io/addons/overview/)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Kubernetes assets (kubeconfig, manifests)
|
# Kubernetes assets (kubeconfig, manifests)
|
||||||
module "bootstrap" {
|
module "bootstrap" {
|
||||||
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=73784c1b2c791d9ba586a1478979ac34dd324dad"
|
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=79343f02aea7c69bb03dab2051aa95248c0471d7"
|
||||||
|
|
||||||
cluster_name = var.cluster_name
|
cluster_name = var.cluster_name
|
||||||
api_servers = [var.k8s_domain_name]
|
api_servers = [var.k8s_domain_name]
|
||||||
|
@ -28,7 +28,7 @@ systemd:
|
|||||||
--network host \
|
--network host \
|
||||||
--volume /var/lib/etcd:/var/lib/etcd:rw,Z \
|
--volume /var/lib/etcd:/var/lib/etcd:rw,Z \
|
||||||
--volume /etc/ssl/etcd:/etc/ssl/certs:ro,Z \
|
--volume /etc/ssl/etcd:/etc/ssl/certs:ro,Z \
|
||||||
quay.io/coreos/etcd:v3.4.4
|
quay.io/coreos/etcd:v3.4.12
|
||||||
ExecStop=/usr/bin/podman stop etcd
|
ExecStop=/usr/bin/podman stop etcd
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@ -50,9 +50,10 @@ systemd:
|
|||||||
- name: kubelet.service
|
- name: kubelet.service
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube (System Container)
|
Description=Kubelet (System Container)
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=quay.io/poseidon/kubelet:v1.19.0
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
||||||
@ -80,10 +81,11 @@ systemd:
|
|||||||
--volume /opt/cni/bin:/opt/cni/bin:z \
|
--volume /opt/cni/bin:/opt/cni/bin:z \
|
||||||
--volume /etc/iscsi:/etc/iscsi \
|
--volume /etc/iscsi:/etc/iscsi \
|
||||||
--volume /sbin/iscsiadm:/sbin/iscsiadm \
|
--volume /sbin/iscsiadm:/sbin/iscsiadm \
|
||||||
k8s.gcr.io/hyperkube:v1.17.4 kubelet \
|
$${KUBELET_IMAGE} \
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
--cgroup-driver=systemd \
|
--cgroup-driver=systemd \
|
||||||
--cgroups-per-qos=true \
|
--cgroups-per-qos=true \
|
||||||
--enforce-node-allocatable=pods \
|
--enforce-node-allocatable=pods \
|
||||||
@ -91,17 +93,15 @@ systemd:
|
|||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--hostname-override=${domain_name} \
|
--hostname-override=${domain_name} \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/master \
|
|
||||||
--node-labels=node.kubernetes.io/controller="true" \
|
--node-labels=node.kubernetes.io/controller="true" \
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
|
--register-with-taints=node-role.kubernetes.io/controller=:NoSchedule \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/podman stop kubelet
|
ExecStop=-/usr/bin/podman stop kubelet
|
||||||
Delegate=yes
|
Delegate=yes
|
||||||
@ -127,18 +127,20 @@ systemd:
|
|||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
WorkingDirectory=/opt/bootstrap
|
WorkingDirectory=/opt/bootstrap
|
||||||
ExecStartPre=-/usr/bin/bash -c 'set -x && [ -n "$(ls /opt/bootstrap/assets/manifests-*/* 2>/dev/null)" ] && mv /opt/bootstrap/assets/manifests-*/* /opt/bootstrap/assets/manifests && rm -rf /opt/bootstrap/assets/manifests-*'
|
ExecStartPre=-/usr/bin/podman rm bootstrap
|
||||||
ExecStart=/usr/bin/podman run --name bootstrap \
|
ExecStart=/usr/bin/podman run --name bootstrap \
|
||||||
--network host \
|
--network host \
|
||||||
--volume /etc/kubernetes/bootstrap-secrets:/etc/kubernetes/secrets:ro,Z \
|
--volume /etc/kubernetes/bootstrap-secrets:/etc/kubernetes/secrets:ro,z \
|
||||||
--volume /opt/bootstrap/assets:/assets:ro,Z \
|
--volume /opt/bootstrap/assets:/assets:ro,Z \
|
||||||
--volume /opt/bootstrap/apply:/apply:ro,Z \
|
--volume /opt/bootstrap/apply:/apply:ro,Z \
|
||||||
--entrypoint=/apply \
|
--entrypoint=/apply \
|
||||||
k8s.gcr.io/hyperkube:v1.17.4
|
quay.io/poseidon/kubelet:v1.19.0
|
||||||
ExecStartPost=/bin/touch /opt/bootstrap/bootstrap.done
|
ExecStartPost=/bin/touch /opt/bootstrap/bootstrap.done
|
||||||
ExecStartPost=-/usr/bin/podman stop bootstrap
|
ExecStartPost=-/usr/bin/podman stop bootstrap
|
||||||
storage:
|
storage:
|
||||||
directories:
|
directories:
|
||||||
|
- path: /var/lib/etcd
|
||||||
|
mode: 0700
|
||||||
- path: /etc/kubernetes
|
- path: /etc/kubernetes
|
||||||
- path: /opt/bootstrap
|
- path: /opt/bootstrap
|
||||||
files:
|
files:
|
||||||
@ -162,12 +164,13 @@ storage:
|
|||||||
chmod -R 500 /etc/ssl/etcd
|
chmod -R 500 /etc/ssl/etcd
|
||||||
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
mv auth/kubeconfig /etc/kubernetes/bootstrap-secrets/
|
||||||
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
mv tls/k8s/* /etc/kubernetes/bootstrap-secrets/
|
||||||
sudo mkdir -p /etc/kubernetes/manifests
|
mkdir -p /etc/kubernetes/manifests
|
||||||
sudo mv static-manifests/* /etc/kubernetes/manifests/
|
mv static-manifests/* /etc/kubernetes/manifests/
|
||||||
sudo mkdir -p /opt/bootstrap/assets
|
mkdir -p /opt/bootstrap/assets
|
||||||
sudo mv manifests /opt/bootstrap/assets/manifests
|
mv manifests /opt/bootstrap/assets/manifests
|
||||||
sudo mv manifests-networking /opt/bootstrap/assets/manifests-networking
|
mv manifests-networking/* /opt/bootstrap/assets/manifests/
|
||||||
rm -rf assets auth static-manifests tls
|
rm -rf assets auth static-manifests tls manifests-networking
|
||||||
|
chcon -R -u system_u -t container_file_t /etc/kubernetes/bootstrap-secrets
|
||||||
- path: /opt/bootstrap/apply
|
- path: /opt/bootstrap/apply
|
||||||
mode: 0544
|
mode: 0544
|
||||||
contents:
|
contents:
|
||||||
@ -186,6 +189,18 @@ storage:
|
|||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
|
- path: /etc/sysctl.d/reverse-path-filter.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
net.ipv4.conf.default.rp_filter=0
|
||||||
|
net.ipv4.conf.*.rp_filter=0
|
||||||
|
- path: /etc/systemd/network/50-flannel.link
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
[Match]
|
||||||
|
OriginalName=flannel*
|
||||||
|
[Link]
|
||||||
|
MACAddressPolicy=none
|
||||||
- path: /etc/systemd/system.conf.d/accounting.conf
|
- path: /etc/systemd/system.conf.d/accounting.conf
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
@ -193,19 +208,6 @@ storage:
|
|||||||
DefaultCPUAccounting=yes
|
DefaultCPUAccounting=yes
|
||||||
DefaultMemoryAccounting=yes
|
DefaultMemoryAccounting=yes
|
||||||
DefaultBlockIOAccounting=yes
|
DefaultBlockIOAccounting=yes
|
||||||
- path: /etc/sysconfig/docker
|
|
||||||
mode: 0644
|
|
||||||
overwrite: true
|
|
||||||
contents:
|
|
||||||
inline: |
|
|
||||||
# Modify these options if you want to change the way the docker daemon runs
|
|
||||||
OPTIONS="--selinux-enabled \
|
|
||||||
--log-driver=json-file \
|
|
||||||
--live-restore \
|
|
||||||
--default-ulimit nofile=1024:1024 \
|
|
||||||
--init-path /usr/libexec/docker/docker-init \
|
|
||||||
--userland-proxy-path /usr/libexec/docker/docker-proxy \
|
|
||||||
"
|
|
||||||
- path: /etc/etcd/etcd.env
|
- path: /etc/etcd/etcd.env
|
||||||
mode: 0644
|
mode: 0644
|
||||||
contents:
|
contents:
|
||||||
|
@ -20,9 +20,10 @@ systemd:
|
|||||||
- name: kubelet.service
|
- name: kubelet.service
|
||||||
contents: |
|
contents: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Kubelet via Hyperkube (System Container)
|
Description=Kubelet (System Container)
|
||||||
Wants=rpc-statd.service
|
Wants=rpc-statd.service
|
||||||
[Service]
|
[Service]
|
||||||
|
Environment=KUBELET_IMAGE=quay.io/poseidon/kubelet:v1.19.0
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
||||||
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
||||||
@ -50,10 +51,11 @@ systemd:
|
|||||||
--volume /opt/cni/bin:/opt/cni/bin:z \
|
--volume /opt/cni/bin:/opt/cni/bin:z \
|
||||||
--volume /etc/iscsi:/etc/iscsi \
|
--volume /etc/iscsi:/etc/iscsi \
|
||||||
--volume /sbin/iscsiadm:/sbin/iscsiadm \
|
--volume /sbin/iscsiadm:/sbin/iscsiadm \
|
||||||
k8s.gcr.io/hyperkube:v1.17.4 kubelet \
|
$${KUBELET_IMAGE} \
|
||||||
--anonymous-auth=false \
|
--anonymous-auth=false \
|
||||||
--authentication-token-webhook \
|
--authentication-token-webhook \
|
||||||
--authorization-mode=Webhook \
|
--authorization-mode=Webhook \
|
||||||
|
--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig \
|
||||||
--cgroup-driver=systemd \
|
--cgroup-driver=systemd \
|
||||||
--cgroups-per-qos=true \
|
--cgroups-per-qos=true \
|
||||||
--enforce-node-allocatable=pods \
|
--enforce-node-allocatable=pods \
|
||||||
@ -61,11 +63,9 @@ systemd:
|
|||||||
--cluster_dns=${cluster_dns_service_ip} \
|
--cluster_dns=${cluster_dns_service_ip} \
|
||||||
--cluster_domain=${cluster_domain_suffix} \
|
--cluster_domain=${cluster_domain_suffix} \
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
||||||
--exit-on-lock-contention \
|
|
||||||
--healthz-port=0 \
|
--healthz-port=0 \
|
||||||
--hostname-override=${domain_name} \
|
--hostname-override=${domain_name} \
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
--kubeconfig=/var/lib/kubelet/kubeconfig \
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
--network-plugin=cni \
|
||||||
--node-labels=node.kubernetes.io/node \
|
--node-labels=node.kubernetes.io/node \
|
||||||
%{~ for label in compact(split(",", node_labels)) ~}
|
%{~ for label in compact(split(",", node_labels)) ~}
|
||||||
@ -76,6 +76,7 @@ systemd:
|
|||||||
%{~ endfor ~}
|
%{~ endfor ~}
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
||||||
--read-only-port=0 \
|
--read-only-port=0 \
|
||||||
|
--rotate-certificates \
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
||||||
ExecStop=-/usr/bin/podman stop kubelet
|
ExecStop=-/usr/bin/podman stop kubelet
|
||||||
Delegate=yes
|
Delegate=yes
|
||||||
@ -105,6 +106,18 @@ storage:
|
|||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
fs.inotify.max_user_watches=16184
|
fs.inotify.max_user_watches=16184
|
||||||
|
- path: /etc/sysctl.d/reverse-path-filter.conf
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
net.ipv4.conf.default.rp_filter=0
|
||||||
|
net.ipv4.conf.*.rp_filter=0
|
||||||
|
- path: /etc/systemd/network/50-flannel.link
|
||||||
|
contents:
|
||||||
|
inline: |
|
||||||
|
[Match]
|
||||||
|
OriginalName=flannel*
|
||||||
|
[Link]
|
||||||
|
MACAddressPolicy=none
|
||||||
- path: /etc/systemd/system.conf.d/accounting.conf
|
- path: /etc/systemd/system.conf.d/accounting.conf
|
||||||
contents:
|
contents:
|
||||||
inline: |
|
inline: |
|
||||||
@ -112,19 +125,6 @@ storage:
|
|||||||
DefaultCPUAccounting=yes
|
DefaultCPUAccounting=yes
|
||||||
DefaultMemoryAccounting=yes
|
DefaultMemoryAccounting=yes
|
||||||
DefaultBlockIOAccounting=yes
|
DefaultBlockIOAccounting=yes
|
||||||
- path: /etc/sysconfig/docker
|
|
||||||
mode: 0644
|
|
||||||
overwrite: true
|
|
||||||
contents:
|
|
||||||
inline: |
|
|
||||||
# Modify these options if you want to change the way the docker daemon runs
|
|
||||||
OPTIONS="--selinux-enabled \
|
|
||||||
--log-driver=json-file \
|
|
||||||
--live-restore \
|
|
||||||
--default-ulimit nofile=1024:1024 \
|
|
||||||
--init-path /usr/libexec/docker/docker-init \
|
|
||||||
--userland-proxy-path /usr/libexec/docker/docker-proxy \
|
|
||||||
"
|
|
||||||
passwd:
|
passwd:
|
||||||
users:
|
users:
|
||||||
- name: core
|
- name: core
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user