Skip to content

Commit

Permalink
feat: (Dont) support PodDisruptionBudgets
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Oct 6, 2023
1 parent 9039254 commit 30d1922
Show file tree
Hide file tree
Showing 9 changed files with 400 additions and 419 deletions.
765 changes: 354 additions & 411 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
snafu = "0.7"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.46.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.52.0" }
strum = { version = "0.25", features = ["derive"] }
tokio = { version = "1.29", features = ["full"] }
tracing = "0.1"
Expand Down
16 changes: 16 additions & 0 deletions deploy/helm/opa-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,8 @@ spec:
type: string
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down Expand Up @@ -1497,6 +1499,8 @@ spec:
type: string
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down Expand Up @@ -2030,6 +2034,8 @@ spec:
type: string
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down Expand Up @@ -3037,6 +3043,10 @@ spec:
type: array
type: object
type: object
roleConfig:
default: {}
description: This is a product-agnostic RoleConfig, with nothing in it. It is used e.g. by products that have nothing configurable at role level.
type: object
roleGroups:
additionalProperties:
properties:
Expand Down Expand Up @@ -3898,6 +3908,8 @@ spec:
type: string
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down Expand Up @@ -4425,6 +4437,8 @@ spec:
type: string
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down Expand Up @@ -4958,6 +4972,8 @@ spec:
type: string
type: object
type: object
restartPolicy:
type: string
securityContext:
properties:
allowPrivilegeEscalation:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
= Cluster Operation

OPA installations can be configured with different cluster operations like pausing reconciliation or stopping the cluster. See xref:concepts:cluster_operations.adoc[cluster operations] for more details.
OPA installations can be configured with different cluster operations like pausing reconciliation or stopping the cluster. See xref:concepts:operations/cluster_operations.adoc[cluster operations] for more details.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
= Graceful shutdown

Graceful shutdown of OPA nodes is either not supported by the product itself
or we have not implemented it yet.

Outstanding implementation work for the graceful shutdowns of all products where this functionality is relevant is tracked in
https://github.com/stackabletech/issues/issues/357
6 changes: 6 additions & 0 deletions docs/modules/opa/pages/usage-guide/operations/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

= Operations

This section of the documentation is intended for the operations teams that maintain a Stackable Data Platform installation.

Please read the xref:concepts:operations/index.adoc[Concepts page on Operations] that contains the necessary details to operate the platform in a production environment.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
= Allowed Pod disruptions

For OPA clusters we don't deploy any PodDisruptionBudgets (PDBs), as there is one instance per Kubernetes node running.
When a Kubernetes node gets drained to gracefully shut it down, the OPA Pod get's evicted - there is no point in blocking the eviction.
In case the OPA Pod terminated before the products depending on OPA (e.g. Trino coordinator) on the same node, the products can still use the OPA Service, as it will route to OPA Pods running on other Kubernetes nodes.
10 changes: 7 additions & 3 deletions docs/modules/opa/partials/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
** xref:opa:getting_started/first_steps.adoc[]
* Concepts
** xref:opa:discovery.adoc[]
* xref:opa:configuration.adoc[]
* xref:opa:implementation-notes.adoc[]
* xref:opa:usage-guide/index.adoc[]
** xref:opa:usage-guide/cluster-operations.adoc[]
** xref:opa:usage-guide/listenerclass.adoc[]
** xref:opa:usage-guide/policies.adoc[]
** xref:opa:usage-guide/resources.adoc[]
** xref:opa:usage-guide/logging.adoc[]
** xref:opa:usage-guide/monitoring.adoc[]
** xref:opa:usage-guide/configuration-environment-overrides.adoc[]
* xref:opa:configuration.adoc[]
* xref:opa:implementation-notes.adoc[]
** xref:hdfs:usage-guide/operations/index.adoc[]
*** xref:hdfs:usage-guide/operations/cluster-operations.adoc[]
// *** xref:hdfs:usage-guide/operations/pod-placement.adoc[] Missing
*** xref:hdfs:usage-guide/operations/pod-disruptions.adoc[]
*** xref:hdfs:usage-guide/operations/graceful-shutdown.adoc[]
6 changes: 3 additions & 3 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use stackable_operator::{
product_config_utils::{ConfigError, Configuration},
product_logging::{self, spec::Logging},
role_utils::Role,
role_utils::{RoleGroup, RoleGroupRef},
role_utils::{EmptyRoleConfig, RoleGroup, RoleGroupRef},
schemars::{self, JsonSchema},
status::condition::{ClusterCondition, HasStatusCondition},
};
Expand Down Expand Up @@ -65,7 +65,7 @@ pub struct OpaSpec {
#[serde(default)]
pub cluster_operation: ClusterOperation,
/// OPA server configuration.
pub servers: Role<OpaConfigFragment>,
pub servers: Role<OpaConfigFragment, EmptyRoleConfig>,
/// The OPA image to use
pub image: ProductImage,
}
Expand Down Expand Up @@ -245,7 +245,7 @@ pub enum OpaRole {

impl OpaCluster {
/// Returns a reference to the role.
pub fn role(&self, role_variant: &OpaRole) -> &Role<OpaConfigFragment> {
pub fn role(&self, role_variant: &OpaRole) -> &Role<OpaConfigFragment, EmptyRoleConfig> {
match role_variant {
OpaRole::Server => &self.spec.servers,
}
Expand Down

0 comments on commit 30d1922

Please sign in to comment.