Skip to content

Commit

Permalink
Merge pull request #92 from knelasevero/desch-bump
Browse files Browse the repository at this point in the history
OCPBUGS-13579: WRKLDS-700: bump(k8s) to v0.27.1 (downstream descheduler)
  • Loading branch information
openshift-merge-robot committed May 14, 2023
2 parents 0b96aff + e7e92a8 commit e519ff6
Show file tree
Hide file tree
Showing 1,161 changed files with 66,421 additions and 26,710 deletions.
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

0 comments on commit e519ff6

Please sign in to comment.