Commit Graph

109 Commits

Author SHA1 Message Date
Steve Wilkerson abb5e0f713 Separate fluentbit and fluentd charts
This begins to split the fluent-logging chart into two separate
charts, one for fluentbit and one for fluentd. This is to help
isolate each chart and its dependencies better, and to treat each
service as its own entity.

This also moves the job for creating Elasticsearch templates to
the Elasticsearch chart, as the elasticsearch chart should have
ownership of creating the templates for its indices.

This also performs some general cleanup of values keys that are
not currently used

Change-Id: I827277d5faa62b8b59c5960330703d23c297ca47
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-05-24 06:31:09 -05:00
Zuul ff2d62c9bf Merge "Fluent-logging: Remove utils for generating configuration files" 2019-05-24 03:08:03 +00:00
Zuul 2de8acf4a4 Merge "Fluentd: Update ClusterRole object" 2019-05-24 03:08:01 +00:00
Zuul f4e096ced1 Merge "Fluent-logging: Fix read-only-fs" 2019-05-23 22:06:48 +00:00
Steve Wilkerson e2c9c367fa Fluentd: Update ClusterRole object
This updates the ClusterRole object for fluentd by removing a
duplicate rules: key and also adds 'get' to the list of verbs for
the "" apiGroups (as it's required for the kubernetes metadata
plugin)

Change-Id: Ia901d9fe9a0784038f0f882297c64afcce58ca7e
2019-05-23 22:04:26 +00:00
Steve Wilkerson b44d99b36a Fluent-logging: Remove utils for generating configuration files
This removes the utilities for generating the fluentd, fluentbit,
and parser configuration files from yaml and moves to instead
consume the configuration files as strings from the values.yaml.

This allows for easier creation and maintenance of configuration
files for fluentd and fluentbit, as the utilities became unwieldy
with complex configuration files.

This necessitated the removal of the core test executed by the
charts helm tests, but this would be required as we move to split
the charts regardless

Change-Id: Ied4a76bbdf58b54a6d702db04a7120b64f54dcac
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-05-23 13:06:19 -05:00
Jean-Philippe Evrard 5f5e988fb3 Point to OSH-images images
We now have a process for OSH-images image building,
using Zuul, so we should point the images by default to those
images, instead of pointing to stale images.

Without this, the osh-images build process is completely not
in use (and completely opaque to deployers), and updating the
osh-images process or patching its code has no impact on OSH.

This should fix it.

Change-Id: Ic00bd98c151669dc2485cd88e0e8c2ab05445959
2019-05-17 08:17:32 +00:00
RAHUL KHIYANI 6a19f3e1c5 Fluent-logging: Fix read-only-fs
This PS adds the default read-only-rootfs to true for fluent-logging chart

Change-Id: I82084c2712f5d1a99c5206e1488f60ae2819d007
2019-05-16 14:10:15 -05:00
Roy Tang (rt7380) 85bd731562 Expose Anti-Affinity Weight Setting
This ps exposes the anti-affinity weight value, including
default, that will be consumed by the updated htk function.

Change-Id: Id8eb303674764ef8b0664f62040723aaf77e0a54
2019-05-14 17:04:52 -05:00
Meg Heisler e1f2a3cf78 Fix broken network policy check/gate
This adds a basic egress policy to the charts run by the
network-policy check. A change was recently merged requiring
the eggress tag to be in the chart but did not add it, this
addresses that

Change-Id: I60669c9351db7854cba8c69723eb783a966d2a56
2019-05-10 05:55:22 +00:00
Steve Wilkerson 9c3bb06525 Fluentd-Exporter: Use bitnami fluentd exporter image
This updates the fluentd-exporter to use the bitnami image for the
chart instead of a personal image

Change-Id: I162dca4556646eb781c380acea307d2feb156d18
2019-05-08 13:16:20 +00:00
diwakarthyagaraj 0ed4f0de5e Add Docker default AppArmor profile to Fluentbit and Elasticsearch
Change-Id: I21efbf8d434f6245eef04308973af4e7ec0b2380
Co-authored-by: ld366r@att.com
2019-04-25 13:55:52 -05:00
RAHUL KHIYANI e3bd69c084 Fluent-logging: Fix security context
This PS fixes the use of the security context macros for the
fluent-logging chart.

Change-Id: I2cd12015732bddb642136ba14f88ed2c248d519d
2019-04-23 14:40:14 +00:00
Pete Birley 2abf62ff4d OSH-Infra: Add emptydirs for tmp
This PS adds emptydirs backing the /tmp directory in pods, which
is required in most cases for full operation when using a read only
filesystem backing the container.

Additionally some yaml indent issues are resolved.

Change-Id: I8b7f1614da059783254aa6efc09facf23fca3cad
Signed-off-by: Pete Birley <pete@port.direct>
2019-04-20 20:50:59 +00:00
Steve Wilkerson 2e8c96a623 Elasticsearch, Fluent-logging, Kibana Ingress Policy
This adds ingress network policy for the fluent-logging, kibana
and Elasticsearch charts. This leverages the helm-toolkit template
that was used in openstack-helm for the openstack services

Change-Id: I2a89b62f1002851346e9a25de40113078e9c518f
2019-04-16 19:44:46 +00:00
Zuul ce8a75afa5 Merge "Fluent-logging securityContext" 2019-03-22 01:31:25 +00:00
Rahul Khiyani 478855dc7c Fluent-logging securityContext
securityContext with allowPrivilegeEscalation: false is implemented at
container level and leveraged the helm-toolkit snippet

Change-Id: Iddb18c87993fd3dc005c55f5678829c2a19718db
2019-03-21 14:28:14 +00:00
Steve Wilkerson 84f30ec103 Add release-annotation to pod spec, add missing annotations
This adds the release-annotation to the pod spec for the charts in
openstack-helm-infra. This also adds missing configmap annotations
to charts in openstack-helm-infra

Change-Id: Ie23f0c16a7a21d3929e98928db2bbcef69ae6490
2019-03-21 09:10:48 -05:00
Rahul Khiyani be45316771 readOnlyFilesystem: true for fluent-logging chart
Fix for adding readOnlyFilesystem flag at pod
level

Change-Id: I29224a4f0a6a9ac98dd6016eaf7215a99230328e
2019-03-07 17:12:04 +00:00
Steve Wilkerson 015665516e Fluentd: Add type_name to default elasticsearch output
The change that modified the output configurations for fluentd
accidentally removed the type_name from the default elasticsearch
output, which prevents the output from using the fluent template
that's defined in the chart. This replaces the type_name for that
output

Change-Id: I2098ca8c243d55f0446ea623a80b5b40e3acff8c
2019-02-13 12:49:57 -06:00
Steve Wilkerson 3614d025dc Fluentbit: Remove database used in tail inputs
This updates the fluentbit configuration for tail inputs to remove
the values for utilizing mysqlite databases to track its location
in each file it's configured to tail.  This is intended to reduce
the pressure fluentbit exerts on the host through writing to
/var/log/foo.db. To help mitigate large amounts of traffic
sent from fluentbit to fluentd upon a pod restart, this also
adds a throttle filter to fluentbit.

As a result, Fluentbit no longer needs a writable mount to its
hostPath on /var/log on the host.  Thus, this change includes
updating the Fluentbit daemonset's mount on /var/log to be
readOnly

Change-Id: If4381f4ff47e887f3ea10beded4f6172edaf08ba
2019-02-01 16:56:31 +00:00
Steve Wilkerson f01e9d2391 Fluentd: remove unused configuration section
This removes an unused section of configuration for fluentd, as
well as cleans up the values for filtering fluentd logs

Change-Id: I0c58d3ac236af7723c64c3b9fcba877736b1f606
2019-01-30 16:03:59 -06:00
Steve Wilkerson 39410b16bc Fluentd: Remove unused liveness port
This removes an unused port for a previous implementation of the
fluentd liveness probe

Change-Id: I80367bcf6fedc75b3ee7054eba9c382fbb4bc79d
2019-01-29 14:31:50 -06:00
Steve Wilkerson 9f5b1a77bc Add liveness probe to fluentd
This adds a liveness probe to the fluentd chart. This probe will
simply perform a tcpSocket check on the same port the readiness
probe executes the check on.

Change-Id: I768b23d36d50d6f6938f5588bea71e97aeb624b9
2019-01-23 11:47:34 -06:00
Steve Wilkerson 181d7ebb34 Fluentd: Update buffer output settings for Elasticsearch
This updates the fluentd configuration to use 8 threads for the
Elasticsearch output configuration by default. This uses the
correct buffer output settings for the fluent-elasticsearch
plugin

This also updates the buffer output settings to the defaults used
for fluentd

Change-Id: I976cddaa973e850dabe4de495cd3bf1a4acdd4e7
2019-01-10 14:51:41 -06:00
Zuul 9de0d96739 Merge "Fluentd: Add security context for pods/containers" 2019-01-07 22:15:19 +00:00
Chris Wedgwood 0c4e37391f 'NOP' cleanup for more consistent white-space use in charts
Where we have the style '{{ ...' we should use the style '... }}'.

Change-Id: Ic3e779e4681370d396f95d3804ca27db5b9d3642
2019-01-03 22:45:49 +00:00
Steve Wilkerson e7232313ea Fluentd: Add security context for pods/containers
This adds the security context snippet to the fluentd and
fluentd exporter templates. This changes the users for these two
pods from root to the nobody user instead

This also adds the container security context to explicitly set
allowPrivilegeEscalation to false

Change-Id: Ibf1da152f4aa78d425bbd00f514c2787d8ad9c5f
2019-01-03 16:10:23 -06:00
Steve Wilkerson 5c4e77d816 Fluent-logging: Add input and output for qemu logs
This adds an input to Fluentbit for capturing all qemu instance
logs in /var/log/libvirt/qemu/, and adds an Elasticsearch output
for those entries

Change-Id: I0802023f9861a5944e7989fd5469133c325349e7
2019-01-02 15:29:03 -06:00
Steve Wilkerson 281b0799f0 Write libvirt logs to host
This modifies the libvirt chart to write logs directly to the
host by default. This also modifies the fluentbit and fluentd
charts to capture libvirt logs from the host and index them into
Elasticsearch

Change-Id: I0bbc49d2c0d4cf4895f797e48f309f308ffd021f
2018-12-28 17:43:12 +00:00
Zuul 6d354f0f7b Merge "Revert "Add Egress Helm-toolkit function & enforce the nework policy at OSH-INFRA"" 2018-12-16 08:57:09 +00:00
Pete Birley 0bf3674539 Revert "Add Egress Helm-toolkit function & enforce the nework policy at OSH-INFRA"
This reverts commit 8d33a2911c.

Change-Id: Ic861b9bf9b337449b47a3558da8355e7a5bcacee
2018-12-16 04:21:46 +00:00
Zuul b90bf10b89 Merge "Add Egress Helm-toolkit function & enforce the nework policy at OSH-INFRA" 2018-12-15 09:32:21 +00:00
Mike Pham 8d33a2911c Add Egress Helm-toolkit function & enforce the nework policy at OSH-INFRA
This PS implements the helm toolkit function to generate the
Egress in kubernetes network policy manifest based on overrideable values.
It also enbale the K8s network policy at Osh-infra gate.

Change-Id: Icbe2a18c98dba795d15398dcdcac64228f6a7b4c
2018-12-14 16:32:40 -05:00
Steve Wilkerson f4e10f8839 Fluentbit: Add Decode_Field_As config to docker parser
This adds the Decode_Field_As configuration key to the docker
parser for fluentbit. This is required to escape utf-8 encoded
characters appropriately in the log field

Change-Id: Ie2600cfe22045e3ab651fddf61ed2f676ab8a1d5
2018-12-12 22:24:09 +00:00
Mike Pham d09254c6de Modify Fluentbit to add appropriate tags
Adding auth tags for the logs to support special filter
for openstack and application security logs

Change-Id: Ifbd2395e4268d8d8fc4a2a3ac4d351db3d3e0845
2018-12-05 15:16:40 +00:00
Steve Wilkerson 26c3773983 Fluentbit/Node Exporter: Remove unused tolerations key
This removes the tolerations key from the labels entries. As the
boolean check is on the pod.tolerations.enabled key instead, the
labels.foo.tolerations key is no longer used and should be removed

Change-Id: I00536dabadf9bd354219058d8efd054c60952bbd
2018-11-27 12:38:16 -06:00
Steve Wilkerson 4c29bafcbc Gates: Update fluent-logging/elasticsearch configurations
This updates the fluentd buffer output configurations to account
for the restraints of the jobs deploying fluentd. This also
renames the fluentd configuration key from td_agent to fluentd to
reflect the fact we're no longer deploying td-agent

This also updates the Elasticsearch default replicas and overrides
the replica counts in each Elasticsearch deployment to account for
resource constraints

Change-Id: I55dee410eced99c3e1645f7452e4306ad646e601
2018-10-19 17:30:08 +00:00
Steve Wilkerson 92717bdc72 Ceph: Remove fluentbit sidecars, mount hostpath for logs
This removes the fluentbit sidecars from the ceph-mon and ceph-osd
charts. Instead, we mount /var/log/ceph as a hostpath, and use the
fluentbit daemonset to target the mounted log files instead

This also updates the fluentd configuration to better handle the
correct configuration type for flush_interval (time vs int), as
well as updates the fluentd elasticsearch output values to help
address the gate failures resulting from the Elasticsearch bulk
endpoints failing

Change-Id: If3f2ff6371f267ed72379de25ff463079ba4cddc
2018-10-17 11:05:03 -05:00
Tin Lam 92e68d33ea Add network policy toolkit function
This patch set implements the helm toolkit function to generate a
kubernetes network policy manifest based on overrideable values.
This also adds a chart that shuts down all the ingress and egress
traffics in the namespace. This can be used to ensure the
whitelisted network policy works as intended.

Additionally, implementation is done for some infrastructure charts.

Change-Id: I78e87ef3276e948ae4dd2eb462b4b8012251c8c8
Co-Authored-By: Mike Pham <tp6510@att.com>
Signed-off-by: Tin Lam <tin@irrational.io>
2018-10-15 13:50:50 +00:00
Zuul 75ea67e591 Merge "Fluent-logging: Update helm tests for checking index entries" 2018-10-13 03:11:39 +00:00
Zuul c39b29e351 Merge "Fluentd: Update logging interval values" 2018-10-13 03:02:04 +00:00
Steve Wilkerson c7cbb9f4dd Charts: Update heat image used for jobs and helm tests
This changes the image used for various jobs and helm tests in the
osh-infra charts. This replaces the kolla heat image with the loci
based heat image used for jobs and helm tests in openstack-helm in
order to drive consistency

Change-Id: Ie9deedadb7507282fe62723ec4641dd508040364
2018-10-11 14:47:58 -05:00
Steve Wilkerson 78283495f0 Fluent-logging: Update helm tests for checking index entries
This updates the helm tests for the fluent-logging chart to make
them more robust in being able to check for indexes defined in the
chart.  This is done by calculating the combined flush interval
for both fluentbit and fluentd, and sleeping for at least one
flush cycle to ensure all functional indexes have received logged
events.

Then, the test determines what indexes should exist by checking
all Elasticsearch output configuration entries, determining
whether to use the default logstash-* index or the logstash_prefix
configuration value if it exists.  For each of these indexes, the
test checks whether the indexes have successful hits (ie: there
have been successful entries into these indexes)

Change-Id: I36ed7b707491e92da6ac4b422936a1d65c92e0ac
2018-10-11 13:28:30 -05:00
Steve Wilkerson 9b5d4d9f17 Fluentd: Update logging interval values
This updates the logging interval values for the Elasticsearch
outputs to integers (20) vs the previous string value (20s)

Change-Id: I681bdaf807ba0136fef3b6dc1c7ddaa689ae77a3
2018-10-11 09:05:00 -05:00
Steve Wilkerson bfa237d347 Charts: Update helm test pod templates
This updates the helm test pod templates in the charts with helm
tests defined. This change includes the addition of:

- Generate test pod cluster roles and role bindings
- Generate service accounts for test pods
- Add node selectors to the test pods
- Add service accounts to the test pods
- Addition of entrypoint container to the test pods
- Indentation fix for rabbitmq test pod template

Change-Id: I9a0dd8a1a87bfe5eaf1362e92b37bc004f9c2cdb
2018-10-09 21:00:00 +00:00
Steve Wilkerson fa09705867 Fluentbit: Add kernel, kubelet, and dockerd logs
This adds inputs for kernel logs on the host, as well as dockerd
and kubelet logs via the systemd plugin. This also adds a filter
for adding the hostname to the kernel log events, for renaming the
fields for systemd logs as kibana can not visualize fields that
begin with an underscore, and adds elasticsearch indexes for both
kernel and systemd logs

Change-Id: I026470dd45a971047f1e5bd1cd49bd0889589d12
2018-10-01 11:56:58 +00:00
Zuul bc1afb87d7 Merge "Helm-Toolkit: Add snippet for kubernetes tolerations" 2018-09-23 01:13:57 +00:00
Steve Wilkerson ba736d9840 Fluent-logging: Update fluentd configuration
This updates the configuration for fluentd, providing a mechanism
for basic determination of the log level of a logged event via
entries from /var/log/containers. This log level is prepended to
the tag for that event, and also added as a new `level` key in
the resulting event. These two improvements allow for querying
specific log level events via the tag.

This also adds similar functionality to any events captured via
the oslo log fluentd handler/formatter. This allows for
elasticsearch queries akin to `error.openstack.keystone`, which
can be used by nagios or another alerting mechanism to raise
alerts when a particular level event has been captured.

Change-Id: I016ddcfcf7408de7b6511ddf7009e1e6a5f3a1d9
2018-09-19 14:22:27 -05:00
Zuul e649ad529f Merge "Fluent-logging: Update kubernetes plugin test" 2018-09-19 19:20:33 +00:00