Skip to content

Commit c0ec59c

Browse files
authored
Merge pull request #670 from stevehipwell/add-helm-chart
Add Helm chart
2 parents 55aa66d + bc415d2 commit c0ec59c

21 files changed

+689
-6
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Lint and Test Chart
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "charts/metrics-server/**"
7+
8+
jobs:
9+
lint-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set up Helm
18+
uses: azure/setup-helm@v1
19+
with:
20+
version: v3.6.3
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: 3.7
26+
27+
- name: Set up chart-testing
28+
uses: helm/[email protected]
29+
30+
- name: Run chart-testing (list-changed)
31+
id: list-changed
32+
run: |
33+
changed=$(ct list-changed)
34+
if [[ -n "$changed" ]]; then
35+
echo "::set-output name=changed::true"
36+
fi
37+
38+
- name: Run chart-testing (lint)
39+
run: ct lint
40+
41+
- name: Create Kind cluster
42+
uses: helm/[email protected]
43+
with:
44+
wait: 120s
45+
if: steps.list-changed.outputs.changed == 'true'
46+
47+
- name: Run chart-testing (install)
48+
run: ct install

.github/workflows/release-chart.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release Chart
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "charts/metrics-server/**"
9+
10+
jobs:
11+
release:
12+
if: startsWith(github.ref, "refs/tags/v")
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Configure Git
21+
run: |
22+
git config user.name "$GITHUB_ACTOR"
23+
git config user.email "[email protected]"
24+
25+
- name: Install Helm
26+
uses: azure/setup-helm@v1
27+
with:
28+
version: v3.6.3
29+
30+
- name: Run chart-releaser
31+
uses: helm/[email protected]
32+
env:
33+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
34+
CR_RELEASE_NAME_TEMPLATE: "metrics-server-helm-chart-{{ .Version }}"

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ Latest Metrics Server release can be installed by running:
5959
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
6060
```
6161

62+
Or via the [Helm chart](charts/metrics-server/README.md).
63+
6264
Installation instructions for previous releases can be found in [Metrics Server releases].
6365

6466
Compatibility matrix:
@@ -133,12 +135,6 @@ You can get a full list of Metrics Server configuration flags by running:
133135
docker run --rm k8s.gcr.io/metrics-server/metrics-server:v0.5.0 --help
134136
```
135137

136-
#### Helm Chart
137-
138-
This [Helm chart](https://github.com/helm/charts/tree/master/stable/metrics-server) can deploy the metric-server service in your cluster.
139-
140-
Note: This Helm chart isn't supported by Metrics Server maintainers.
141-
142138
## Design
143139

144140
Metrics Server is a component in the core metrics pipeline described in [Kubernetes monitoring architecture].

charts/metrics-server/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/metrics-server/Chart.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v2
2+
name: metrics-server
3+
description: Metrics Server is a scalable, efficient source of container resource metrics for Kubernetes built-in autoscaling pipelines.
4+
type: application
5+
version: 3.5.0
6+
appVersion: 0.5.0
7+
keywords:
8+
- kubernetes
9+
- metrics-server
10+
- metrics
11+
home: https://github.com/kubernetes-sigs/metrics-server
12+
icon: https://avatars.githubusercontent.com/u/36015203?s=400&v=4
13+
sources:
14+
- https://github.com/kubernetes-sigs/metrics-server
15+
maintainers:
16+
- name: stevehipwell
17+
url: https://github.com/stevehipwell
18+
- name: krmichel
19+
url: https://github.com/krmichel
20+
- name: endrec
21+
url: https://github.com/endrec
22+
annotations:
23+
artifacthub.io/changes: |
24+
- kind: added
25+
description: "Initial release from official repo."

charts/metrics-server/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Kubernetes Metrics Server
2+
3+
[Metrics Server](https://github.com/kubernetes-sigs/metrics-server/) is a scalable, efficient source of container resource metrics for Kubernetes built-in autoscaling pipelines.
4+
5+
## Installing the Chart
6+
7+
Before you can install the chart you will need to add the `metrics-server` repo to [Helm](https://helm.sh/).
8+
9+
```shell
10+
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
11+
```
12+
13+
After you've installed the repo you can install the chart.
14+
15+
```shell
16+
helm upgrade --install metrics-server/metrics-server
17+
```
18+
19+
## Configuration
20+
21+
The following table lists the configurable parameters of the _Metrics Server_ chart and their default values.
22+
23+
| Parameter | Description | Default |
24+
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
25+
| `image.repository` | Image repository. | `k8s.gcr.io/metrics-server/metrics-server` |
26+
| `image.tag` | Image tag, will override the default tag derived from the chart app version. | `""` |
27+
| `image.pullPolicy` | Image pull policy. | `IfNotPresent` |
28+
| `imagePullSecrets` | Image pull secrets. | `[]` |
29+
| `nameOverride` | Override the `name` of the chart. | `nil` |
30+
| `fullnameOverride` | Override the `fullname` of the chart. | `nil` |
31+
| `serviceAccount.create` | If `true`, create a new service account. | `true` |
32+
| `serviceAccount.annotations` | Annotations to add to the service account. | `{}` |
33+
| `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the full name template. | `nil` |
34+
| `rbac.create` | If `true`, create the RBAC resources. | `true` |
35+
| `rbac.pspEnabled` | If `true`, create a pod security policy resource. | `false` |
36+
| `apiService.create` | If `true`, create the `v1beta1.metrics.k8s.io` API service. You typically want this enabled! If you disable API service creation you have to manage it outside of this chart for e.g horizontal pod autoscaling to work with this release. | `true` |
37+
| `podLabels` | Labels to add to the pod. | `{}` |
38+
| `podAnnotations` | Annotations to add to the pod. | `{}` |
39+
| `podSecurityContext` | Security context for the pod. | `{}` |
40+
| `securityContext` | Security context for the _metrics-server_ container. | _See values.yaml_ |
41+
| `priorityClassName` | Priority class name to use. | `system-cluster-critical` |
42+
| `containerPort` | port for the _metrics-server_ container. | `4443` |
43+
| `hostNetwork.enabled` | If `true`, start _metric-server_ in hostNetwork mode. You would require this enabled if you use alternate overlay networking for pods and API server unable to communicate with metrics-server. As an example, this is required if you use Weave network on EKS. | `false` |
44+
| `replicas` | Number of replicas to run. | `1` |
45+
| `updateStrategy` | Customise the default update strategy. | `{}` |
46+
| `podDisruptionBudget.enabled` | If `true`, create `PodDisruptionBudget` resource. | `{}` |
47+
| `podDisruptionBudget.minAvailable` | Set the `PodDisruptionBugdet` minimum available pods. | `nil` |
48+
| `podDisruptionBudget.maxUnavailable` | Set the `PodDisruptionBugdet` maximum unavailable pods. | `nil` |
49+
| `args` | Additional arguments to pass to the _metrics-server_ command. | `[]` |
50+
| `livenessProbe` | Liveness probe. | See _values.yaml_ |
51+
| `readinessProbe` | Readiness probe. | See _values.yaml_ |
52+
| `service.type` | Service type. | `ClusterIP` |
53+
| `service.port` | Service port. | `443` |
54+
| `service.annotations` | Annotations to add to the service. | `{}` |
55+
| `service.labels` | Labels to add to the service. | `{}` |
56+
| `resources` | Resource requests and limits for the _metrics-server_ container. | `{}` |
57+
| `extraVolumeMounts` | Additional volume mounts for the _metrics-server_ container. | `[]` |
58+
| `extraVolumes` | Additional volumes for the pod. | `[]` |
59+
| `nodeSelector` | Node labels for pod assignment. | `{}` |
60+
| `tolerations` | Tolerations for pod assignment. | `[]` |
61+
| `affinity` | Affinity for pod assignment. | `{}` |
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
args:
2+
- --kubelet-insecure-tls
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
***********************************************************************
2+
* Metrics Server *
3+
***********************************************************************
4+
Chart version: {{ .Chart.Version }}
5+
App version: {{ .Chart.AppVersion }}
6+
Image tag: {{ include "metrics-server.image" . }}
7+
***********************************************************************

0 commit comments

Comments
 (0)