diff --git a/README.md b/README.md index 1c1a62f..0ec1d46 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,18 @@ status: ``` +## Bootstrapping the EFK Stack + +The following components were deployed in the previous sections to deploy a basic EFK stack. + +* A _Namespace_ called `openshift-logging` +* A _Namespace_ called `openshift-operators-redhat` +* An _OperatorGroup_ for the cluster-logging-operator +* A _Subscription_ that subscribes the `openshift-logging` namespace with the OLM for the cluster-logging-operator +* An _OperatorGroup_ for the elasticsearch-operator +* A _Subscription_ that subscribes the `openshift-opeartors-redhat` namespace with the OLM for the elasticsearch operator +* A _ClusterLogging_ called instance that deploys an ephemeral EFK stack consisting of an elasticsearch cluster, fluentd forwarders, and a kibana deployment + ## Managing Operators Operators are a foundational component of the architecture of OpenShift, and the lifecycle of operators are managed by the [Operator Lifeycle Manager (OLM)](https://docs.openshift.com/container-platform/latest/operators/understanding_olm/olm-understanding-olm.html). As illustrated in a portion of the prior examples, an operator managed by the OLM is enabled in one or more namespaces by an [OperatorGroup](https://docs.openshift.com/container-platform/latest/operators/understanding_olm/olm-understanding-olm.html#olm-operatorgroups-about_olm-understanding-olm) and the intention to install an operator is enabled using a [Subscription](https://docs.openshift.com/container-platform/latest/operators/understanding_olm/olm-understanding-olm.html#olm-subscription_olm-understanding-olm). A subscription defines the source of the operator including the namespace, catalog and can contain the specific ClusterServiceVersion that is intended to be installed. The OLM will then create an associated [InstallPlan](https://docs.openshift.com/container-platform/4.5/operators/understanding_olm/olm-understanding-olm.html#olm-installplan_olm-understanding-olm) which includes the set of resources that wil be installed in association with the operator. @@ -273,4 +285,4 @@ metadata: annotations: argocd.argoproj.io/hook: Sync argocd.argoproj.io/hook-delete-policy: BeforeHookCreation -``` \ No newline at end of file +``` diff --git a/simple-bootstrap/0-namespaces/openshift-logging.yaml b/simple-bootstrap/0-namespaces/openshift-logging.yaml new file mode 100644 index 0000000..3e693c8 --- /dev/null +++ b/simple-bootstrap/0-namespaces/openshift-logging.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + annotations: + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + openshift.io/node-selector: "" + labels: + config.example.com/name: simple-bootstrap + config.example.com/component: namespaces + openshift.io/cluster-monitoring: "true" + name: openshift-logging +spec: diff --git a/simple-bootstrap/0-namespaces/openshift-operators-redhat.yaml b/simple-bootstrap/0-namespaces/openshift-operators-redhat.yaml new file mode 100644 index 0000000..1db31fc --- /dev/null +++ b/simple-bootstrap/0-namespaces/openshift-operators-redhat.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + annotations: + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + openshift.io/node-selector: "" + labels: + config.example.com/name: simple-bootstrap + config.example.com/component: namespaces + openshift.io/cluster-monitoring: "true" + name: openshift-operators-redhat +spec: diff --git a/simple-bootstrap/1-operators/cluster-logging-operator.yaml b/simple-bootstrap/1-operators/cluster-logging-operator.yaml new file mode 100644 index 0000000..f961e27 --- /dev/null +++ b/simple-bootstrap/1-operators/cluster-logging-operator.yaml @@ -0,0 +1,33 @@ +--- +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + annotations: + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + labels: + config.example.com/name: simple-bootstrap + config.example.com/component: operators + name: openshift-logging + namespace: openshift-logging +spec: + targetNamespaces: + - openshift-logging +--- +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + annotations: + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + labels: + config.example.com/name: simple-bootstrap + config.example.com/component: operators + name: cluster-logging + namespace: openshift-logging +spec: + channel: "4.4" + name: "cluster-logging" + source: "redhat-operators" + sourceNamespace: openshift-marketplace +## startingCSV: left out in docs diff --git a/simple-bootstrap/1-operators/elasticsearch-operator.yaml b/simple-bootstrap/1-operators/elasticsearch-operator.yaml new file mode 100644 index 0000000..47a397f --- /dev/null +++ b/simple-bootstrap/1-operators/elasticsearch-operator.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + annotations: + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + labels: + config.example.com/name: simple-bootstrap + config.example.com/component: operators + name: openshift-operators-redhat + namespace: openshift-operators-redhat +spec: {} +--- +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + annotations: + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + labels: + config.example.com/name: simple-bootstrap + config.example.com/component: operators + name: elasticsearch-operator + namespace: openshift-operators-redhat +spec: + channel: "4.4" + installPlanApproval: "Automatic" + name: "elasticsearch-operator" + source: "redhat-operators" + sourceNamespace: openshift-marketplace +## startingCSV: left out in docs diff --git a/simple-bootstrap/3-operator-configs/clusterlogging.yaml b/simple-bootstrap/3-operator-configs/clusterlogging.yaml new file mode 100644 index 0000000..7133f00 --- /dev/null +++ b/simple-bootstrap/3-operator-configs/clusterlogging.yaml @@ -0,0 +1,31 @@ +apiVersion: "logging.openshift.io/v1" +kind: "ClusterLogging" +metadata: + name: "instance" + namespace: "openshift-logging" + annotations: + config.example.com/managed-by: gitops + config.example.com/scm-url: git@github.com:redhat-cop/declarative-openshift.git + labels: + config.example.com/component: operator-configs + config.example.com/name: simple-bootstrap +spec: + managementState: "Managed" + logStore: + type: "elasticsearch" + elasticsearch: + nodeCount: 3 + redundancyPolicy: "SingleRedundancy" + storage: {} + visualization: + type: "kibana" + kibana: + replicas: 3 + curation: + type: "curator" + curator: + schedule: "30 3 * * *" + collection: + logs: + type: "fluentd" + fluentd: {}