Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-13579: WRKLDS-700: bump(k8s) to v0.27.1 (downstream descheduler) #92

Merged
merged 39 commits into from May 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e774be4
Fix v1alpha1 conversion to use universal decoder
gustavomfc Jan 30, 2023
f14cd9f
Copyright date from 2022 to 2023
gustavomfc Jan 30, 2023
c92d7bd
metrics: enable loop duration and strategy duration metrics (#1041)
harshanarayana Feb 4, 2023
ee6f59c
v1alpha2 docs (#1049)
knelasevero Feb 14, 2023
9088216
remove some logic useless
lucming Feb 16, 2023
5a546d5
fitsRequest check pod num
xiaoanyunfei Feb 16, 2023
f69b8d2
Adding descheduler policy API Version option in helm templates (#1068)
gdasson Mar 3, 2023
e910d87
Fix typo in nodeutilization types
JannikSt Mar 6, 2023
94c67de
Add note to HighNodeUtilization readme for GKE users
damemi Mar 8, 2023
0922a36
expose securityContext
JaneLiuL Mar 1, 2023
e59da36
remove e2e tests from helm github action
a7i Sep 3, 2022
8e7c2f5
Add k8s compatibility warnings to logs
JaneLiuL Feb 23, 2023
bc0fae6
docs: typo
effy-coding Mar 14, 2023
46cf540
Descheduling profile with PoC fake plugin (#1093)
ingvagabund Mar 23, 2023
26c59fe
fix gofumpt violation
a7i Mar 25, 2023
6b2e243
Make cobra args help info to uppercase.
Mar 31, 2023
a4fd1dc
fix if condition for the right value of EvictLocalStoragePods
Apr 2, 2023
18ce371
bump to k8s 1.27 rc0
a7i Mar 25, 2023
4e6ae4b
fix IsPodWithPVC func notes.
Apr 2, 2023
99305a8
Move framework types under framework/types
ingvagabund Mar 23, 2023
9d6f85c
Extend PluginRegistry with plugin type
ingvagabund Mar 30, 2023
9e1d4fe
Detect individual extension points from plugin types
ingvagabund Mar 30, 2023
68a6881
Delete "io/ioutil" package.
Apr 6, 2023
f133a94
Fix typo log message for cachedClient
Apr 7, 2023
1b77af5
bump to k8s 1.27 (#1115)
a7i Apr 12, 2023
bcb2319
update v0.26.1 references
a7i Apr 3, 2023
88bd7f5
Drop Evict extension point
ingvagabund Apr 16, 2023
28989f5
Add json tags to internal fields and basic config test
damemi Apr 17, 2023
180d89a
Drop remaining mentions of evict extension point
ingvagabund Apr 25, 2023
77d4c6f
Add note on documentation versions with links
damemi Apr 26, 2023
79c3968
Add missing quote to configmap
damemi Apr 28, 2023
4c40cf1
fix policy example configmap
AllenZMC Apr 29, 2023
f8bf306
Do some code cleans.
Apr 26, 2023
5c54700
k8s 1.27: update docs and README
a7i Apr 12, 2023
c6bd133
update helm chart to v0.27.0 (#1136)
a7i May 5, 2023
e623253
update helm github action workflow
a7i May 3, 2023
f426f82
add unit tests for version compatibility check
a7i Mar 22, 2023
d00556b
fix plugin arg conversion when using multiple profiles with same plug…
a7i May 11, 2023
e7e92a8
Use dl.k8s.io instead of kubernetes-release bucket
ratnopamc May 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 1 addition & 8 deletions .github/workflows/helm.yaml
Expand Up @@ -35,7 +35,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: '1.19.3'
go-version: '1.20.3'

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.2.1
Expand All @@ -60,10 +60,3 @@ jobs:
# helm-extra-set-args only available after ct 3.6.0
- name: Run chart-testing (install)
run: ct install --config=.github/ci/ct.yaml --helm-extra-set-args='--set=kind=Deployment'

- name: E2E after chart install
env:
KUBERNETES_VERSION: "v1.26.0"
KIND_E2E: true
SKIP_INSTALL: true
run: make test-e2e
38 changes: 38 additions & 0 deletions .github/workflows/manifests.yaml
@@ -0,0 +1,38 @@
name: manifests

on:
pull_request:

jobs:
deploy:
strategy:
matrix:
k8s-version: ["v1.27.0"]
descheduler-version: ["v0.27.0"]
descheduler-api: ["v1alpha1", "v1alpha2"]
manifest: ["deployment"]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Create kind cluster
uses: helm/kind-action@v1.5.0
with:
node_image: kindest/node:${{ matrix.k8s-version }}
kubectl_version: ${{ matrix.k8s-version }}
config: test/kind-config.yaml
- name: Build image
run: |
VERSION="dev" make dev-image
docker tag descheduler:dev registry.k8s.io/descheduler/descheduler:${{ matrix.descheduler-version }}
- name: Kind load image
run: |
kind load docker-image registry.k8s.io/descheduler/descheduler:${{ matrix.descheduler-version }} --name chart-testing
- name: Create k8s manifests
run: |
kubectl create -f kubernetes/base/rbac.yaml
kubectl create -f test/manifests/${{ matrix.descheduler-api }}/configmap.yaml
kubectl create -f kubernetes/${{ matrix.manifest }}/${{ matrix.manifest }}.yaml
- name: Wait for ready condition
run: |
kubectl wait --for=condition=Available --timeout=60s ${{ matrix.manifest }} descheduler -n kube-system
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.0
version: v3.7.0

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.1.0
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.19.3
FROM golang:1.20.3

WORKDIR /go/src/sigs.k8s.io/descheduler
COPY . .
Expand Down
603 changes: 342 additions & 261 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions charts/descheduler/Chart.yaml
@@ -1,7 +1,7 @@
apiVersion: v1
name: descheduler
version: 0.26.0
appVersion: 0.26.0
version: 0.27.0
appVersion: 0.27.0
description: Descheduler for Kubernetes is used to rebalance clusters by evicting pods that can potentially be scheduled on better nodes. In the current implementation, descheduler does not schedule replacement of evicted pods but relies on the default scheduler for that.
keywords:
- kubernetes
Expand Down
2 changes: 1 addition & 1 deletion charts/descheduler/templates/configmap.yaml
Expand Up @@ -7,6 +7,6 @@ metadata:
{{- include "descheduler.labels" . | nindent 4 }}
data:
policy.yaml: |
apiVersion: "descheduler/v1alpha1"
apiVersion: "{{ .Values.deschedulerPolicyAPIVersion }}"
kind: "DeschedulerPolicy"
{{ toYaml .Values.deschedulerPolicy | trim | indent 4 }}
8 changes: 1 addition & 7 deletions charts/descheduler/templates/cronjob.yaml
Expand Up @@ -81,13 +81,7 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 16 }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
{{- toYaml .Values.securityContext | nindent 16 }}
volumeMounts:
- mountPath: /policy-dir
name: policy-volume
Expand Down
8 changes: 1 addition & 7 deletions charts/descheduler/templates/deployment.yaml
Expand Up @@ -65,13 +65,7 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
{{- toYaml .Values.securityContext | nindent 12 }}
volumeMounts:
- mountPath: /policy-dir
name: policy-volume
Expand Down
13 changes: 13 additions & 0 deletions charts/descheduler/values.yaml
Expand Up @@ -22,6 +22,16 @@ resources:
# cpu: 100m
# memory: 128Mi

securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000

nameOverride: ""
fullnameOverride: ""

Expand Down Expand Up @@ -60,6 +70,9 @@ leaderElection: {}
cmdOptions:
v: 3

# Recommended to use the latest Policy API version supported by the Descheduler app version
deschedulerPolicyAPIVersion: "descheduler/v1alpha1"

deschedulerPolicy:
# nodeSelector: "key1=value1,key2=value2"
# maxNoOfPodsToEvictPerNode: 10
Expand Down
2 changes: 1 addition & 1 deletion cmd/descheduler/app/options/options.go
Expand Up @@ -90,7 +90,7 @@ func (rs *DeschedulerServer) AddFlags(fs *pflag.FlagSet) {
fs.Float32Var(&rs.ClientConnection.QPS, "client-connection-qps", rs.ClientConnection.QPS, "QPS to use for interacting with kubernetes apiserver.")
fs.Int32Var(&rs.ClientConnection.Burst, "client-connection-burst", rs.ClientConnection.Burst, "Burst to use for interacting with kubernetes apiserver.")
fs.StringVar(&rs.PolicyConfigFile, "policy-config-file", rs.PolicyConfigFile, "File with descheduler policy configuration.")
fs.BoolVar(&rs.DryRun, "dry-run", rs.DryRun, "execute descheduler in dry run mode.")
fs.BoolVar(&rs.DryRun, "dry-run", rs.DryRun, "Execute descheduler in dry run mode.")
fs.BoolVar(&rs.DisableMetrics, "disable-metrics", rs.DisableMetrics, "Disables metrics. The metrics are by default served through https://localhost:10258/metrics. Secure address, resp. port can be changed through --bind-address, resp. --secure-port flags.")

componentbaseoptions.BindLeaderElectionFlags(&rs.LeaderElection, fs)
Expand Down
8 changes: 4 additions & 4 deletions cmd/descheduler/app/server.go
Expand Up @@ -62,20 +62,20 @@ func NewDeschedulerCommand(out io.Writer) *cobra.Command {
klog.ErrorS(err, "failed to apply secure server configuration")
return
}
var factory registry.LogFormatFactory

var factory registry.LogFormatFactory
if s.Logging.Format == "json" {
factory = jsonLog.Factory{}
}

if factory == nil {
klog.ClearLogger()
} else {
log, logrFlush := factory.Create(registry.LoggingConfiguration{
log, loggerControl := factory.Create(registry.LoggingConfiguration{
Format: s.Logging.Format,
Verbosity: s.Logging.Verbosity,
})
defer logrFlush()
}, registry.LoggingOptions{})
defer loggerControl.Flush()
klog.SetLogger(log)
}

Expand Down
2 changes: 1 addition & 1 deletion docs/cli/descheduler.md
Expand Up @@ -20,7 +20,7 @@ descheduler [flags]
--client-connection-qps float32 QPS to use for interacting with kubernetes apiserver.
--descheduling-interval duration Time interval between two consecutive descheduler executions. Setting this value instructs the descheduler to run in a continuous loop at the interval specified.
--disable-metrics Disables metrics. The metrics are by default served through https://localhost:10258/metrics. Secure address, resp. port can be changed through --bind-address, resp. --secure-port flags.
--dry-run execute descheduler in dry run mode.
--dry-run Execute descheduler in dry run mode.
-h, --help help for descheduler
--http2-max-streams-per-connection int The limit that the server gives to clients for the maximum number of streams in an HTTP/2 connection. Zero means to use golang's default.
--kubeconfig string File with kube configuration. Deprecated, use client-connection-kubeconfig instead.
Expand Down