-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
112 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
parameters: | ||
openshift4_keepalived: | ||
=_metadata: {} | ||
namespace: syn-openshift4-keepalived | ||
namespace: openshift-operator-community | ||
channel: alpha | ||
keepalived_groups: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
// main template for openshift4-keepalived | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local kube = import 'lib/kube.libjsonnet'; | ||
local com = import 'lib/commodore.libjsonnet'; | ||
local operatorlib = import 'lib/openshift4-operators.libsonnet'; | ||
local inv = kap.inventory(); | ||
// The hiera parameters for the component | ||
local params = inv.parameters.openshift4_keepalived; | ||
|
||
// Define outputs below | ||
local keepalived_groups = std.filter( | ||
function(it) it != null, | ||
[ | ||
local formated_name = kube.hyphenate(keepalived_object); | ||
local keepalived_group = params.keepalived_groups[keepalived_object]; | ||
if keepalived_group != null then | ||
kube._Object('redhatcop.redhat.io/v1alpha1', 'KeepalivedGroup', formated_name) { | ||
metadata+: { | ||
namespace: params.namespace, | ||
}, | ||
} + com.makeMergeable(keepalived_group) | ||
for keepalived_object in std.objectFields(params.keepalived_groups) | ||
] | ||
); | ||
|
||
{ | ||
'00_operator_group': operatorlib.OperatorGroup('cluster-keepalived') { | ||
metadata+: { | ||
namespace: params.namespace, | ||
}, | ||
}, | ||
'10_subscription': operatorlib.namespacedSubscription( | ||
params.namespace, | ||
'keepalived-operator', | ||
params.channel, | ||
'community-operators' | ||
), | ||
[if std.length(keepalived_groups) > 0 then '20_keepalived_groups']: keepalived_groups, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# Overwrite parameters here | ||
|
||
# parameters: {...} | ||
applications: | ||
- openshift4-operators as openshift-operators-redhat | ||
parameters: | ||
openshift4_operators: | ||
namespace: openshift-operators-redhat | ||
defaultInstallPlanApproval: Automatic | ||
defaultSourceNamespace: openshift-marketplace | ||
defaultSource: redhat-operators | ||
openshift4_keepalived: | ||
namespace: openshift-operator-community | ||
channel: alpha | ||
keepalived_groups: | ||
group_1: | ||
spec: | ||
image: registry.redhat.io/openshift4/ose-keepalived-ipfailover | ||
interface: ens3 | ||
nodeSelector: | ||
node-role.kubernetes.io/loadbalancer: "" | ||
blacklistRouterIDs: | ||
- 1 | ||
- 2 | ||
group_2: | ||
spec: | ||
image: registry.redhat.io/openshift4/ose-keepalived-ipfailover | ||
interface: ens4 | ||
nodeSelector: | ||
node-role.kubernetes.io/nodeport: "" | ||
blacklistRouterIDs: | ||
- 3 | ||
- 4 | ||
group_3: null | ||
kapitan: | ||
dependencies: | ||
- type: https | ||
source: https://raw.githubusercontent.com/appuio/component-openshift4-operators/master/lib/openshift4-operators.libsonnet | ||
output_path: vendor/lib/openshift4-operators.libsonnet |