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

poc: scheduling gates beta verison #1249

Closed
wants to merge 14 commits into from
Closed
9 changes: 2 additions & 7 deletions .github/actions/deploy-klt-on-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ inputs:
required: false
description: "Version of kind that should be used"
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
default: "v0.17.0"
default: "v0.18.0"
k8s-version:
required: false
description: "Kubernetes that should be used"
# renovate: datasource=github-releases depName=kubernetes/kubernetes
default: "v1.25.3"
default: "v1.27.1"
functions_runtime_tag:
description: "Tag for the functions runner image"
required: true
Expand Down Expand Up @@ -74,10 +74,6 @@ runs:
kubectl apply -f ~/download/artifacts/metrics-operator-manifest-test
kubectl rollout status deployment metrics-operator -n keptn-lifecycle-toolkit-system -w

sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' ~/download/artifacts/scheduler-manifest-test/release.yaml
kubectl apply -f ~/download/artifacts/scheduler-manifest-test
kubectl rollout status deployment scheduler -n keptn-lifecycle-toolkit-system -w
kubectl rollout status deployment lifecycle-operator -n keptn-lifecycle-toolkit-system -w

- name: Install lifecycle-toolkit with helm
if: ${{ inputs.helm-install == 'true' }}
Expand All @@ -86,7 +82,6 @@ runs:
echo "Installing KLT using helm"
helm version
helm install -n keptn-lifecycle-toolkit-system --create-namespace toolkit ~/download/artifacts/keptn-lifecycle-toolkit.tgz \
--set scheduler.scheduler.imagePullPolicy=Never \
--set lifecycleOperator.manager.imagePullPolicy=Never \
--set metricsOperator.manager.imagePullPolicy=Never \
--set lifecycleOperator.manager.env.functionRunnerImage=localhost:5000/keptn/functions-runtime:${{ inputs.functions_runtime_tag }} \
Expand Down
3 changes: 0 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ documentation:
operator:
- operator/**/*

scheduler:
- scheduler/**/*

metrics-operator:
- metrics-operator/**/*

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ jobs:
folder: "operator/"
- name: "metrics-operator"
folder: "metrics-operator/"
- name: "scheduler"
folder: "scheduler/"
- name: "certificate-operator"
folder: "klt-cert-manager/"
steps:
Expand Down Expand Up @@ -121,8 +119,6 @@ jobs:
folder: "operator/"
- name: "metrics-operator"
folder: "metrics-operator/"
- name: "scheduler"
folder: "scheduler/"
- name: "functions-runtime"
folder: "functions-runtime/"
- name: "certificate-operator"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
config:
- name: "lifecycle-operator"
folder: "operator/"
- name: "scheduler"
folder: "scheduler/"

steps:
- name: Check out code
uses: actions/checkout@v3
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
folder: "operator/"
- name: "metrics-operator"
folder: "metrics-operator/"
- name: "scheduler"
folder: "scheduler/"
- name: "certificate-operator"
folder: "klt-cert-manager/"
steps:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/helm-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ jobs:
folder: "operator/"
- name: "metrics-operator"
folder: "metrics-operator/"
- name: "scheduler"
folder: "scheduler/"
- name: "functions-runtime"
folder: "functions-runtime/"
- name: "certificate-operator"
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ jobs:
folder: "operator/"
- name: "metrics-operator"
folder: "metrics-operator/"
- name: "scheduler"
folder: "scheduler/"
- name: "functions-runtime"
folder: "functions-runtime/"
- name: "certificate-operator"
Expand Down Expand Up @@ -141,13 +139,6 @@ jobs:
path: ./operator/bin
key: build-tools-${{ github.ref_name }}

- name: Cache build tools scheduler
id: cache-build-tools-scheduler
uses: actions/cache@v3
with:
path: ./scheduler/bin
key: build-tools-${{ github.ref_name }}

- name: Cache build tools cert-manager
id: cache-build-tools-klt-cert-manager
uses: actions/cache@v3
Expand All @@ -165,8 +156,6 @@ jobs:
RELEASE_REGISTRY: ghcr.keptn.sh/keptn
CHART_APPVERSION: ${{ needs.release-please.outputs.tag_name }}
run: |
cd scheduler
make release-manifests
cd ../operator
make controller-gen release-manifests
cd ../klt-cert-manager
Expand All @@ -175,7 +164,6 @@ jobs:
make controller-gen release-manifests
cd ..
echo "---" >> operator/config/rendered/release.yaml
echo "---" >> scheduler/config/rendered/release.yaml
echo "---" >> klt-cert-manager/config/rendered/release.yaml
cat >> namespace.yaml << EOF
---
Expand All @@ -187,7 +175,6 @@ jobs:
EOF
cat namespace.yaml \
operator/config/rendered/release.yaml \
scheduler/config/rendered/release.yaml \
klt-cert-manager/config/rendered/release.yaml \
metrics-operator/config/rendered/release.yaml > manifest.yaml

Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/security-scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,13 @@ jobs:
sed -i 's/\- ..\/crd//' kustomization.yaml && kustomize build ./ > /tmp/metrics-operator-manifest.yaml
echo "---" >> /tmp/crds.yaml
cd ../crd && kustomize build ./ >> /tmp/crds.yaml
cd ../../../scheduler/manifests/install && kustomize build ./ > /tmp/scheduler-manifest.yaml

curl -s https://raw.githubusercontent.com/yannh/kubeconform/${{ matrix.version }}/scripts/openapi2jsonschema.py > /tmp/openapi2jsonschema.py
mkdir -p /tmp/schema && cd /tmp/schema
python3 ../openapi2jsonschema.py ../crds.yaml
cd .. && \
echo "---" >> operator-manifest.yaml && \
echo "---" >> scheduler-manifest.yaml && \
cat operator-manifest.yaml scheduler-manifest.yaml metrics-operator-manifest.yaml > manifest.yaml
cat operator-manifest.yaml metrics-operator-manifest.yaml > manifest.yaml
kubeconform \
-schema-location default \
-schema-location './schema/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json' \
Expand Down Expand Up @@ -194,7 +192,6 @@ jobs:
- "functions-runtime"
- "lifecycle-operator"
- "metrics-operator"
- "scheduler"
- "certificate-operator"
steps:
- name: Download images
Expand All @@ -220,7 +217,6 @@ jobs:
artifact:
- "operator"
- "metrics-operator"
- "scheduler"
- "klt-cert-manager"

steps:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/validate-semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
deps
scopes: |
helm-chart
scheduler
operator
cert-manager
metrics-operator
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ kubeconfig
.dccache*

manifests/
/scheduler/config/rendered/release.yaml
/operator/config/rendered/release.yaml
/metrics-operator/config/rendered/release.yaml
/klt-cert-manager/config/rendered/release.yaml
Expand Down
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ build-release-manifests:
$(MAKE) -C metrics-operator generate

$(MAKE) -C operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH) CHART_APPVERSION=$(CHART_APPVERSION)
$(MAKE) -C scheduler release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH) CHART_APPVERSION=$(CHART_APPVERSION)
$(MAKE) -C klt-cert-manager release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH) CHART_APPVERSION=$(CHART_APPVERSION)
$(MAKE) -C metrics-operator release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG) ARCH=$(ARCH) CHART_APPVERSION=$(CHART_APPVERSION)

Expand All @@ -110,14 +109,6 @@ build-deploy-metrics-operator:

kubectl apply -f metrics-operator/config/rendered/release.yaml

.PHONY: build-deploy-scheduler
build-deploy-scheduler:
$(MAKE) -C scheduler release-local.$(ARCH) RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C scheduler push-local RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
$(MAKE) -C scheduler release-manifests RELEASE_REGISTRY=$(RELEASE_REGISTRY) CHART_APPVERSION=$(TAG) ARCH=$(ARCH)
kubectl create namespace keptn-lifecycle-toolkit-system --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f scheduler/config/rendered/release.yaml

.PHONY: build-deploy-certmanager
build-deploy-certmanager:
$(MAKE) -C klt-cert-manager release-local.$(ARCH) RELEASE_REGISTRY=$(RELEASE_REGISTRY) TAG=$(TAG)
Expand All @@ -127,7 +118,7 @@ build-deploy-certmanager:
kubectl apply -f klt-cert-manager/config/rendered/release.yaml

.PHONY: build-deploy-dev-environment
build-deploy-dev-environment: build-deploy-certmanager build-deploy-operator build-deploy-metrics-operator build-deploy-scheduler
build-deploy-dev-environment: build-deploy-certmanager build-deploy-operator build-deploy-metrics-operator


include docs/Makefile
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ When the webhook receives a request for a new pod, it will look for the workload
keptn.sh/workload: "some-workload-name"
```

The mutation consists in changing the scheduler used for the deployment with the Keptn Scheduler.
The mutation consists in gating the deployment or pod so that the kubernetes Scheduler will not yet deploy them.
Webhook then creates a
workload and app resource per annotated resource.
You can also specify a custom app definition with the annotation:
Expand Down Expand Up @@ -252,7 +252,7 @@ and for the Evaluations:
After either one of those actions has been taken, the webhook will set the scheduler of the pod and allow the pod to be
scheduled.

### Scheduler
### Scheduler ##TODO

After the Webhook mutation, the Keptn-Scheduler will handle the annotated resources.
The scheduling flow follows the
Expand Down Expand Up @@ -512,8 +512,7 @@ The [GitHub CLI](https://cli.github.com/) can be used to download the manifests
```bash
gh run list --repo keptn/lifecycle-toolkit # find the id of a run
gh run download 3152895000 --repo keptn/lifecycle-toolkit # download the artifacts
kubectl apply -f ./keptn-lifecycle-operator-manifest/release.yaml # install the operator
kubectl apply -f ./scheduler-manifest/release.yaml # install the scheduler
kubectl apply -f ./keptn-lifecycle-operator-manifest/release.yaml # install the operators
```

Instead, if you want to build and deploy the operator into your cluster directly from the code, you can type:
Expand Down
4 changes: 0 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ flags:
paths:
- operator/
carryforward: true
scheduler:
paths:
- scheduler/
carryforward: true
component-tests:
paths:
- operator/
Expand Down
3 changes: 1 addition & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,5 @@ restart-lifecycle-toolkit:
@echo "----------------------------------"
kubectl rollout restart deployment -n "$(TOOLKIT_NAMESPACE)" -l control-plane=lifecycle-operator
kubectl rollout status deployment -n "$(TOOLKIT_NAMESPACE)" -l control-plane=lifecycle-operator --watch
kubectl rollout restart deployment -n "$(TOOLKIT_NAMESPACE)" -l component=scheduler
kubectl rollout status deployment -n "$(TOOLKIT_NAMESPACE)" -l component=scheduler --watch


58 changes: 29 additions & 29 deletions klt-cert-manager/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,68 +8,68 @@ require (
github.com/pkg/errors v0.9.1
github.com/spf13/afero v1.9.5
github.com/stretchr/testify v1.8.2
k8s.io/api v0.26.4
k8s.io/apiextensions-apiserver v0.26.4
k8s.io/apimachinery v0.26.4
k8s.io/client-go v0.26.4
sigs.k8s.io/controller-runtime v0.14.6
k8s.io/api v0.27.1
k8s.io/apiextensions-apiserver v0.27.1
k8s.io/apimachinery v0.27.1
k8s.io/client-go v0.27.1
sigs.k8s.io/controller-runtime v0.15.0-alpha.0.0.20230516163936-76865b275fbd
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/client_golang v1.15.1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.26.4 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
k8s.io/component-base v0.27.1 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace golang.org/x/net => golang.org/x/net v0.9.0
replace sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.15.0-alpha.0.0.20230516163936-76865b275fbd
Loading
Loading