-
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.
Allow setting custom kibana host (#34)
* Allow setting custom kibana host * Document kibana_host parameter * Set default for kibana_host * Allow RL to set host
- Loading branch information
Showing
4 changed files
with
59 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
local common = import 'common.libsonnet'; | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local kube = import 'lib/kube.libjsonnet'; | ||
local resourceLocker = import 'lib/resource-locker.libjsonnet'; | ||
local inv = kap.inventory(); | ||
// The hiera parameters for the component | ||
local params = inv.parameters.openshift4_logging; | ||
|
||
local routeToPatch = kube._Object('route.openshift.io/v1', 'Route', 'kibana') { | ||
metadata+: { | ||
namespace: params.namespace, | ||
}, | ||
}; | ||
|
||
local patch = resourceLocker.Patch(routeToPatch, { | ||
spec: { | ||
host: params.kibana_host, | ||
}, | ||
}); | ||
|
||
// OpenShift has custom RBAC permissions on routes if you want to set a host ┻━┻︵ヽ(`Д´)ノ︵ ┻━┻ | ||
local patchWithAdditionalPermissions = std.map( | ||
function(obj) | ||
if obj.apiVersion == 'rbac.authorization.k8s.io/v1' && obj.kind == 'Role' then | ||
obj { | ||
rules+: [ | ||
{ | ||
apiGroups: [ | ||
'route.openshift.io', | ||
], | ||
resources: [ | ||
'routes/custom-host', | ||
], | ||
verbs: [ | ||
'*', | ||
], | ||
}, | ||
], | ||
} | ||
else | ||
obj | ||
, patch | ||
); | ||
|
||
{ | ||
[if params.kibana_host != null then '32_kibana_host']: patchWithAdditionalPermissions, | ||
} |
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