-
Notifications
You must be signed in to change notification settings - Fork 0
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
Run elasticsearch operator on infra nodes #44
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,25 @@ | ||
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 deploymentToPatch = kube._Object('apps/v1', 'Deployment', params.elasticsearchOperator.patchTarget.name) { | ||
metadata+: { | ||
namespace: params.elasticsearchOperator.patchTarget.namespace, | ||
}, | ||
}; | ||
|
||
local patch = resourceLocker.Patch(deploymentToPatch, { | ||
spec: { | ||
template: { | ||
spec: params.elasticsearchOperator.patch, | ||
}, | ||
}, | ||
}); | ||
|
||
{ | ||
'40_deployment_patch': patch, | ||
} |
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
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
97 changes: 97 additions & 0 deletions
97
tests/golden/defaults/openshift4-logging/openshift4-logging/32_kibana_host.yaml
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,97 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
name: kibana-manager | ||
name: kibana-manager | ||
namespace: syn-resource-locker | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
name: syn-resource-locker-kibana-manager | ||
name: syn-resource-locker-kibana-manager | ||
rules: | ||
- apiGroups: | ||
- route.openshift.io | ||
resources: | ||
- routes | ||
verbs: | ||
- list | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
labels: | ||
name: syn-resource-locker-kibana-manager | ||
name: syn-resource-locker-kibana-manager | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: syn-resource-locker-kibana-manager | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kibana-manager | ||
namespace: syn-resource-locker | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
labels: | ||
name: syn-resource-locker-kibana-manager | ||
name: syn-resource-locker-kibana-manager | ||
namespace: openshift-logging | ||
rules: | ||
- apiGroups: | ||
- route.openshift.io | ||
resources: | ||
- routes | ||
verbs: | ||
- get | ||
- patch | ||
- apiGroups: | ||
- route.openshift.io | ||
resources: | ||
- routes/custom-host | ||
verbs: | ||
- '*' | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
labels: | ||
name: syn-resource-locker-kibana-manager | ||
name: syn-resource-locker-kibana-manager | ||
namespace: openshift-logging | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: syn-resource-locker-kibana-manager | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kibana-manager | ||
namespace: syn-resource-locker | ||
--- | ||
apiVersion: redhatcop.redhat.io/v1alpha1 | ||
kind: ResourceLocker | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
labels: | ||
name: openshift-logging-kibana | ||
name: openshift-logging-kibana | ||
namespace: syn-resource-locker | ||
spec: | ||
patches: | ||
- id: patch1 | ||
patchTemplate: "\"spec\":\n \"host\": \"kibana.example.com\"" | ||
patchType: application/strategic-merge-patch+json | ||
targetObjectRef: | ||
apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
name: kibana | ||
namespace: openshift-logging | ||
serviceAccountRef: | ||
name: kibana-manager |
92 changes: 92 additions & 0 deletions
92
tests/golden/defaults/openshift4-logging/openshift4-logging/40_deployment_patch.yaml
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,92 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
name: elasticsearch-operator-manager | ||
name: elasticsearch-operator-manager | ||
namespace: syn-resource-locker | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
rules: | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
verbs: | ||
- list | ||
- watch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
labels: | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
subjects: | ||
- kind: ServiceAccount | ||
name: elasticsearch-operator-manager | ||
namespace: syn-resource-locker | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
labels: | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
namespace: openshift-operators-redhat | ||
rules: | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
verbs: | ||
- get | ||
- patch | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
labels: | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
namespace: openshift-operators-redhat | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: syn-resource-locker-elasticsearch-operator-manager | ||
subjects: | ||
- kind: ServiceAccount | ||
name: elasticsearch-operator-manager | ||
namespace: syn-resource-locker | ||
--- | ||
apiVersion: redhatcop.redhat.io/v1alpha1 | ||
kind: ResourceLocker | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
labels: | ||
name: openshift-operators-redhat-elasticsearch-operator | ||
name: openshift-operators-redhat-elasticsearch-operator | ||
namespace: syn-resource-locker | ||
spec: | ||
patches: | ||
- id: patch1 | ||
patchTemplate: "\"spec\":\n \"template\":\n \"spec\":\n \"nodeSelector\"\ | ||
:\n \"node-role.kubernetes.io/infra\": \"\"" | ||
patchType: application/strategic-merge-patch+json | ||
targetObjectRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: elasticsearch-operator | ||
namespace: openshift-operators-redhat | ||
serviceAccountRef: | ||
name: elasticsearch-operator-manager |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should address scheduling of operator pods which are managed through component openshift4-operators in that component (https://github.com/appuio/component-openshift4-operators) and not in the components which make use of component openshift4-operators.
I'd suggest to simply set the
openshift.io/node-selector: node-role.kubernetes.io/infra=
annotation on the namespaces managed by that component.Alternatively the component library of component openshift4-operators could support configuring deployment patches, but I don't think that's actually necessary in this case, since we'll always want all operators to run on the infra nodes, if there are any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my first instinct too. But i found the
openshift.io/node-selector
annotation already explicitly set to empty.But I'm unsure if this is really needed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I copied that from the official instructions, cf. https://docs.openshift.com/container-platform/4.9/logging/cluster-logging-deploying.html#cluster-logging-deploy-cli_cluster-logging-deploying but I don't see how that's necessary unless some operators need to run on the control plane nodes.
I'd propose to go ahead and change the annotation in that component, since there's no real reason for the operator deployments themselves to run on specific nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 makes for a way simpler change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the even bigger upside is that we don't need to copy-paste this change to any component which installs an operator via the openshift4-operators component library.