Skip to content

Commit

Permalink
Merge pull request #116 from himanshu-kun/retry-1.21-sync
Browse files Browse the repository at this point in the history
Sync with upstream 1.21.0
  • Loading branch information
himanshu-kun authored Apr 26, 2022
2 parents 443ceae + 80b833a commit 585b211
Show file tree
Hide file tree
Showing 4,298 changed files with 299,175 additions and 164,740 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Feature request
about: Suggest an idea for one of the autoscaling components hosted in this repository
title: ''
labels: 'kind/feature'
assignees: ''

---

<!--
Thanks for taking the time to raise a feature request! Please answer these questions as best you can before submitting.
-->

**Which component are you using?**:

<!--
Which component hosted in this repository is this a feature for?
-->

**Is your feature request designed to solve a problem? If so describe the problem this feature should solve.**:
<!--
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-->

**Describe the solution you'd like.**:

<!--
A clear and concise description of what you want to happen.
-->

**Describe any alternative solutions you've considered.**:

<!--
A description of any alternative solutions or features you've considered, especially in comparison to your preferred solution/feature.
-->

**Additional context.**:

<!--
Add any other context or screenshots about your feature request here.
-->
36 changes: 36 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on:
- push
- pull_request

env:
GOPATH: ${{ github.workspace }}/go

jobs:
test-and-verify:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15

- uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/k8s.io/autoscaler

- name: Apt-get
run: sudo apt-get install libseccomp-dev -qq

- name: Prepare
working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler
run: hack/install-verify-tools.sh

- name: Verify
working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler
run: hack/verify-all.sh -v

- name: Test
working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler
run: hack/for-go-proj.sh test
27 changes: 16 additions & 11 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,24 @@ jobs:
uses: actions/checkout@v2
- name: Fetch history
run: git fetch --prune --unshallow
- id: lint
name: Run chart-testing (lint)
uses: helm/chart-testing-action@v1.0.0-rc.2
with:
command: lint
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
- name: Run chart-testing (lint)
run: ct lint
# Only build a kind cluster if there are chart changes to test.
- if: steps.lint.outputs.changed == 'true'
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- if: steps.list-changed.outputs.changed == 'true'
name: Create kind cluster
uses: helm/kind-action@v1.0.0-alpha.3
- name: Run chart-testing (install)
uses: helm/chart-testing-action@v1.0.0-rc.2
with:
command: install
uses: helm/kind-action@v1.1.0
- if: steps.list-changed.outputs.changed == 'true'
name: Run chart-testing (install)
run: ct install
helm-docs-validate:
if: ${{ needs.changes.outputs.charts == 'true' }}
name: Helm Docs
Expand Down
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Copyright: 2014 Sam Ghods
License: MIT

Files: cluster-autoscaler/vendor/github.com/go-ini/ini/**
Copyright: 2016 Unknwon
Copyright: 2016 Unknown
License: Apache-2.0

Files: cluster-autoscaler/vendor/github.com/go-openapi/jsonpointer/**
Expand Down
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This repository contains autoscaling-related components for Kubernetes.
## What's inside

[Cluster Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) - a component that automatically adjusts the size of a Kubernetes
Cluster so that all pods have a place to run and there are no unneeded nodes. Works with GCP, AWS and Azure. Version 1.0 (GA) was released with kubernetes 1.8.
Cluster so that all pods have a place to run and there are no unneeded nodes. Supports several public cloud providers. Version 1.0 (GA) was released with kubernetes 1.8.

[Vertical Pod Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler) - a set of components that automatically adjust the
amount of CPU and memory requested by pods running in the Kubernetes Cluster. Current state - beta.
Expand Down
2 changes: 1 addition & 1 deletion addon-resizer/deploy/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
spec:
serviceAccountName: pod-nanny
containers:
- image: gcr.io/bskiba-gke-dev/addon-resizer:1.8.7
- image: k8s.gcr.io/addon-resizer:1.8.7
imagePullPolicy: Always
name: pod-nanny
resources:
Expand Down
2 changes: 2 additions & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The binary for `pre-commit` can be installed via Homebrew:
$ brew install pre-commit
```

For those without Homebrew, Pre-commit has [other installation methods available](https://pre-commit.com/#install).

### Install git hooks

After the `pre-commit` binary is installed, go to this repository's directory, and run the following command to install the git hook:
Expand Down
6 changes: 3 additions & 3 deletions charts/cluster-autoscaler/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v2
appVersion: 1.18.1
appVersion: 1.20.0
description: Scales Kubernetes worker nodes within autoscaling groups.
engine: gotpl
home: https://github.com/kubernetes/autoscaler
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
icon: https://github.com/kubernetes/kubernetes/raw/master/logo/logo.png
maintainers:
- email: e.bailey@sportradar.com
name: yurrriq
Expand All @@ -17,4 +17,4 @@ name: cluster-autoscaler
sources:
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
type: application
version: 9.1.0
version: 9.9.2
29 changes: 22 additions & 7 deletions charts/cluster-autoscaler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,21 @@ This chart bootstraps a cluster-autoscaler deployment on a [Kubernetes](http://k
The previous `cluster-autoscaler` Helm chart hosted at [helm/charts](https://github.com/helm/charts) has been moved to this repository in accordance with the [Deprecation timeline](https://github.com/helm/charts#deprecation-timeline). Note that a few things have changed between this version and the old version:

- This repository **only** supports Helm chart installations using Helm 3+ since the `apiVersion` on the charts has been marked as `v2`.
- Previous versions of the Helm chart have not been migrated, and the version was reset to `1.0.0` initially. If you are looking for old versions of the chart, it's best to run `helm pull stable/cluster-autoscaler --version <your-version>` until you are ready to move to this repository's version.
- The previous versioning scheme has been returned to as of version `9.0.0` for ease of migration from the previous chart location.
- Previous versions of the Helm chart have not been migrated

## Migration from 1.X to 9.X+ versions of this Chart

On initial adoption of this chart this chart was renamed from `cluster-autoscaler` to `cluster-autoscaler-chart` due to technical limitations. This affects all `1.X` releases of the chart.
**TL;DR:**
You should choose to use versions >=9.0.0 of the `cluster-autoscaler` chart published from this repository; previous versions, and the `cluster-autoscaler-chart` with versioning 1.X.X published from this repository are deprecated.

Releases of the chart from `9.0.0` onwards return the naming of the chart to `cluster-autoscaler` and return to following the versioning established by the chart's previous location.
<details>
<summary>Previous versions of this chart - further details</summary>
On initial migration of this chart from the `helm/charts` repository this chart was renamed from `cluster-autoscaler` to `cluster-autoscaler-chart` due to technical limitations. This affected all `1.X` releases of the chart, version 2.0.0 of this chart exists only to mark the [`cluster-autoscaler-chart` chart](https://artifacthub.io/packages/helm/cluster-autoscaler/cluster-autoscaler-chart) as deprecated.

Releases of the chart from `9.0.0` onwards return the naming of the chart to `cluster-autoscaler` and return to following the versioning established by the chart's previous location at .

To migrate from a 1.X release of the chart to a `9.0.0` or later release, you should first uninstall your `1.X` install of the `cluster-autoscaler-chart` chart, before performing the installation of the new `cluster-autoscaler` chart.
</details>

## Migration from 9.0 to 9.1

Expand Down Expand Up @@ -325,6 +330,7 @@ Though enough for the majority of installations, the default PodSecurityPolicy _

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| additionalLabels | object | `{}` | Labels to add to each object of the chart. |
| affinity | object | `{}` | Affinity for pod assignment |
| autoDiscovery.clusterName | string | `nil` | Enable autodiscovery for `cloudProvider=aws`, for groups matching `autoDiscovery.tags`. Enable autodiscovery for `cloudProvider=gce`, but no MIG tagging required. Enable autodiscovery for `cloudProvider=magnum`, for groups matching `autoDiscovery.roles`. |
| autoDiscovery.roles | list | `["worker"]` | Magnum node group roles to match. |
Expand All @@ -350,15 +356,18 @@ Though enough for the majority of installations, the default PodSecurityPolicy _
| envFromConfigMap | string | `""` | ConfigMap name to use as envFrom. |
| envFromSecret | string | `""` | Secret name to use as envFrom. |
| expanderPriorities | object | `{}` | The expanderPriorities is used if `extraArgs.expander` is set to `priority` and expanderPriorities is also set with the priorities. If `extraArgs.expander` is set to `priority`, then expanderPriorities is used to define cluster-autoscaler-priority-expander priorities. See: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md |
| extraArgs | object | `{"logtostderr":true,"stderrthreshold":"info","v":4}` | Additional container arguments. |
| extraArgs | object | `{"logtostderr":true,"stderrthreshold":"info","v":4}` | Additional container arguments. Refer to https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca for the full list of cluster autoscaler parameters and their default values. |
| extraEnv | object | `{}` | Additional container environment variables. |
| extraEnvConfigMaps | object | `{}` | Additional container environment variables from ConfigMaps. |
| extraEnvSecrets | object | `{}` | Additional container environment variables from Secrets. |
| extraVolumeMounts | list | `[]` | Additional volumes to mount. |
| extraVolumeSecrets | object | `{}` | Additional volumes to mount from Secrets. |
| extraVolumes | list | `[]` | Additional volumes. |
| fullnameOverride | string | `""` | String to fully override `cluster-autoscaler.fullname` template. |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| image.pullSecrets | list | `[]` | Image pull secrets |
| image.repository | string | `"us.gcr.io/k8s-artifacts-prod/autoscaling/cluster-autoscaler"` | Image repository |
| image.tag | string | `"v1.18.1"` | Image tag |
| image.repository | string | `"k8s.gcr.io/autoscaling/cluster-autoscaler"` | Image repository |
| image.tag | string | `"v1.20.0"` | Image tag |
| kubeTargetVersionOverride | string | `""` | Allow overriding the `.Capabilities.KubeVersion.GitVersion` check. Useful for `helm template` commands. |
| magnumCABundlePath | string | `"/etc/kubernetes/ca-bundle.crt"` | Path to the host's CA bundle, from `ca-file` in the cloud-config file. |
| magnumClusterName | string | `""` | Cluster name or ID in Magnum. Required if `cloudProvider=magnum` and not setting `autoDiscovery.clusterName`. |
Expand All @@ -368,9 +377,15 @@ Though enough for the majority of installations, the default PodSecurityPolicy _
| podDisruptionBudget | object | `{"maxUnavailable":1}` | Pod disruption budget. |
| podLabels | object | `{}` | Labels to add to each pod. |
| priorityClassName | string | `""` | priorityClassName |
| prometheusRule.additionalLabels | object | `{}` | Additional labels to be set in metadata. |
| prometheusRule.enabled | bool | `false` | If true, creates a Prometheus Operator PrometheusRule. |
| prometheusRule.interval | string | `nil` | How often rules in the group are evaluated (falls back to `global.evaluation_interval` if not set). |
| prometheusRule.namespace | string | `"monitoring"` | Namespace which Prometheus is running in. |
| prometheusRule.rules | list | `[]` | Rules spec template (see https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#rule). |
| rbac.create | bool | `true` | If `true`, create and use RBAC resources. |
| rbac.pspEnabled | bool | `false` | If `true`, creates and uses RBAC resources required in the cluster with [Pod Security Policies](https://kubernetes.io/docs/concepts/policy/pod-security-policy/) enabled. Must be used with `rbac.create` set to `true`. |
| rbac.serviceAccount.annotations | object | `{}` | Additional Service Account annotations. |
| rbac.serviceAccount.automountServiceAccountToken | bool | `true` | Automount API credentials for a Service Account. |
| rbac.serviceAccount.create | bool | `true` | If `true` and `rbac.create` is also true, a Service Account will be created. |
| rbac.serviceAccount.name | string | `""` | The name of the ServiceAccount to use. If not set and create is `true`, a name is generated using the fullname template. |
| replicaCount | int | `1` | Desired number of pods |
Expand Down
13 changes: 9 additions & 4 deletions charts/cluster-autoscaler/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,21 @@ This chart bootstraps a cluster-autoscaler deployment on a [Kubernetes](http://k
The previous `cluster-autoscaler` Helm chart hosted at [helm/charts](https://github.com/helm/charts) has been moved to this repository in accordance with the [Deprecation timeline](https://github.com/helm/charts#deprecation-timeline). Note that a few things have changed between this version and the old version:

- This repository **only** supports Helm chart installations using Helm 3+ since the `apiVersion` on the charts has been marked as `v2`.
- Previous versions of the Helm chart have not been migrated, and the version was reset to `1.0.0` initially. If you are looking for old versions of the chart, it's best to run `helm pull stable/cluster-autoscaler --version <your-version>` until you are ready to move to this repository's version.
- The previous versioning scheme has been returned to as of version `9.0.0` for ease of migration from the previous chart location.
- Previous versions of the Helm chart have not been migrated

## Migration from 1.X to 9.X+ versions of this Chart

On initial adoption of this chart this chart was renamed from `cluster-autoscaler` to `cluster-autoscaler-chart` due to technical limitations. This affects all `1.X` releases of the chart.
**TL;DR:**
You should choose to use versions >=9.0.0 of the `cluster-autoscaler` chart published from this repository; previous versions, and the `cluster-autoscaler-chart` with versioning 1.X.X published from this repository are deprecated.

Releases of the chart from `9.0.0` onwards return the naming of the chart to `cluster-autoscaler` and return to following the versioning established by the chart's previous location.
<details>
<summary>Previous versions of this chart - further details</summary>
On initial migration of this chart from the `helm/charts` repository this chart was renamed from `cluster-autoscaler` to `cluster-autoscaler-chart` due to technical limitations. This affected all `1.X` releases of the chart, version 2.0.0 of this chart exists only to mark the [`cluster-autoscaler-chart` chart](https://artifacthub.io/packages/helm/cluster-autoscaler/cluster-autoscaler-chart) as deprecated.

Releases of the chart from `9.0.0` onwards return the naming of the chart to `cluster-autoscaler` and return to following the versioning established by the chart's previous location at .

To migrate from a 1.X release of the chart to a `9.0.0` or later release, you should first uninstall your `1.X` install of the `cluster-autoscaler-chart` chart, before performing the installation of the new `cluster-autoscaler` chart.
</details>

## Migration from 9.0 to 9.1

Expand Down
3 changes: 3 additions & 0 deletions charts/cluster-autoscaler/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ Return labels, including instance and name.
{{ include "cluster-autoscaler.instance-name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
helm.sh/chart: {{ include "cluster-autoscaler.chart" . | quote }}
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels }}
{{- end -}}
{{- end -}}

{{/*
Expand Down
33 changes: 30 additions & 3 deletions charts/cluster-autoscaler/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ spec:
{{- end }}
labels:
{{ include "cluster-autoscaler.instance-name" . | indent 8 }}
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels | indent 8 }}
{{- end }}
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
{{- end }}
Expand Down Expand Up @@ -67,7 +70,7 @@ spec:
- --cluster-name={{ .Values.magnumClusterName }}
{{- end }}
{{- end }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
{{- if eq .Values.cloudProvider "magnum" }}
- --cloud-config={{ .Values.cloudConfigPath }}
{{- end }}
{{- range $key, $value := .Values.extraArgs }}
Expand Down Expand Up @@ -179,16 +182,26 @@ spec:
securityContext:
{{ toYaml .Values.containerSecurityContext | nindent 12 | trim }}
{{- end }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
{{- if or (eq .Values.cloudProvider "magnum") .Values.extraVolumeSecrets .Values.extraVolumeMounts }}
volumeMounts:
{{- if eq .Values.cloudProvider "magnum" }}
- name: cloudconfig
mountPath: {{ .Values.cloudConfigPath }}
readOnly: true
{{- end }}
{{- if and (eq .Values.cloudProvider "magnum") (.Values.magnumCABundlePath) }}
- name: ca-bundle
mountPath: {{ .Values.magnumCABundlePath }}
readOnly: true
{{- end }}
{{- range $key, $value := .Values.extraVolumeSecrets }}
- name: {{ $key }}
mountPath: {{ required "Must specify mountPath!" $value.mountPath }}
readOnly: true
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.affinity }}
affinity:
Expand All @@ -205,16 +218,30 @@ spec:
securityContext:
{{ toYaml .Values.securityContext | nindent 8 | trim }}
{{- end }}
{{- if or (eq .Values.cloudProvider "gce") (eq .Values.cloudProvider "magnum") }}
{{- if or (eq .Values.cloudProvider "magnum") .Values.extraVolumeSecrets .Values.extraVolumes }}
volumes:
{{- if eq .Values.cloudProvider "magnum" }}
- name: cloudconfig
hostPath:
path: {{ .Values.cloudConfigPath }}
{{- end }}
{{- if and (eq .Values.cloudProvider "magnum") (.Values.magnumCABundlePath) }}
- name: ca-bundle
hostPath:
path: {{ .Values.magnumCABundlePath }}
{{- end }}
{{- range $key, $value := .Values.extraVolumeSecrets }}
- name: {{ $key }}
secret:
secretName: {{ default (include "cluster-autoscaler.fullname" $) $value.name }}
{{- if $value.items }}
items:
{{- toYaml $value.items | nindent 14 }}
{{- end }}
{{- end }}
{{- if .Values.extraVolumes }}
{{- toYaml .Values.extraVolumes | nindent 10 }}
{{- end }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
Expand Down
Loading

0 comments on commit 585b211

Please sign in to comment.