Skip to content

Commit 49d985a

Browse files
authored
Merge pull request #1 from appuio/init
Initial implementation
2 parents 98c8d82 + 61a3f66 commit 49d985a

File tree

9 files changed

+68
-10
lines changed

9 files changed

+68
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88
### Added
99

10-
-
10+
- Initial implementation ([#1])
1111

12-
[Unreleased]: https://github.com/appuio/component-openshift4-scheduling/compare/v0.1.0...HEAD
12+
[Unreleased]: https://github.com/appuio/component-openshift4-scheduling/compare/98c8d825204617f3b65ee72f3611c8142773acf2...HEAD
13+
14+
[#1]: https://github.com/appuio/component-openshift4-scheduling/pull/1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Commodore Component: OpenShift4 Scheduler
22

3-
This is a [Commodore][commodore] Component for OpenShift4 Scheduler.
3+
This is a [Commodore][commodore] Component to configure OpenShift4 schedulers.
44

55
This repository is part of Project Syn.
66
For documentation on Project Syn and this component, see https://syn.tools.

class/defaults.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
parameters:
22
openshift4_scheduling:
3-
namespace: syn-openshift4-scheduling
3+
namespace: openshift-kube-scheduler
4+
schedulers:
5+
cluster:
6+
mastersSchedulable: false
7+
defaultNodeSelector: node-role.kubernetes.io/app=

component/app.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local inv = kap.inventory();
33
local params = inv.parameters.openshift4_scheduling;
44
local argocd = import 'lib/argocd.libjsonnet';
55

6-
local app = argocd.App('openshift4-scheduling', params.namespace);
6+
local app = argocd.App('openshift4-scheduling', params.namespace, secrets=false);
77

88
{
99
'openshift4-scheduling': app,

component/main.jsonnet

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
// main template for openshift4-scheduling
21
local kap = import 'lib/kapitan.libjsonnet';
32
local kube = import 'lib/kube.libjsonnet';
43
local inv = kap.inventory();
5-
// The hiera parameters for the component
64
local params = inv.parameters.openshift4_scheduling;
75

8-
// Define outputs below
6+
local schedulers =
7+
if params.schedulers != null
8+
then std.objectFields(params.schedulers)
9+
else [];
10+
911
{
12+
[name]:
13+
kube._Object('config.openshift.io/v1', 'Scheduler', name) {
14+
spec: params.schedulers[name],
15+
}
16+
for name in schedulers
17+
} + {
18+
[if std.length(schedulers) == 0 then '.gitkeep']: {},
1019
}

docs/modules/ROOT/pages/index.adoc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1-
= OpenShift4 Scheduler: A Commodore component to manage OpenShift4 Scheduler
1+
= OpenShift4 Scheduling: A Commodore component to manage OpenShift4 cluster schedulers
22

3-
{doctitle} is a Commodore component for Managing OpenShift4 Scheduler.
3+
{doctitle} is a Commodore component for Managing https://docs.openshift.com/container-platform/4.5/nodes/scheduling/nodes-scheduler-about.html[OpenShift4 cluster schedulers].
4+
5+
== Default Node Selector
6+
7+
This components assumes dedicated infra nodes are used.
8+
The component further assumes the existence of an _app_ node role.
9+
This is required to prevent regular workload from being scheduled on those infra nodes.
10+
11+
[IMPORTANT]
12+
====
13+
Ensure that the target cluster does have nodes with the _app_ role label set.
14+
See the components defaults for the exact value.
15+
====

docs/modules/ROOT/pages/references/.gitkeep

Whitespace-only changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
= Parameters
2+
3+
The parent key for all of the following parameters is `openshift4_scheduling`.
4+
5+
6+
== `schedulers`
7+
8+
[horizontal]
9+
type:: dictionary
10+
default:: Default `cluster` scheduler.
11+
12+
A dictionary holding the `.spec` for schedulers.
13+
The keys of the dict are used as names for the schedulers.
14+
15+
See the https://docs.openshift.com/container-platform/latest/nodes/scheduling/nodes-scheduler-default.html#nodes-scheduler-default[OpenShift docs] for available parameters.
16+
17+
To unset all scheduling configurations, set to `null`.
18+
19+
NOTE: This will make the scheduling unmanaged but will not reset them to OpenShift defaults.
20+
21+
22+
== Example
23+
24+
[source,yaml]
25+
----
26+
schedulers:
27+
cluster:
28+
mastersSchedulable: true
29+
defaultNodeSelector: node-role.kubernetes.io/worker=''
30+
----

docs/modules/ROOT/partials/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* xref:index.adoc[Home]
2+
* xref:references/parameters.adoc[Parameters]

0 commit comments

Comments
 (0)