Skip to content

Commit cff478f

Browse files
santhoshkvudaSanthosh Kumar Vuda
andauthored
Helm chart v1.0.0 (#2)
* Helm chart V1 * Helm chart V1 Co-authored-by: Santhosh Kumar Vuda <[email protected]>
1 parent fede9a7 commit cff478f

17 files changed

+1234
-6
lines changed

README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ At present, control plane logs are not covered as part of out of the box collect
4646
The out of the box collection for these logs will be available soon for generic Kubernetes clusters and for OKE (when OKE makes these logs accessible to end users).
4747

4848
### Application Pod/Container Logs
49+
4950
All the logs from application pods writing STDOUT/STDERR are typically available under /var/log/containers/.
5051
Application which are having custom log handlers (say log4j or similar) may route their logs differently but in general would be available on the node (through a volume).
5152

@@ -91,7 +92,7 @@ The following are the list of objects supported at present:
9192
We are in the process of building a docker image based off Oracle Linux 8 including Fluentd, OCI Logging Analytics Output Plugin and all the required dependencies.
9293
All the dependencies will be build from source and installed into the image. This image soon would be available to use as a pre-built image as is (OR) to create a custom image using this image as a base image.
9394
At present, for testing purposes follow the below mentioned steps to build an image using official Fluentd Docker Image as base image (off Debian).
94-
- Download all the files from [this dir](/logan/docker-images/v1.0/debian/) into a local machine having access to internet.
95+
- Download all the files from [this dir](logan/docker-images/v1.0/debian/) into a local machine having access to internet.
9596
- Run the following command to build the docker image.
9697
- *docker build -t fluentd_oci_la -f Dockerfile .*
9798
- The docker image built from the above step, can either be pushed to Docker Hub or OCI Container Registry (OCIR) or to a Local Docker Registry depending on the requirements.
@@ -107,7 +108,7 @@ At present, for testing purposes follow the below mentioned steps to build an im
107108
108109
#### To enable Logs collection
109110
110-
Download all the yaml files from [this dir](/logan/kubernetes-resources/logs-collection/).
111+
Download all the yaml files from [this dir](logan/kubernetes-resources/logs-collection/).
111112
These yaml files needs to be applied using kubectl to create the necessary resources that enables the logs collection into Logging Analytics through a Fluentd based DaemonSet.
112113
113114
##### configmap-docker.yaml | configmap-cri.yaml
@@ -163,7 +164,7 @@ kubectl rollout restart daemonset oci-la-fluentd-daemonset -n=kube-system
163164
164165
#### To enable Kubernetes Objects collection
165166
166-
Download all the yaml files from [this dir](/logan/kubernetes-resources/objects-collection/).
167+
Download all the yaml files from [this dir](logan/kubernetes-resources/objects-collection/).
167168
These yaml files needs to be applied using kubectl to create the necessary resources that enables the Kuberetes Objects collection into Logging Analytics.
168169
169170
##### configMap-objects.yaml
@@ -202,15 +203,42 @@ kubectl rollout restart deployment oci-la-fluentd-deployment -n=kube-system
202203
203204
### Deploying Kuberenetes resources using Helm
204205
205-
Coming soon ...
206+
#### Pre-requisites
207+
208+
- Install helm if not done already. Refer [this](https://helm.sh/docs/intro/install/).
209+
- Download the helm chart from [this dir](logan/helm-chart/).
206210
211+
#### values.yaml
207212
213+
- This file contains all the default values possible to setup the logs and objects collection, but few values needs to be provided either through an external values.yaml file or by modifying this file. It is recommended to use external values.yaml to override any values.
214+
- Inline documentation has the description and possible values for each of the configuration parameters.
215+
- At minimum, the following needs to be set accordingly. image:url, ociLANamespace, ociLALogGroupID. It is recommended to set kubernetesClusterID and kubernetesClusterName too, to tag all the logs processed with corresponding Kubernetes cluster at Logging Analytics.
216+
- Use "docker" as runtime for Kubernetes clusters based off Docker runtime (e.g., OKE < 1.20) and "cri" for Kubernetes clusters based off CRI-O. The default is "cri".
217+
- Use "InstancePrincipal" as authtype for OKE and all clusters which are running on OCI VMs and "config" as authtype for OCI Config file based Auth/AuthZ. config under oci section needs to be updated with relevant info when authtype is chosen as "config". The default is "InstancePrincipal".
208218
219+
#### Commands Reference
209220
221+
It is recommended to validate the values using the following `helm template` command before actually installing. Provide path to exterval values.yaml and path to helm-chart.
222+
223+
```
224+
helm template --values <path-to-external-values.yaml> <path-to-helm-chart>
225+
```
210226
227+
Now, the chart can be installed using the following `helm install` command. Provide a desired release name, path to exterval values.yaml and path to helm-chart.
211228
229+
```
230+
helm install <release-name> --values <path-to-external-values.yaml> <path-to-helm-chart>
231+
```
212232
233+
Use the following `helm upgrade` command if any further changes to values.yaml needs to be applied or a new chart version needs to be deployed. Refer [this](https://helm.sh/docs/helm/helm_upgrade/) for further details on `helm upgrade`.
213234
235+
```
236+
helm upgrade <release-name> --values <path-to-external-values.yaml> <path-to-helm-chart>
237+
```
214238
239+
Use the following `helm uninstall` command to delete the chart. Provide the release name used when creating the chart.
215240
216-
241+
```
242+
helm uninstall <release-name>
243+
```
244+

logan/helm-chart/Chart.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v2
2+
name: oci-la-fluentd
3+
description: Helm chart for collecting Kubernetes logs and objects using Fluentd into OCI Logging Analytics.
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 1.0.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
# appVersion here reflects OCI Logging Analytics Fluentd Output Plugin version
25+
appVersion: "2.0.0"

logan/helm-chart/templates/NOTES.txt

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "oci-la-fluentd.name" -}}
5+
{{- default .Chart.Name .Values.name | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{- define "common.tplvalues.render" -}}
9+
{{- if typeIs "string" .value }}
10+
{{- tpl .value .context }}
11+
{{- else }}
12+
{{- tpl (.value | toYaml) .context }}
13+
{{- end }}
14+
{{- end -}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: {{ include "oci-la-fluentd.name" . }}-logs-clusterrole
6+
namespace: {{ default "kube-system" .Values.namespace }}
7+
rules:
8+
- apiGroups:
9+
- ""
10+
resources:
11+
- '*'
12+
verbs:
13+
- get
14+
- list
15+
- watch
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: {{ include "oci-la-fluentd.name" . }}-objects-clusterrole
6+
namespace: {{ default "kube-system" .Values.namespace }}
7+
rules:
8+
- apiGroups:
9+
- ""
10+
resources:
11+
- '*'
12+
verbs:
13+
- get
14+
- list
15+
- watch
16+
- apiGroups:
17+
- apps
18+
resources:
19+
- '*'
20+
verbs:
21+
- get
22+
- list
23+
- watch
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
kind: ClusterRoleBinding
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
name: {{ include "oci-la-fluentd.name" . }}-logs-clusterrolebinding
6+
roleRef:
7+
kind: ClusterRole
8+
name: {{ include "oci-la-fluentd.name" . }}-logs-clusterrole
9+
apiGroup: rbac.authorization.k8s.io
10+
subjects:
11+
- kind: ServiceAccount
12+
name: {{ include "oci-la-fluentd.name" . }}-serviceaccount
13+
namespace: {{ default "kube-system" .Values.namespace }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
kind: ClusterRoleBinding
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
name: {{ include "oci-la-fluentd.name" . }}-objects-clusterrolebinding
6+
roleRef:
7+
kind: ClusterRole
8+
name: {{ include "oci-la-fluentd.name" . }}-objects-clusterrole
9+
apiGroup: rbac.authorization.k8s.io
10+
subjects:
11+
- kind: ServiceAccount
12+
name: {{ include "oci-la-fluentd.name" . }}-serviceaccount
13+
namespace: {{ default "kube-system" .Values.namespace }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "oci-la-fluentd.name" . }}-logs-configmap
5+
namespace: {{ default "kube-system" .Values.namespace }}
6+
data:
7+
# file-like keys
8+
{{- range $key, $value := .Values.fluentd.configMapLogsFiles }}
9+
{{ $key }}: |
10+
{{- include "common.tplvalues.render" (dict "value" $value "context" $) | nindent 4 }}
11+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "oci-la-fluentd.name" . }}-objects-configmap
5+
namespace: {{ default "kube-system" .Values.namespace }}
6+
data:
7+
# file-like keys
8+
{{- range $key, $value := .Values.fluentd.configMapObjectsFiles }}
9+
{{ $key }}: |
10+
{{- include "common.tplvalues.render" (dict "value" $value "context" $) | nindent 4 }}
11+
{{- end }}

0 commit comments

Comments
 (0)