Skip to content

Commit

Permalink
feat(lfc-scheduler): Move from Helm to Kustomize (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
mowies authored Sep 29, 2022
1 parent d7ce656 commit d7ba5f3
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 226 deletions.
23 changes: 23 additions & 0 deletions lfc-scheduler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ RELEASE_CONTROLLER_IMAGE:=controller:$(RELEASE_VERSION)
# v20200521-v0.18.800 - automated build for a tag
VERSION=$(shell echo $(RELEASE_VERSION) | awk -F - '{print $$2}')


## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7

## Tool Binaries
KUSTOMIZE ?= $(LOCALBIN)/kustomize
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"

.PHONY: all
all: build

Expand Down Expand Up @@ -84,6 +97,16 @@ vet: ## Run go vet against code.
test: fmt vet ## Run tests.
go test ./... -coverprofile cover.out

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
$(KUSTOMIZE): $(LOCALBIN)
test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }

.PHONY: release-manifests
release-manifests: kustomize
cd manifests/install && $(KUSTOMIZE) edit set image klfc-scheduler=$(RELEASE_REGISTRY)/$(RELEASE_IMAGE)
$(KUSTOMIZE) build manifests/install > config/rendered/release.yaml

.PHONY: local-image
local-image: clean
docker build --build-arg ARCH="amd64" --build-arg RELEASE_VERSION="$(RELEASE_VERSION)" -t $(LOCAL_REGISTRY)/$(LOCAL_IMAGE) .
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ kind: Deployment
metadata:
labels:
component: scheduler
name: {{ .Values.scheduler.name }}
namespace: {{ .Values.scheduler.namespace }}
name: keptn-scheduler
namespace: keptn-lifecycle-controller-system
spec:
selector:
matchLabels:
component: scheduler
replicas: {{ .Values.scheduler.replicaCount }}
replicas: 1
template:
metadata:
labels:
Expand All @@ -20,7 +20,7 @@ spec:
- command:
- /bin/kube-scheduler
- --config=/etc/kubernetes/scheduler-config.yaml
image: {{ .Values.scheduler.image }}
image: klfc-scheduler:latest
livenessProbe:
httpGet:
path: /healthz
Expand All @@ -35,7 +35,7 @@ spec:
scheme: HTTPS
resources:
requests:
cpu: '0.1'
cpu: '100m'
securityContext:
privileged: false
volumeMounts:
Expand All @@ -47,4 +47,4 @@ spec:
volumes:
- name: scheduler-config
configMap:
name: scheduler-config
name: scheduler-config
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ roleRef:
name: keptn-scheduler
subjects:
- kind: ServiceAccount
name: {{ .Values.scheduler.name }}
namespace: {{ .Values.scheduler.namespace }}
name: keptn-scheduler
namespace: keptn-lifecycle-controller-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand All @@ -94,5 +94,5 @@ roleRef:
name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
name: {{ .Values.scheduler.name }}
namespace: {{ .Values.scheduler.namespace }}
name: keptn-scheduler
namespace: keptn-lifecycle-controller-system
13 changes: 13 additions & 0 deletions lfc-scheduler/manifests/install/base/scheduler-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration
leaderElection:
leaderElect: false
profiles:
# Compose all plugins in one profile
- schedulerName: keptn-scheduler
plugins:
multiPoint:
enabled:
- name: "KLCPermit"
disabled: []
pluginConfig: {}
6 changes: 6 additions & 0 deletions lfc-scheduler/manifests/install/base/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: keptn-scheduler
namespace: keptn-lifecycle-controller-system

23 changes: 0 additions & 23 deletions lfc-scheduler/manifests/install/charts/keptn-scheduler/.helmignore

This file was deleted.

24 changes: 0 additions & 24 deletions lfc-scheduler/manifests/install/charts/keptn-scheduler/Chart.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions lfc-scheduler/manifests/install/charts/keptn-scheduler/README.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

37 changes: 0 additions & 37 deletions lfc-scheduler/manifests/install/charts/keptn-scheduler/values.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions lfc-scheduler/manifests/install/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
resources:
- base/deployment.yaml
- base/rbac.yaml
- base/serviceaccount.yaml

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- files:
- base/scheduler-config.yaml
name: scheduler-config

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: klfc-scheduler
newName: ghcr.io/keptn-sandbox/lfc-scheduler
newTag: latest

0 comments on commit d7ba5f3

Please sign in to comment.