diff --git a/infrastructures/logstash/base/kustomization.yaml b/infrastructures/logstash/base/kustomization.yaml new file mode 100644 index 0000000..2f2e238 --- /dev/null +++ b/infrastructures/logstash/base/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +helmCharts: + - name: logstash + repo: oci://registry-1.docker.io/bitnamicharts + version: 6.2.14 + releaseName: logstash + valuesFile: values.yaml \ No newline at end of file diff --git a/infrastructures/logstash/base/values.yaml b/infrastructures/logstash/base/values.yaml new file mode 100644 index 0000000..8a4af77 --- /dev/null +++ b/infrastructures/logstash/base/values.yaml @@ -0,0 +1,50 @@ +clusterDomain: logstash.logstash.svc.cluster.local +diagnosticMode: true +input: "" +output: "" +existingConfiguration: "logstash-pipelines" +enableMultiplePipelines: true +extraVolumes: + - name: logstash-pipeline-configs + hostPath: + path: /mnt/nfs/AppData/logstash/config + type: Directory +extraVolumeMounts: + - name: logstash-pipeline-configs + mountPath: /opt/bitnami/logstash/config/ +containerPorts: + - name: http + containerPort: 8080 + protocol: TCP + - name: monitoring + containerPort: 9600 + protocol: TCP + - name: syslog-udp + containerPort: 1514 + protocol: UDP + - name: syslog-tcp + containerPort: 1514 + protocol: TCP +service: + type: LoadBalancer + ports: + - name: http + port: 8080 + targetPort: http + protocol: TCP + - name: monitoring + port: 9600 + targetPort: monitoring + protocol: TCP + - name: syslog-udp + port: 1514 + targetPort: syslog-udp + protocol: UDP + - name: syslog-tcp + port: 1514 + targetPort: syslog-tcp + protocol: TCP +persistence: + enabled: true + existingClaim: logstash-data-pvc + size: 16Gi diff --git a/infrastructures/logstash/env/k3s-cluster/config.json b/infrastructures/logstash/env/k3s-cluster/config.json new file mode 100644 index 0000000..50de5ab --- /dev/null +++ b/infrastructures/logstash/env/k3s-cluster/config.json @@ -0,0 +1,12 @@ +{ + "appName": "logstash", + "userGivenName": "logstash", + "namespace": "logstash", + "destNamespace": "logstash", + "destServer": "https://kubernetes.default.svc", + "srcPath": "infrastructures/logstash/env/k3s-cluster", + "srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git", + "srcTargetRevision": "", + "labels": null, + "annotations": null +} \ No newline at end of file diff --git a/infrastructures/logstash/env/k3s-cluster/kustomization.yaml b/infrastructures/logstash/env/k3s-cluster/kustomization.yaml new file mode 100644 index 0000000..6e22db3 --- /dev/null +++ b/infrastructures/logstash/env/k3s-cluster/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./pipelines.yaml + - ../../base \ No newline at end of file diff --git a/infrastructures/logstash/env/k3s-cluster/pipelines.yaml b/infrastructures/logstash/env/k3s-cluster/pipelines.yaml new file mode 100644 index 0000000..559f730 --- /dev/null +++ b/infrastructures/logstash/env/k3s-cluster/pipelines.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: logstash-pipelines + namespace: logstash +data: + pipelines.yaml: | + - pipeline.id: http + path.config: "/opt/bitnami/logstash/config/http.conf" + - pipeline.id: syslog + path.config: "/opt/bitnami/logstash/config/syslog.conf" diff --git a/resources/app-volumes/env/k3s-cluster/templates/logstash-data-pv.yaml b/resources/app-volumes/env/k3s-cluster/templates/logstash-data-pv.yaml new file mode 100644 index 0000000..d10502c --- /dev/null +++ b/resources/app-volumes/env/k3s-cluster/templates/logstash-data-pv.yaml @@ -0,0 +1,30 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: logstash-data-pv + namespace: logstash + labels: + type: local +spec: + storageClassName: local-path + volumeMode: Filesystem + capacity: + storage: 16Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + local: + path: "/mnt/nfs/AppData/logstash/data" + claimRef: + apiVersion: v1 + kind: PersistentVolumeClaim + name: logstash-data-pvc + namespace: logstash + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux \ No newline at end of file diff --git a/resources/app-volumes/env/k3s-cluster/templates/logstash-data-pvc.yaml b/resources/app-volumes/env/k3s-cluster/templates/logstash-data-pvc.yaml new file mode 100644 index 0000000..7c6c524 --- /dev/null +++ b/resources/app-volumes/env/k3s-cluster/templates/logstash-data-pvc.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: logstash-data-pvc + namespace: logstash + labels: + name: logstash-data-pvc +spec: + storageClassName: local-path + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 16Gi \ No newline at end of file