-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat(discovery): implement All Namespaces discovery #213
base: main
Are you sure you want to change the base?
Conversation
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 agree with cryostatio/cryostat-operator#976 (comment) here, this might introduce more elevated access than intended.
portNames: [] | ||
## @param core.discovery.kubernetes.builtInPortNumbersDisabled When false and `portNumbers` is empty, the Cryostat application will use the default port number `9091` to look for JMX connectable targets. | ||
builtInPortNumbersDisabled: false | ||
## @param core.discovery.kubernetes.portNumbers [array] List of port numbers that the Cryostat application should look for in order to consider a target as JMX connectable | ||
## @param core.discovery.kubernetes.portNumbers [array] List of port numbers that the Cryostat application should look for in order to consider a target as JMX connectable. |
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.
nit: we can remove the periods for consistency with other descriptions :D
@@ -75,15 +75,17 @@ core: | |||
enabled: true | |||
## @param core.discovery.kubernetes.installNamespaceDisabled When false and `namespaces` is empty, the Cryostat application will default to discovery targets in the install namespace (i.e. `{{ .Release.Namespace }}`) | |||
installNamespaceDisabled: false | |||
## @param core.discovery.kubernetes.namespaces [array] List of namespaces whose workloads the Cryostat application should be permitted to access and profile | |||
## @param core.discovery.kubernetes.allNamespaces When true, this overrides the `namespaces` list and configures Cryostat to monitor all namespaces in the cluster. This requires elevated permissions to create a ClusterRole and ClusterRoleBinding, which will be done automatically if the rbac.create value is true. WARNING: this allows Cryostat to discover, and potentially connect to and collect data from, applications in *any* Namespace in the cluster. ALL users with access to this Cryostat instance will be able to read data from potentially any application in the cluster. For data security and isolation concerns it is best to leave this setting disabled, and instead install multiple Cryostat instances with lists of target namespaces, and apply sensible access controls for users to each Cryostat instance as 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.
## @param core.discovery.kubernetes.allNamespaces When true, this overrides the `namespaces` list and configures Cryostat to monitor all namespaces in the cluster. This requires elevated permissions to create a ClusterRole and ClusterRoleBinding, which will be done automatically if the rbac.create value is true. WARNING: this allows Cryostat to discover, and potentially connect to and collect data from, applications in *any* Namespace in the cluster. ALL users with access to this Cryostat instance will be able to read data from potentially any application in the cluster. For data security and isolation concerns it is best to leave this setting disabled, and instead install multiple Cryostat instances with lists of target namespaces, and apply sensible access controls for users to each Cryostat instance as needed. | |
## @param core.discovery.kubernetes.allNamespaces When true, this overrides the `core.discovery.kubernetes.namespaces` list and configures the Cryostat application to monitor all namespaces in the cluster. This requires elevated permissions to create a ClusterRole and ClusterRoleBinding, which will be done automatically if the `rbac.create` value is `true`. WARNING: This allows Cryostat to discover, and potentially connect to and collect data from, applications in *any* Namespace in the cluster. ALL users with access to this Cryostat instance will be able to read data from potentially any application in the cluster. For data security and isolation concerns it is recommended to leave this setting disabled, and instead install multiple Cryostat instances with lists of target namespaces, and apply sensible access controls for users to each instance as needed. |
nit: just some formatting that I think will make a bit clearer :D I suggested the word recommended
to be consistent with other descriptions.
value: "true" | ||
{{- if .Values.core.discovery.kubernetes.allNamespaces }} | ||
- name: CRYOSTAT_DISCOVERY_KUBERNETES_NAMESPACES | ||
value: '*' | ||
{{- else }} | ||
{{- with .Values.core.discovery.kubernetes }} | ||
- name: CRYOSTAT_DISCOVERY_KUBERNETES_NAMESPACES | ||
value: {{ include "cryostat.commaSepList" (list .namespaces $.Release.Namespace .installNamespaceDisabled) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- with .Values.core.discovery.kubernetes }} | ||
- name: CRYOSTAT_DISCOVERY_KUBERNETES_PORT_NAMES | ||
value: {{ include "cryostat.commaSepList" (list .portNames "jfr-jmx" .builtInPortNamesDisabled) }} | ||
- name: CRYOSTAT_DISCOVERY_KUBERNETES_PORT_NUMBERS |
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.
nit: I think these configurations can be refactored in a single {{- with .Values.core.discovery.kubernetes }}
.
@@ -75,15 +75,17 @@ core: | |||
enabled: true | |||
## @param core.discovery.kubernetes.installNamespaceDisabled When false and `namespaces` is empty, the Cryostat application will default to discovery targets in the install namespace (i.e. `{{ .Release.Namespace }}`) | |||
installNamespaceDisabled: false | |||
## @param core.discovery.kubernetes.namespaces [array] List of namespaces whose workloads the Cryostat application should be permitted to access and profile | |||
## @param core.discovery.kubernetes.allNamespaces When true, this overrides the `namespaces` list and configures Cryostat to monitor all namespaces in the cluster. This requires elevated permissions to create a ClusterRole and ClusterRoleBinding, which will be done automatically if the rbac.create value is true. WARNING: this allows Cryostat to discover, and potentially connect to and collect data from, applications in *any* Namespace in the cluster. ALL users with access to this Cryostat instance will be able to read data from potentially any application in the cluster. For data security and isolation concerns it is best to leave this setting disabled, and instead install multiple Cryostat instances with lists of target namespaces, and apply sensible access controls for users to each Cryostat instance as needed. | |||
allNamespaces: false |
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.
nit: How about a field like (i.e. just feel a bit k8s-like, such as allowPrivilegeEscalation
, runAsNonRoot
)?
allowAllNamespaces: false
# or allNamespacesAllowed
Fixes #212
Depends on cryostatio/cryostat#725
To test:
cd cryostat-operator
for ns in apps1 apps2; do oc new-project $ns ; make sample_app ; done
oc new-project test
cd cryostat-helm
helm install cryostat --set core.image.repository=quay.io/andrewazores/cryostat --set core.image.tag=k8s-all-namespaces-7 cryostat ./charts/cryostat
this is an image built from feat(k8s): implement wildcard All Namespaces discovery cryostat#725