Add documentation

This commit is contained in:
Alejandro Moreno
2019-09-26 07:46:40 +00:00
parent be0f29f6c7
commit 5311a2808f
4 changed files with 178 additions and 97 deletions

140
bitnami/fluentd/README.md Normal file
View File

@@ -0,0 +1,140 @@
# Fluentd
[Fluentd](https://www.fluentd.org/) is an open source data collector, which lets you unify the data collection and consumption for a better use and understanding of data.
## TL;DR;
```console
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install bitnami/fluentd
```
## Introduction
This chart bootstraps a [Fluentd](https://github.com/bitnami/bitnami-docker-fluentd) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters.
## Installing the Chart
To install the chart with the release name `my-release`:
```console
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install bitnami/fluentd --name my-release
```
These commands deploy Fluentd on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
> **Tip**: List all releases using `helm list`
## Uninstalling the Chart
To uninstall/delete the `my-release` statefulset:
```console
$ helm delete my-release
```
The command removes all the Kubernetes components associated with the chart and deletes the release. Use the option `--purge` to delete all history too.
## Configuration
The following tables lists the configurable parameters of the kibana chart and their default values.
| Parameter | Description | Default |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| `global.imageRegistry` | Global Docker image registry | `nil` |
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `global.storageClass` | Global storage class for dynamic provisioning | `nil` |
| `image.registry` | Fluentd image registry | `docker.io` |
| `image.repository` | Fluentd image name | `bitnami/fluentd` |
| `image.tag` | Fluentd image tag | `{TAG_NAME}` |
| `image.pullPolicy` | Fluentd image pull policy | `IfNotPresent` |
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `nameOverride` | String to partially override fluentd.fullname template with a string (will prepend the release name) | `nil` |
| `fullnameOverride` | String to fully override fluentd.fullname template with a string | `nil` |
| `clusterDomain` | Kubernetes DNS domain name to use | `cluster.local` |
| `forwarder.configFile` | Name of the config file that will be used by Fluentd at launch under the `/opt/bitnami/fluentd/conf` directory | `fluentd.conf` |
| `forwarder.service.type` | Kubernetes Service type | | `ClusterIP` |
| `forwarder.service.port` | Kubernetes Service port - Fluentd transport port for the forwarders | `24224` |
| `forwarder.service.nodePort` | Port to bind to for NodePort service type (client port) | `nil` |
| `forwarder.service.annotations` | Annotations for Fluentd service (evaluated as a template) | `{}` |
| `forwarder.service.loadBalancerIP` | loadBalancerIP if Fluentd service type is `LoadBalancer` | `nil` |
| `forwarder.extraArgs` | Extra arguments for the Fluentd command line | `nil` |
| `forwarder.extraEnv` | Extra environment variables to pass to the container | `{}` |
| `forwarder.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `60` |
| `forwarder.livenessProbe.periodSeconds` | How often to perform the probe | `10` |
| `forwarder.livenessProbe.timeoutSeconds` | When the probe times out | `5` |
| `forwarder.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` |
| `forwarder.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` |
| `forwarder.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `5` |
| `forwarder.readinessProbe.periodSeconds` | How often to perform the probe | `10` |
| `forwarder.readinessProbe.timeoutSeconds` | When the probe times out | `5` |
| `forwarder.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` |
| `forwarder.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` |
| `forwarder.updateStrategy` | Update strategy for the forwarder DaemonSet | `RollingUpdate` |
| `forwarder.resources` | Configure resource requests and limits | `nil` |
| `forwarder.nodeSelector` | Node labels for pod assignment | `{}` |
| `forwarder.tolerations` | Tolerations for pod assignment | `[]` |
| `forwarder.affinity` | Affinity for pod assignment | `{}` |
| `forwarder.podAnnotations` | Pod annotations | `{}` |
| `aggregator.replicaCount` | Number of aggregator pods to deploy in the Stateful Set | `2` |
| `aggregator.configFile` | Name of the config file that will be used by Fluentd at launch under the `/opt/bitnami/fluentd/conf` directory | `fluentd.conf` |
| `aggregator.service.type` | Kubernetes Service type | | `ClusterIP` |
| `aggregator.port` | Kubernetes Service port - Fluentd transport port for the aggregators | `24224` |
| `aggregator.extraArgs` | Extra arguments for the Fluentd command line | `nil` |
| `aggregator.extraEnv` | Extra environment variables to pass to the container | `{}` |
| `aggregator.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `60` |
| `aggregator.livenessProbe.periodSeconds` | How often to perform the probe | `10` |
| `aggregator.livenessProbe.timeoutSeconds` | When the probe times out | `5` |
| `aggregator.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` |
| `aggregator.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` |
| `aggregator.readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `5` |
| `aggregator.readinessProbe.periodSeconds` | How often to perform the probe | `10` |
| `aggregator.readinessProbe.timeoutSeconds` | When the probe times out | `5` |
| `aggregator.readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` |
| `aggregator.readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` |
| `aggregator.updateStrategy` | Update strategy for the aggregator DaemonSet | `RollingUpdate` |
| `aggregator.resources` | Configure resource requests and limits | `nil` |
| `aggregator.nodeSelector` | Node labels for pod assignment | `{}` |
| `aggregator.tolerations` | Tolerations for pod assignment | `[]` |
| `aggregator.affinity` | Affinity for pod assignment | `{}` |
| `aggregator.podAnnotations` | Pod annotations | `{}` |
| `serviceAccount.create` | Specify whether a ServiceAccount should be created | `true` |
| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the `fluentd.fullname` template |
| `rbac.create` | Specify whether RBAC resources should be created and used | `true` |
| `metrics.enabled` | Enable the export of Prometheus metrics | `nil` |
| `metrics.service.port` | Prometheus metrics service port | `24231` |
| `metrics.service.annotations` | Annotations for Prometheus metrics service | `{}` |
| `tls.enabled` | Enable the addition of TLS certificates | | `false` |
| `tls.caCertificate` | Ca certificate | Certificate Authority (CA) bundle content |
| `tls.serverCertificate` | Server certificate | Server certificate content |
| `tls.serverKey` | Server Key | Server private key content |
| `tls.existingSecret` | Existing secret with certificate content | `nil` |
| `securityContext.enabled` | Enable security context | `true` |
| `securityContext.fsGroup` | Group ID for the container filesystem | `1001` |
| `securityContext.runAsUser` | User ID for the container | `1001` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```console
$ helm install --name my-release \
--set aggregator.port=24444 bitnami/fluentd
```
The above command sets the aggregators to listen on port 24444.
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
```console
$ helm install --name my-release -f values.yaml bitnami/fluentd
```
> **Tip**: You can use the default [values.yaml](values.yaml)
## [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.

View File

@@ -1,21 +1,30 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
** Please be patient while the chart is being deployed **
Fluentd can be accessed within the cluster on port {{ .Values.forwarder.service.port }} at {{ template "fluentd.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
To access from outside the cluster execute the following commands:
{{- if contains "NodePort" .Values.forwarder.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fluentd.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
curl http://$NODE_IP:$NODE_PORT/
{{- else if contains "LoadBalancer" .Values.forwarder.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fluentd.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fluentd.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
curl http://$SERVICE_IP:{{ .Values.forwarder.service.port }}/
{{- else if contains "ClusterIP" .Values.forwarder.service.type }}
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "fluentd.fullname" . }} {{ .Values.forwarder.service.port }}:24224 &
curl http://127.0.0.1:24224/
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "fluentd.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "fluentd.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "fluentd.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "fluentd.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
{{- end }}

View File

@@ -1,36 +0,0 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "fluentd.fullname" . -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{ include "fluentd.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}
{{- end }}

View File

@@ -78,13 +78,13 @@ forwarder:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
##
livenessProbe:
initialDelaySeconds: 120
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1
readinessProbe:
initialDelaySeconds: 30
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
@@ -161,13 +161,13 @@ aggregator:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
##
livenessProbe:
initialDelaySeconds: 120
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1
readinessProbe:
initialDelaySeconds: 30
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
@@ -238,40 +238,12 @@ metrics:
enabled: false
service:
port: 24231
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "24231"
prometheus.io/path: "/metrics"
service:
type: ClusterIP
## Fluentd TCP forward port
port: 24224
## Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
##
# nodePort:
## Provide any additional annotations which may be required. This can be used to
## set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
annotations: {}
# loadBalancerIP:
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
## Annotations for the Prometheus metrics service
## annotations:
## prometheus.io/scrape: "true"
## prometheus.io/port: "24231"
## prometheus.io/path: "/metrics"
annotations: {}
tls:
enabled: false
@@ -286,7 +258,3 @@ securityContext:
enabled: true
runAsUser: 1001
fsGroup: 1001
runAsNonRoot: true