You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sz...@apache.org on 2022/07/19 12:37:16 UTC

[nifi-minifi-cpp] branch main updated (699479ca6 -> 999304f59)

This is an automated email from the ASF dual-hosted git repository.

szaszm pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


    from 699479ca6 MINIFICPP-1874 docker-verify should only run tests that are enabled
     new 799243702 MINIFICPP-1879 Fix Prometheus switch in bootstrap.sh
     new 6f9419783 MINIFICPP-1880 Address documentation issues of daemonset deployment
     new 999304f59 MINIFICPP-1883 Enable compression in Prometheus client

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bootstrap.sh                                           |  2 +-
 cmake/Prometheus.cmake                                 |  2 +-
 examples/kubernetes/README.md                          | 12 ++++++++----
 .../cluster-roles}/daemon.namespace.yml                |  0
 .../cluster-roles}/namespace-reader.clusterrole.yml    |  0
 .../namespace-reader.clusterrolebinding.yml            |  0
 .../cluster-roles}/pod-reader.clusterrole.yml          |  0
 .../cluster-roles}/pod-reader.clusterrolebinding.yml   |  0
 .../daemon-set-log-collection.yml                      | 18 +++++++++++++-----
 .../sidecar-log-collection.yml                         |  0
 10 files changed, 23 insertions(+), 11 deletions(-)
 copy {docker/test/integration/resources/kubernetes/pods-etc => examples/kubernetes/daemon-set-log-collection/cluster-roles}/daemon.namespace.yml (100%)
 copy {docker/test/integration/resources/kubernetes/pods-etc => examples/kubernetes/daemon-set-log-collection/cluster-roles}/namespace-reader.clusterrole.yml (100%)
 copy {docker/test/integration/resources/kubernetes/pods-etc => examples/kubernetes/daemon-set-log-collection/cluster-roles}/namespace-reader.clusterrolebinding.yml (100%)
 copy {docker/test/integration/resources/kubernetes/pods-etc => examples/kubernetes/daemon-set-log-collection/cluster-roles}/pod-reader.clusterrole.yml (100%)
 copy {docker/test/integration/resources/kubernetes/pods-etc => examples/kubernetes/daemon-set-log-collection/cluster-roles}/pod-reader.clusterrolebinding.yml (100%)
 rename examples/kubernetes/{ => daemon-set-log-collection}/daemon-set-log-collection.yml (92%)
 rename examples/kubernetes/{ => sidecar-log-collection}/sidecar-log-collection.yml (100%)


[nifi-minifi-cpp] 03/03: MINIFICPP-1883 Enable compression in Prometheus client

Posted by sz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 999304f5926f6ee5db77a67f220277076b54adf0
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Tue Jul 19 13:57:00 2022 +0200

    MINIFICPP-1883 Enable compression in Prometheus client
    
    Closes #1371
    Signed-off-by: Marton Szasz <sz...@apache.org>
---
 cmake/Prometheus.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/Prometheus.cmake b/cmake/Prometheus.cmake
index 2a1560bd5..10be31eb0 100644
--- a/cmake/Prometheus.cmake
+++ b/cmake/Prometheus.cmake
@@ -20,7 +20,7 @@ include(FetchContent)
 set(ENABLE_PUSH OFF CACHE BOOL "" FORCE)
 set(ENABLE_TESTING OFF CACHE BOOL "" FORCE)
 set(USE_THIRDPARTY_LIBRARIES OFF CACHE BOOL "" FORCE)
-set(ENABLE_COMPRESSION OFF CACHE BOOL "" FORCE)
+set(ENABLE_COMPRESSION ON CACHE BOOL "" FORCE)
 
 set(PATCH_FILE "${CMAKE_SOURCE_DIR}/thirdparty/prometheus-cpp/remove-find_package.patch")
 set(PC ${Bash_EXECUTABLE}  -c "set -x &&\


[nifi-minifi-cpp] 01/03: MINIFICPP-1879 Fix Prometheus switch in bootstrap.sh

Posted by sz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 799243702177d32136f989b801409486c4eea6e3
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Tue Jul 19 13:54:47 2022 +0200

    MINIFICPP-1879 Fix Prometheus switch in bootstrap.sh
    
    Closes #1365
    Signed-off-by: Marton Szasz <sz...@apache.org>
---
 bootstrap.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bootstrap.sh b/bootstrap.sh
index 6c842d3c9..15a887ed5 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -343,7 +343,7 @@ set_dependency ELASTIC_ENABLED HTTP_CURL_ENABLED
 
 add_option PROCFS_ENABLED ${TRUE} "ENABLE_PROCFS"
 
-add_disabled_option PROMETHEUS_ENABLED ${FALSE} "ENABLE_PROMETHEUS"
+add_option PROMETHEUS_ENABLED ${FALSE} "ENABLE_PROMETHEUS"
 
 USE_SHARED_LIBS=${TRUE}
 ASAN_ENABLED=${FALSE}


[nifi-minifi-cpp] 02/03: MINIFICPP-1880 Address documentation issues of daemonset deployment

Posted by sz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 6f9419783f22d8c6b22627aebdb21651f07278a9
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Tue Jul 19 13:56:06 2022 +0200

    MINIFICPP-1880 Address documentation issues of daemonset deployment
    
    Closes #1366
    Signed-off-by: Marton Szasz <sz...@apache.org>
---
 examples/kubernetes/README.md                          | 12 ++++++++----
 .../cluster-roles/daemon.namespace.yml                 |  6 ++++++
 .../cluster-roles/namespace-reader.clusterrole.yml     |  9 +++++++++
 .../namespace-reader.clusterrolebinding.yml            | 12 ++++++++++++
 .../cluster-roles/pod-reader.clusterrole.yml           |  9 +++++++++
 .../cluster-roles/pod-reader.clusterrolebinding.yml    | 12 ++++++++++++
 .../daemon-set-log-collection.yml                      | 18 +++++++++++++-----
 .../sidecar-log-collection.yml                         |  0
 8 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/examples/kubernetes/README.md b/examples/kubernetes/README.md
index 1ff7a47b2..028505a24 100644
--- a/examples/kubernetes/README.md
+++ b/examples/kubernetes/README.md
@@ -18,13 +18,17 @@ The following examples show different configurations that can be applied in Kube
 
 ## Cluster level log collection with MiNiFi C++
 
-The [daemon-set-log-collection.yml](daemon-set-log-collection.yml) file has an example for cluster level log collection, which is done on every node by creating a daemon set.
+The [daemon-set-log-collection.yml](daemon-set-log-collection/daemon-set-log-collection.yml) file has an example for cluster level log collection, which is done on every node by creating a daemon set.
 The config includes a KubernetesControllerService that provides the namespace, pod, uid, container variables for the TailFile processor for getting the logs for the filtered Kubernetes objects.
 In this specific example all container logs from the default namespace are collected and forwarded to Kafka.
 The controller service can be modified to have additional filters for namespaces, pods, containers, for which more information can be found in the [CONTROLLERS.md](/CONTROLLERS.md#kubernetesControllerService) documentation.
-This setup complies with the ["node logging agent"](https://kubernetes.io/docs/concepts/cluster-administration/logging/#using-a-node-logging-agent) architecture described in the Kubernetes documentation.
+
+Note: To query Kubernetes cluster information, the MiNiFi agent requires read permission on the pod and namespace objects. One way to give read access to MiNiFi is to create specific cluster roles and cluster role bindings for a specific namespace where the MiNiFi is deployed. There is an example on this in the [daemon-set-log-collection/cluster-roles](daemon-set-log-collection/cluster-roles) directory.
+
+This setup complies with the [node logging agent](https://kubernetes.io/docs/concepts/cluster-administration/logging/#using-a-node-logging-agent) architecture described in the Kubernetes documentation.
 
 ## Pod level log collection with sidecar container using MiNiFi C++
 
-The [sidecar-log-collection.yml](sidecar-log-collection.yml) file has an example for pod level log collection, which is done by creating a sidecar container in the same pod where the container we want to collect the logs from is present. In this specific example a pod with a NiFi container is instantiated with a MiNiFi sidecar container which collects, compresses and uploads the NiFi logs to an AWS S3 bucket.
-This setup complies with the ["sidecar container with logging agent"](https://kubernetes.io/docs/concepts/cluster-administration/logging/#sidecar-container-with-logging-agent) architecture described in the Kubernetes documentation.
+The [sidecar-log-collection.yml](sidecar-log-collection/sidecar-log-collection.yml) file has an example for pod level log collection, which is done by creating a sidecar container in the same pod where the container we want to collect the logs from is present. In this specific example a pod with a NiFi container is instantiated with a MiNiFi sidecar container which collects, compresses and uploads the NiFi logs to an AWS S3 bucket.
+
+This setup complies with the [sidecar container with logging agent](https://kubernetes.io/docs/concepts/cluster-administration/logging/#sidecar-container-with-logging-agent) architecture described in the Kubernetes documentation.
diff --git a/examples/kubernetes/daemon-set-log-collection/cluster-roles/daemon.namespace.yml b/examples/kubernetes/daemon-set-log-collection/cluster-roles/daemon.namespace.yml
new file mode 100644
index 000000000..f628b21e6
--- /dev/null
+++ b/examples/kubernetes/daemon-set-log-collection/cluster-roles/daemon.namespace.yml
@@ -0,0 +1,6 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: daemon
+  labels:
+    name: daemon
diff --git a/examples/kubernetes/daemon-set-log-collection/cluster-roles/namespace-reader.clusterrole.yml b/examples/kubernetes/daemon-set-log-collection/cluster-roles/namespace-reader.clusterrole.yml
new file mode 100644
index 000000000..863439a69
--- /dev/null
+++ b/examples/kubernetes/daemon-set-log-collection/cluster-roles/namespace-reader.clusterrole.yml
@@ -0,0 +1,9 @@
+kind: ClusterRole
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  namespace: default
+  name: namespace-reader
+rules:
+- apiGroups: [""]  # "" indicates the core API group
+  resources: ["namespaces"]
+  verbs: ["get", "watch", "list"]
diff --git a/examples/kubernetes/daemon-set-log-collection/cluster-roles/namespace-reader.clusterrolebinding.yml b/examples/kubernetes/daemon-set-log-collection/cluster-roles/namespace-reader.clusterrolebinding.yml
new file mode 100644
index 000000000..98de6c481
--- /dev/null
+++ b/examples/kubernetes/daemon-set-log-collection/cluster-roles/namespace-reader.clusterrolebinding.yml
@@ -0,0 +1,12 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: namespace-reader-binding
+subjects:
+- kind: ServiceAccount
+  name: default
+  namespace: daemon
+roleRef:
+  kind: ClusterRole
+  name: namespace-reader
+  apiGroup: rbac.authorization.k8s.io
diff --git a/examples/kubernetes/daemon-set-log-collection/cluster-roles/pod-reader.clusterrole.yml b/examples/kubernetes/daemon-set-log-collection/cluster-roles/pod-reader.clusterrole.yml
new file mode 100644
index 000000000..a83231487
--- /dev/null
+++ b/examples/kubernetes/daemon-set-log-collection/cluster-roles/pod-reader.clusterrole.yml
@@ -0,0 +1,9 @@
+kind: ClusterRole
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  namespace: default
+  name: pod-reader
+rules:
+- apiGroups: [""]  # "" indicates the core API group
+  resources: ["pods"]
+  verbs: ["get", "watch", "list"]
diff --git a/examples/kubernetes/daemon-set-log-collection/cluster-roles/pod-reader.clusterrolebinding.yml b/examples/kubernetes/daemon-set-log-collection/cluster-roles/pod-reader.clusterrolebinding.yml
new file mode 100644
index 000000000..1d32a1933
--- /dev/null
+++ b/examples/kubernetes/daemon-set-log-collection/cluster-roles/pod-reader.clusterrolebinding.yml
@@ -0,0 +1,12 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: pod-reader-binding
+subjects:
+- kind: ServiceAccount
+  name: default
+  namespace: daemon
+roleRef:
+  kind: ClusterRole
+  name: pod-reader
+  apiGroup: rbac.authorization.k8s.io
diff --git a/examples/kubernetes/daemon-set-log-collection.yml b/examples/kubernetes/daemon-set-log-collection/daemon-set-log-collection.yml
similarity index 92%
rename from examples/kubernetes/daemon-set-log-collection.yml
rename to examples/kubernetes/daemon-set-log-collection/daemon-set-log-collection.yml
index ce2d63ee1..0f1c351a6 100644
--- a/examples/kubernetes/daemon-set-log-collection.yml
+++ b/examples/kubernetes/daemon-set-log-collection/daemon-set-log-collection.yml
@@ -65,7 +65,7 @@ data:
         Client Name: test-client
         Compress Codec: none
         Delivery Guarantee: '1'
-        Known Brokers: kafka-broker:9092
+        Known Brokers: kafka-service.default.svc.cluster.local:9092
         Message Timeout: 12 sec
         Request Timeout: 10 sec
         Topic Name: ${kubernetes.namespace}_${kubernetes.pod}_${kubernetes.container}_logs
@@ -87,16 +87,18 @@ metadata:
   labels:
     k8s-app: minifi-log-collection
   name: minifi-log-collection-config
-  namespace: default
+  namespace: daemon
 ---
 apiVersion: apps/v1
 kind: DaemonSet
 metadata:
   name: log-collection-minifi
-  namespace: default
+  namespace: daemon
   labels:
     k8s-app: minifi-log-collection
 spec:
+  securityContext:
+    runAsUser: 0
   selector:
     matchLabels:
       name: log-collection-minifi
@@ -108,6 +110,8 @@ spec:
       containers:
       - name: minifi
         image: apache/nifi-minifi-cpp:latest
+        securityContext:
+          allowPrivilegeEscalation: false
         volumeMounts:
         - name: minificonfig
           mountPath: /opt/minifi/minifi-current/conf/config.yml
@@ -115,10 +119,14 @@ spec:
         - name: minificonfig
           mountPath: /opt/minifi/minifi-current/conf/minifi-log.properties
           subPath: minifi-log.properties
+        - name: var-log-pods
+          mountPath: /var/log/pods
+          readOnly: true
       volumes:
-      - name: nifi-logs
-        emptyDir: {}
       - configMap:
           defaultMode: 420
           name: minifi-log-collection-config
         name: minificonfig
+      - name: var-log-pods
+        hostPath:
+          path: /var/log/pods
diff --git a/examples/kubernetes/sidecar-log-collection.yml b/examples/kubernetes/sidecar-log-collection/sidecar-log-collection.yml
similarity index 100%
rename from examples/kubernetes/sidecar-log-collection.yml
rename to examples/kubernetes/sidecar-log-collection/sidecar-log-collection.yml