diff --git a/hack/manifests/clusterlogforwarder/base/clusterlogforwarder.yaml b/hack/manifests/clusterlogforwarder/base/clusterlogforwarder.yaml index effbb8fed..f2c767bb0 100644 --- a/hack/manifests/clusterlogforwarder/base/clusterlogforwarder.yaml +++ b/hack/manifests/clusterlogforwarder/base/clusterlogforwarder.yaml @@ -11,9 +11,8 @@ spec: serviceAccount: name: logcollector pipelines: - - name: infra + - name: app inputRefs: - application - - infrastructure outputRefs: - replaceme diff --git a/hack/manifests/clusterlogforwarder/overlays/dynamic/kustomization.yaml b/hack/manifests/clusterlogforwarder/overlays/dynamic/kustomization.yaml new file mode 100644 index 000000000..4b0a659d5 --- /dev/null +++ b/hack/manifests/clusterlogforwarder/overlays/dynamic/kustomization.yaml @@ -0,0 +1,19 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../base + +patches: +- patch: |- + - op: replace + path: /spec/pipelines/0/outputRefs/0 + value: dynamic-receiver + - op: add + path: /spec/outputs + value: + - name: dynamic-receiver + type: http + http: + url: http://dynamic-receiver.openshift-logging.svc:8080 + target: + kind: ClusterLogForwarder \ No newline at end of file diff --git a/hack/manifests/clusterlogforwarder/overlays/http/kustomization.yaml b/hack/manifests/clusterlogforwarder/overlays/http/kustomization.yaml new file mode 100644 index 000000000..7484ea8a3 --- /dev/null +++ b/hack/manifests/clusterlogforwarder/overlays/http/kustomization.yaml @@ -0,0 +1,19 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../base + +patches: +- patch: |- + - op: replace + path: /spec/pipelines/0/outputRefs/0 + value: http-receiver + - op: add + path: /spec/outputs + value: + - name: http-receiver + type: http + http: + url: http://http-receiver.openshift-logging.svc:8090 + target: + kind: ClusterLogForwarder \ No newline at end of file diff --git a/hack/manifests/clusterlogforwarder/overlays/loadbalancer/kustomization.yaml b/hack/manifests/clusterlogforwarder/overlays/loadbalancer/kustomization.yaml new file mode 100644 index 000000000..ad976a0e0 --- /dev/null +++ b/hack/manifests/clusterlogforwarder/overlays/loadbalancer/kustomization.yaml @@ -0,0 +1,19 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../base + +patches: +- patch: |- + - op: replace + path: /spec/pipelines/0/outputRefs/0 + value: http-receiver + - op: add + path: /spec/outputs + value: + - name: http-receiver + type: http + http: + url: http://loadbalancer.openshift-logging.svc:8888 + target: + kind: ClusterLogForwarder \ No newline at end of file diff --git a/hack/manifests/clusterlogforwarder/overlays/lokistack/kustomization.yaml b/hack/manifests/clusterlogforwarder/overlays/lokistack/kustomization.yaml index e57b72043..20bd7686c 100644 --- a/hack/manifests/clusterlogforwarder/overlays/lokistack/kustomization.yaml +++ b/hack/manifests/clusterlogforwarder/overlays/lokistack/kustomization.yaml @@ -28,7 +28,7 @@ patches: token: from: serviceAccount target: - namespace: openshift-logging-storage + namespace: openshift-logging name: lokistack-dev tls: ca: diff --git a/hack/manifests/clusterlogforwarder/overlays/syslog/udp/kustomization.yaml b/hack/manifests/clusterlogforwarder/overlays/syslog/udp/kustomization.yaml new file mode 100644 index 000000000..20bd25ba6 --- /dev/null +++ b/hack/manifests/clusterlogforwarder/overlays/syslog/udp/kustomization.yaml @@ -0,0 +1,27 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../../base + +patches: +- patch: |- + - op: replace + path: /spec/pipelines/0/outputRefs/0 + value: rsyslog + - op: add + path: /spec/outputs + value: + - name: rsyslog + type: syslog + syslog: + tuning: + deliveryMode: AtLeastOnce + url: 'udp://rsyslog-service.openshift-logging.svc.cluster.local:514' + rfc: RFC5424 + facility: local0 + enrichment: KubernetesMinimal + appName: '{.systemd.u.SYSLOG_IDENTIFIER||.log_type||"-"}' + procId: '{.systemd.t.PID||"-"}' + msgId: '{.systemd.u.MESSAGE_ID||"-"}' + target: + kind: ClusterLogForwarder \ No newline at end of file diff --git a/hack/manifests/log-generator/base/kustomization.yaml b/hack/manifests/log-generator/base/kustomization.yaml new file mode 100644 index 000000000..60e9fbbb3 --- /dev/null +++ b/hack/manifests/log-generator/base/kustomization.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: test-workload +labels: + - pairs: + app.kubernetes.io/name: log-generator + app.kubernetes.io/component: log-generator + app.kubernetes.io/part-of: cluster-logging + includeSelectors: true + includeTemplates: true +resources: +- namespace.yaml +- log_generator_deployment.yaml +- servicemonitor.yaml +- service.yaml diff --git a/hack/manifests/log-generator/base/log_generator_deployment.yaml b/hack/manifests/log-generator/base/log_generator_deployment.yaml new file mode 100644 index 000000000..60f3bc104 --- /dev/null +++ b/hack/manifests/log-generator/base/log_generator_deployment.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: log-generator +spec: + replicas: 1 + template: + spec: + containers: + - name: log-generator + env: + - name: LOGS_PER_SECOND + value: "1" + - name: PAYLOAD_SIZE + value: "512" + image: quay.io/openshift-logging/cluster-logging-load-client:latest + imagePullPolicy: Always + args: + - --logs-per-second=$(LOGS_PER_SECOND) + - --synthetic-payload-size=$(PAYLOAD_SIZE) + - --log-type=synthetic + ports: + - containerPort: 8081 + name: metrics + protocol: TCP diff --git a/hack/manifests/log-generator/base/namespace.yaml b/hack/manifests/log-generator/base/namespace.yaml new file mode 100644 index 000000000..2f2db4607 --- /dev/null +++ b/hack/manifests/log-generator/base/namespace.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: test-workload +spec: + finalizers: + - kubernetes diff --git a/hack/manifests/log-generator/base/service.yaml b/hack/manifests/log-generator/base/service.yaml new file mode 100644 index 000000000..f6d4dd498 --- /dev/null +++ b/hack/manifests/log-generator/base/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: log-generator +spec: + ports: + - name: metrics + port: 8081 + protocol: TCP + targetPort: metrics \ No newline at end of file diff --git a/hack/manifests/log-generator/base/servicemonitor.yaml b/hack/manifests/log-generator/base/servicemonitor.yaml new file mode 100644 index 000000000..4eaa864aa --- /dev/null +++ b/hack/manifests/log-generator/base/servicemonitor.yaml @@ -0,0 +1,15 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: log-generator +spec: + selector: + app.kubernetes.io/name: log-generator + app.kubernetes.io/component: log-generator + app.kubernetes.io/part-of: cluster-logging + endpoints: + - port: metrics + jobLabel: monitor-log-generator + podTargetLabels: + - app.kubernetes.io/name + - app.kubernetes.io/component diff --git a/hack/manifests/log-generator/overlays/by_payload_size/1024b_0001lps/kustomization.yaml b/hack/manifests/log-generator/overlays/by_payload_size/1024b_0001lps/kustomization.yaml new file mode 100644 index 000000000..c342e0042 --- /dev/null +++ b/hack/manifests/log-generator/overlays/by_payload_size/1024b_0001lps/kustomization.yaml @@ -0,0 +1,16 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../../base + +patches: +- patch: |- + - op: replace + path: /spec/template/spec/containers/0/env + value: + - name: LOGS_PER_SECOND + value: "1" + - name: PAYLOAD_SIZE + value: "1024" + target: + kind: Deployment \ No newline at end of file diff --git a/hack/manifests/log-generator/overlays/logtype/application/kustomization.yaml b/hack/manifests/log-generator/overlays/logtype/application/kustomization.yaml new file mode 100644 index 000000000..eed8d1327 --- /dev/null +++ b/hack/manifests/log-generator/overlays/logtype/application/kustomization.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../../base + +patches: +- patch: |- + - op: replace + path: /spec/template/spec/containers/0/args + value: + - --logs-per-second=$(LOGS_PER_SECOND) + - --log-type=application + - --log-format=raw + target: + kind: Deployment \ No newline at end of file diff --git a/hack/manifests/lokistack/deploy.sh b/hack/manifests/lokistack/deploy.sh deleted file mode 100755 index 9b2fa2d37..000000000 --- a/hack/manifests/lokistack/deploy.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/bash - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-$(aws configure get aws_access_key_id)} -AWS_BUCKET_NAME=${AWS_BUCKET_NAME:-$(whoami)-$(date +'%m%d')} -AWS_PROFILE=${AWS_PROFILE:-openshift-dev} -AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-$(aws configure get aws_secret_access_key)} -REGION=${REGION:-us-east-1} -LOKI_SECRET_NAME=${LOKI_SECRET_NAME:-loki-s3} -DEPLOY_NAMESPACE=openshift-logging-storage - - -# create the s3 storage -function prep-s3-storage() { - if aws s3api get-bucket-location --bucket ${AWS_BUCKET_NAME} > /dev/null 2>&1 ; then - echo -e "\n s3 bucket \"${AWS_BUCKET_NAME}\" found" - else - echo -e "\n creating s3 bucket: ${AWS_BUCKET_NAME}" - if [[ "${REGION}" = "us-east-1" ]] ; then - aws s3api create-bucket --acl private --region ${REGION} --bucket ${AWS_BUCKET_NAME} - else - aws s3api create-bucket --acl private --region ${REGION} --bucket ${AWS_BUCKET_NAME} \ - --create-bucket-configuration LocationConstraint=${REGION} - fi - fi -} - -# create storage secret -function create-storage-secret() { - oc -n ${DEPLOY_NAMESPACE} delete secret --force ${LOKI_SECRET_NAME}||: - oc -n ${DEPLOY_NAMESPACE} create secret generic ${LOKI_SECRET_NAME} \ - --from-literal=region=${REGION} \ - --from-literal=bucketnames=${AWS_BUCKET_NAME} \ - --from-literal=access_key_id=${AWS_ACCESS_KEY_ID} \ - --from-literal=access_key_secret=${AWS_SECRET_ACCESS_KEY} \ - --from-literal=endpoint=https://s3.${REGION}.amazonaws.com -} - -oc apply -k ${SCRIPT_DIR}/operator -oc wait --for=create crd/lokistacks.loki.grafana.com --timeout=30s -prep-s3-storage -oc -n ${DEPLOY_NAMESPACE} wait --for=jsonpath='{.status.phase}'=Running -lapp.kubernetes.io/name=loki-operator pod -oc apply -f ${SCRIPT_DIR}/lokistack/namespace.yaml -create-storage-secret -oc apply -k ${SCRIPT_DIR}/lokistack diff --git a/hack/manifests/lokistack/lokistack/kustomization.yaml b/hack/manifests/observability-operators/cluster-logging-operator/kustomization.yaml similarity index 55% rename from hack/manifests/lokistack/lokistack/kustomization.yaml rename to hack/manifests/observability-operators/cluster-logging-operator/kustomization.yaml index 76dbd9ce9..ccb7b1a93 100644 --- a/hack/manifests/lokistack/lokistack/kustomization.yaml +++ b/hack/manifests/observability-operators/cluster-logging-operator/kustomization.yaml @@ -1,6 +1,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: openshift-logging-storage +namespace: openshift-logging resources: - namespace.yaml - - loki_stack.yaml \ No newline at end of file + - operator_group.yaml + - subscription.yaml diff --git a/hack/manifests/lokistack/lokistack/namespace.yaml b/hack/manifests/observability-operators/cluster-logging-operator/namespace.yaml similarity index 74% rename from hack/manifests/lokistack/lokistack/namespace.yaml rename to hack/manifests/observability-operators/cluster-logging-operator/namespace.yaml index 2e6c9c51a..d7f75c29a 100644 --- a/hack/manifests/lokistack/lokistack/namespace.yaml +++ b/hack/manifests/observability-operators/cluster-logging-operator/namespace.yaml @@ -2,13 +2,13 @@ apiVersion: v1 kind: Namespace metadata: labels: - kubernetes.io/metadata.name: openshift-logging-storage + kubernetes.io/metadata.name: openshift-logging openshift.io/cluster-monitoring: "true" pod-security.kubernetes.io/audit: privileged pod-security.kubernetes.io/enforce: privileged pod-security.kubernetes.io/warn: privileged security.openshift.io/scc.podSecurityLabelSync: "false" - name: openshift-logging-storage + name: openshift-logging spec: finalizers: - - kubernetes \ No newline at end of file + - kubernetes diff --git a/hack/manifests/observability-operators/cluster-logging-operator/operator_group.yaml b/hack/manifests/observability-operators/cluster-logging-operator/operator_group.yaml new file mode 100644 index 000000000..93d0aa997 --- /dev/null +++ b/hack/manifests/observability-operators/cluster-logging-operator/operator_group.yaml @@ -0,0 +1,7 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: cluster-logging-operator + namespace: openshift-logging +spec: + targetNamespaces: [] diff --git a/hack/manifests/observability-operators/cluster-logging-operator/subscription.yaml b/hack/manifests/observability-operators/cluster-logging-operator/subscription.yaml new file mode 100644 index 000000000..db623adf0 --- /dev/null +++ b/hack/manifests/observability-operators/cluster-logging-operator/subscription.yaml @@ -0,0 +1,10 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: cluster-logging-operator + namespace: openshift-logging +spec: + channel: stable-6.2 + name: cluster-logging + source: redhat-operators + sourceNamespace: openshift-marketplace \ No newline at end of file diff --git a/hack/manifests/observability-operators/cluster-observability-operator/kustomization.yaml b/hack/manifests/observability-operators/cluster-observability-operator/kustomization.yaml new file mode 100644 index 000000000..abbb674c0 --- /dev/null +++ b/hack/manifests/observability-operators/cluster-observability-operator/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: openshift-cluster-observability-operator +resources: + - namespace.yaml + - operator_group.yaml + - subscription.yaml diff --git a/hack/manifests/observability-operators/cluster-observability-operator/namespace.yaml b/hack/manifests/observability-operators/cluster-observability-operator/namespace.yaml new file mode 100644 index 000000000..9f2b944b5 --- /dev/null +++ b/hack/manifests/observability-operators/cluster-observability-operator/namespace.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Namespace +metadata: + labels: + kubernetes.io/metadata.name: openshift-cluster-observability-operator + openshift.io/cluster-monitoring: "true" + pod-security.kubernetes.io/audit: privileged + pod-security.kubernetes.io/enforce: privileged + pod-security.kubernetes.io/warn: privileged + security.openshift.io/scc.podSecurityLabelSync: "false" + name: openshift-cluster-observability-operator +spec: + finalizers: + - kubernetes diff --git a/hack/manifests/observability-operators/cluster-observability-operator/operator_group.yaml b/hack/manifests/observability-operators/cluster-observability-operator/operator_group.yaml new file mode 100644 index 000000000..cfd5bd240 --- /dev/null +++ b/hack/manifests/observability-operators/cluster-observability-operator/operator_group.yaml @@ -0,0 +1,6 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: cluster-observability-operator +spec: + targetNamespaces: [] diff --git a/hack/manifests/observability-operators/cluster-observability-operator/subscription.yaml b/hack/manifests/observability-operators/cluster-observability-operator/subscription.yaml new file mode 100644 index 000000000..89e233ccd --- /dev/null +++ b/hack/manifests/observability-operators/cluster-observability-operator/subscription.yaml @@ -0,0 +1,9 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: cluster-observability-operator +spec: + channel: stable + name: cluster-observability-operator + source: redhat-operators + sourceNamespace: openshift-marketplace diff --git a/hack/manifests/observability-operators/garage/README.md b/hack/manifests/observability-operators/garage/README.md new file mode 100644 index 000000000..0d06e341f --- /dev/null +++ b/hack/manifests/observability-operators/garage/README.md @@ -0,0 +1,21 @@ +# Garage S3 Storage for Loki Operator + +Deploys [Garage](https://garagehq.deuxfleurs.fr/) as an S3-compatible object storage backend for testing the Loki Operator on OpenShift. + +Uses Garage's `--single-node` and `--default-bucket` flags to automatically configure the cluster layout, create a `loki` bucket, and provision access keys on first startup — no manual setup required. + +Furthermore, a secret named `test` will be deployed to allow easy integration with the LokiStack manifests we have upstream + +## Deploy + +```bash +oc apply -k manifests/garage/ +oc wait pod --for=condition=Ready -n openshift-logging -l app.kubernetes.io/name=garage --timeout=120s +``` + +## Verify + +```bash +oc exec -n openshift-logging garage-0 -- /garage bucket list +oc exec -n openshift-logging garage-0 -- /garage key list +``` diff --git a/hack/manifests/observability-operators/garage/config/garage.toml b/hack/manifests/observability-operators/garage/config/garage.toml new file mode 100644 index 000000000..d09443548 --- /dev/null +++ b/hack/manifests/observability-operators/garage/config/garage.toml @@ -0,0 +1,22 @@ +metadata_dir = "/var/lib/garage/meta" +data_dir = "/var/lib/garage/data" +db_engine = "lmdb" + +replication_factor = 1 + +rpc_bind_addr = "[::]:3901" +rpc_public_addr = "127.0.0.1:3901" +rpc_secret = "ab2e3ac0f55e3ac0f55e3ac0f55e3ac0f55e3ac0f55e3ac0f55e3ac0f55e3ac0" + +[s3_api] +s3_region = "garage" +api_bind_addr = "[::]:3900" +root_domain = ".s3.garage.localhost" + +[s3_web] +bind_addr = "[::]:3902" +root_domain = ".web.garage.localhost" +index = "index.html" + +[admin] +api_bind_addr = "[::]:3903" diff --git a/hack/manifests/observability-operators/garage/kustomization.yaml b/hack/manifests/observability-operators/garage/kustomization.yaml new file mode 100644 index 000000000..db82bdeee --- /dev/null +++ b/hack/manifests/observability-operators/garage/kustomization.yaml @@ -0,0 +1,17 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: openshift-logging +labels: +- pairs: + app.kubernetes.io/name: garage + includeSelectors: true +resources: +- statefulset.yaml +- service.yaml +- servicemonitor.yaml +- prometheus-rbac.yaml +- storage-secret.yaml +configMapGenerator: +- name: garage-config + files: + - config/garage.toml diff --git a/hack/manifests/observability-operators/garage/prometheus-rbac.yaml b/hack/manifests/observability-operators/garage/prometheus-rbac.yaml new file mode 100644 index 000000000..18f771931 --- /dev/null +++ b/hack/manifests/observability-operators/garage/prometheus-rbac.yaml @@ -0,0 +1,24 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: prometheus-k8s +rules: +- apiGroups: [""] + resources: [services, endpoints, pods] + verbs: [get, list, watch] +- apiGroups: [discovery.k8s.io] + resources: [endpointslices] + verbs: [get, list, watch] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: prometheus-k8s +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: prometheus-k8s +subjects: +- kind: ServiceAccount + name: prometheus-k8s + namespace: openshift-monitoring diff --git a/hack/manifests/observability-operators/garage/service.yaml b/hack/manifests/observability-operators/garage/service.yaml new file mode 100644 index 000000000..e6bb29a83 --- /dev/null +++ b/hack/manifests/observability-operators/garage/service.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + name: garage +spec: + ports: + - name: s3-api + port: 3900 + protocol: TCP + targetPort: 3900 + - name: rpc + port: 3901 + protocol: TCP + targetPort: 3901 + - name: s3-web + port: 3902 + protocol: TCP + targetPort: 3902 + - name: admin + port: 3903 + protocol: TCP + targetPort: 3903 + type: ClusterIP diff --git a/hack/manifests/observability-operators/garage/servicemonitor.yaml b/hack/manifests/observability-operators/garage/servicemonitor.yaml new file mode 100644 index 000000000..c0596615f --- /dev/null +++ b/hack/manifests/observability-operators/garage/servicemonitor.yaml @@ -0,0 +1,14 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: garage +spec: + endpoints: + - path: /metrics + port: admin + scheme: http + jobLabel: app.kubernetes.io/name + selector: + matchLabels: + app.kubernetes.io/name: garage + serviceDiscoveryRole: EndpointSlice diff --git a/hack/manifests/observability-operators/garage/statefulset.yaml b/hack/manifests/observability-operators/garage/statefulset.yaml new file mode 100644 index 000000000..2d0fd3a0b --- /dev/null +++ b/hack/manifests/observability-operators/garage/statefulset.yaml @@ -0,0 +1,63 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: garage +spec: + serviceName: garage + replicas: 1 + template: + spec: + containers: + - name: garage + image: dxflrs/garage:v2.3.0 + command: + - /garage + - server + - --single-node + - --default-bucket + env: + - name: GARAGE_CONFIG_FILE + value: /etc/garage/garage.toml + - name: GARAGE_DEFAULT_ACCESS_KEY + valueFrom: + secretKeyRef: + key: access_key_id + name: test + - name: GARAGE_DEFAULT_SECRET_KEY + valueFrom: + secretKeyRef: + key: access_key_secret + name: test + - name: GARAGE_DEFAULT_BUCKET + valueFrom: + secretKeyRef: + key: bucketnames + name: test + ports: + - name: s3-api + containerPort: 3900 + - name: rpc + containerPort: 3901 + - name: s3-web + containerPort: 3902 + - name: admin + containerPort: 3903 + volumeMounts: + - name: data + mountPath: /var/lib/garage + - name: config + mountPath: /etc/garage + readOnly: true + volumes: + - name: config + configMap: + name: garage-config + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/hack/manifests/observability-operators/garage/storage-secret.yaml b/hack/manifests/observability-operators/garage/storage-secret.yaml new file mode 100644 index 000000000..0389ae138 --- /dev/null +++ b/hack/manifests/observability-operators/garage/storage-secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + name: test +stringData: + endpoint: http://garage.openshift-logging.svc:3900 + bucketnames: loki + access_key_id: GKgarageaccesskey0000 + access_key_secret: garagesecretkey1234567890abcdefgh + region: garage +type: Opaque diff --git a/hack/manifests/observability-operators/kustomization.yaml b/hack/manifests/observability-operators/kustomization.yaml new file mode 100644 index 000000000..5ff340e57 --- /dev/null +++ b/hack/manifests/observability-operators/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- garage +- cluster-observability-operator +- loki-operator +- cluster-logging-operator \ No newline at end of file diff --git a/hack/manifests/lokistack/operator/kustomization.yaml b/hack/manifests/observability-operators/loki-operator/kustomization.yaml similarity index 100% rename from hack/manifests/lokistack/operator/kustomization.yaml rename to hack/manifests/observability-operators/loki-operator/kustomization.yaml diff --git a/hack/manifests/lokistack/operator/namespace.yaml b/hack/manifests/observability-operators/loki-operator/namespace.yaml similarity index 100% rename from hack/manifests/lokistack/operator/namespace.yaml rename to hack/manifests/observability-operators/loki-operator/namespace.yaml diff --git a/hack/manifests/lokistack/operator/operator_group.yaml b/hack/manifests/observability-operators/loki-operator/operator_group.yaml similarity index 100% rename from hack/manifests/lokistack/operator/operator_group.yaml rename to hack/manifests/observability-operators/loki-operator/operator_group.yaml diff --git a/hack/manifests/lokistack/operator/subscription.yaml b/hack/manifests/observability-operators/loki-operator/subscription.yaml similarity index 91% rename from hack/manifests/lokistack/operator/subscription.yaml rename to hack/manifests/observability-operators/loki-operator/subscription.yaml index 860ef8966..af4805275 100644 --- a/hack/manifests/lokistack/operator/subscription.yaml +++ b/hack/manifests/observability-operators/loki-operator/subscription.yaml @@ -4,7 +4,7 @@ metadata: name: loki-operator namespace: openshift-operators-redhat spec: - channel: stable-6.4 + channel: stable-6.6 name: loki-operator source: redhat-operators sourceNamespace: openshift-marketplace \ No newline at end of file diff --git a/hack/manifests/receivers/base/kustomization.yaml b/hack/manifests/receivers/base/kustomization.yaml new file mode 100644 index 000000000..1e6469914 --- /dev/null +++ b/hack/manifests/receivers/base/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: openshift-logging +generatorOptions: + disableNameSuffixHash: true \ No newline at end of file diff --git a/hack/manifests/receivers/dynamic/Dockerfile b/hack/manifests/receivers/dynamic/Dockerfile new file mode 100644 index 000000000..860cd3588 --- /dev/null +++ b/hack/manifests/receivers/dynamic/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.25 AS builder + +WORKDIR /build + +COPY main.go . + +RUN CGO_ENABLED=0 go build -o app main.go + +FROM registry.access.redhat.com/ubi9/ubi:latest + +WORKDIR /app + +COPY --from=builder /build/app . + +EXPOSE 8080 + +CMD ["/app/app"] diff --git a/hack/manifests/receivers/dynamic/README.md b/hack/manifests/receivers/dynamic/README.md new file mode 100644 index 000000000..a3cf96e8f --- /dev/null +++ b/hack/manifests/receivers/dynamic/README.md @@ -0,0 +1,12 @@ +# Dynamic Receiver + +This is a manifest for a receiver capable of receiving logs over +a plain http transport. It is designed to create or teardown its +server based upon the configuration setting. This is to simulate +load balancer behavior where the service is available from the client +perspective but the backing receiver is not available. The intent of +this deployment is to expose how the collector behaves when the +receiver goes away and comes back. + +* Does the collector recover? Do logs begin to flow again? +* Is the collector wedged trying to use stale sockets or connections? diff --git a/hack/manifests/receivers/dynamic/go.mod b/hack/manifests/receivers/dynamic/go.mod new file mode 100644 index 000000000..2ef3eca02 --- /dev/null +++ b/hack/manifests/receivers/dynamic/go.mod @@ -0,0 +1,3 @@ +module github.com/openshift/cluster-logging-operator/log-gen/dynamic-receiver + +go 1.25 diff --git a/hack/manifests/receivers/dynamic/kustomization.yaml b/hack/manifests/receivers/dynamic/kustomization.yaml new file mode 100644 index 000000000..aaf376103 --- /dev/null +++ b/hack/manifests/receivers/dynamic/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +labels: + - pairs: + app.kubernetes.io/name: dynamic + app.kubernetes.io/component: dynamic + app.kubernetes.io/part-of: cluster-logging + includeSelectors: true + includeTemplates: true +resources: + - manifest.yaml \ No newline at end of file diff --git a/hack/manifests/receivers/dynamic/main.go b/hack/manifests/receivers/dynamic/main.go new file mode 100644 index 000000000..5cca46ab8 --- /dev/null +++ b/hack/manifests/receivers/dynamic/main.go @@ -0,0 +1,233 @@ +package main + +import ( + "bufio" + "encoding/json" + "fmt" + "io" + "net" + "net/http" + "os" + "sync" + "time" +) + +const ConfigPath = "/config/config.json" + +type Config struct { + Listen bool `json:"listen"` +} + +type Server struct { + listener net.Listener + stopChan chan struct{} + wg sync.WaitGroup + activeClients []net.Conn + mu sync.Mutex +} + +func (s *Server) Start() error { + var err error + s.listener, err = net.Listen("tcp", "0.0.0.0:8080") + if err != nil { + return err + } + + s.stopChan = make(chan struct{}) + s.activeClients = make([]net.Conn, 0) + + s.wg.Add(1) + go s.acceptLoop() + + fmt.Println("[SERVER] TCP Server listening on port 8080...") + return nil +} + +func (s *Server) acceptLoop() { + defer s.wg.Done() + + for { + s.listener.(*net.TCPListener).SetDeadline(time.Now().Add(1 * time.Second)) + + conn, err := s.listener.Accept() + if err != nil { + select { + case <-s.stopChan: + return + default: + if netErr, ok := err.(net.Error); ok && netErr.Timeout() { + continue + } + return + } + } + + fmt.Printf("[SERVER] Connection accepted from %s\n", conn.RemoteAddr()) + + s.mu.Lock() + s.activeClients = append(s.activeClients, conn) + s.mu.Unlock() + + s.wg.Add(1) + go s.handleClient(conn) + } +} + +func (s *Server) handleClient(conn net.Conn) { + defer s.wg.Done() + defer conn.Close() + defer s.removeClient(conn) + + reader := bufio.NewReader(conn) + + for { + conn.SetReadDeadline(time.Now().Add(30 * time.Second)) + + req, err := http.ReadRequest(reader) + if err != nil { + if err != io.EOF { + fmt.Printf("[SERVER] Failed to parse HTTP request: %v\n", err) + } + return + } + + body, err := io.ReadAll(req.Body) + req.Body.Close() + if err != nil { + fmt.Printf("[SERVER] Failed to read request body: %v\n", err) + s.sendResponseWithConnection(conn, http.StatusBadRequest, "Bad Request", false) + return + } + + if len(body) > 0 { + maxLen := 100 + if len(body) < maxLen { + maxLen = len(body) + } + fmt.Printf("[STDOUT] %s\n", string(body[:maxLen])) + } + + keepAlive := shouldKeepAlive(req) + s.sendResponseWithConnection(conn, http.StatusOK, "OK", keepAlive) + + if !keepAlive { + return + } + + conn.SetReadDeadline(time.Now().Add(90 * time.Second)) + } +} + +func (s *Server) sendResponse(conn net.Conn, statusCode int, statusText string) { + s.sendResponseWithConnection(conn, statusCode, statusText, false) +} + +func (s *Server) sendResponseWithConnection(conn net.Conn, statusCode int, statusText string, keepAlive bool) { + connectionHeader := "close" + if keepAlive { + connectionHeader = "keep-alive" + } + response := fmt.Sprintf("HTTP/1.1 %d %s\r\nContent-Length: 0\r\nConnection: %s\r\n\r\n", statusCode, statusText, connectionHeader) + conn.Write([]byte(response)) +} + +func shouldKeepAlive(req *http.Request) bool { + if req.ProtoMajor < 1 || (req.ProtoMajor == 1 && req.ProtoMinor < 1) { + return false + } + + connectionHeader := req.Header.Get("Connection") + if connectionHeader == "close" { + return false + } + + return true +} + +func (s *Server) removeClient(conn net.Conn) { + s.mu.Lock() + defer s.mu.Unlock() + for i, c := range s.activeClients { + if c == conn { + s.activeClients = append(s.activeClients[:i], s.activeClients[i+1:]...) + break + } + } +} + +func (s *Server) Stop() { + fmt.Println("[SERVER] Initiating silent black-hole teardown...") + + close(s.stopChan) + + s.mu.Lock() + for _, conn := range s.activeClients { + if tcpConn, ok := conn.(*net.TCPConn); ok { + tcpConn.SetLinger(0) + } + } + s.activeClients = nil + s.mu.Unlock() + + if s.listener != nil { + s.listener.Close() + } + + s.wg.Wait() + + fmt.Println("[SERVER] Server ghosted active clients and shut down listener.") +} + +func readConfig() (bool, error) { + if _, err := os.Stat(ConfigPath); os.IsNotExist(err) { + return false, nil + } + + data, err := os.ReadFile(ConfigPath) + if err != nil { + return false, err + } + + var config Config + if err := json.Unmarshal(data, &config); err != nil { + return false, err + } + + return config.Listen, nil +} + +func main() { + var server *Server + var lastState *bool + + fmt.Println("[MAIN] Application loop online. Watching config changes...") + + for { + currentListen, err := readConfig() + if err != nil { + fmt.Printf("[MAIN] Error checking config: %v\n", err) + time.Sleep(2 * time.Second) + continue + } + + if lastState == nil || currentListen != *lastState { + fmt.Printf("[MAIN] State change detected! listen = %t\n", currentListen) + + if currentListen { + server = &Server{} + if err := server.Start(); err != nil { + fmt.Printf("[SERVER] Failed to start server: %v\n", err) + } + } else { + if server != nil { + server.Stop() + server = nil + } + } + + lastState = ¤tListen + } + + time.Sleep(2 * time.Second) + } +} diff --git a/hack/manifests/receivers/dynamic/manifest.yaml b/hack/manifests/receivers/dynamic/manifest.yaml new file mode 100644 index 000000000..1be3ac099 --- /dev/null +++ b/hack/manifests/receivers/dynamic/manifest.yaml @@ -0,0 +1,48 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: dynamic-config +data: + config.json: | + { + "listen": true + } +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dynamic-receiver +spec: + replicas: 1 + selector: + matchLabels: + app: dynamic-receiver + template: + metadata: + labels: + app: dynamic-receiver + spec: + containers: + - name: go-app + image: quay.io/jcantril/vector:dynamic + imagePullPolicy: Always + ports: + - containerPort: 8080 + volumeMounts: + - name: config-volume + mountPath: /config + volumes: + - name: config-volume + configMap: + name: dynamic-config +--- +apiVersion: v1 +kind: Service +metadata: + name: dynamic-receiver +spec: + ports: + - port: 8080 + targetPort: 8080 + selector: + app: dynamic-receiver \ No newline at end of file diff --git a/hack/manifests/receivers/http/http_receiver_configmap.yaml b/hack/manifests/receivers/http/http_receiver_configmap.yaml new file mode 100644 index 000000000..3e75469c6 --- /dev/null +++ b/hack/manifests/receivers/http/http_receiver_configmap.yaml @@ -0,0 +1,50 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: http-receiver + labels: + app.kubernetes.io/name: logging-benchmarking + app.kubernetes.io/component: receiver + app.kubernetes.io/instance: http +data: + vector.toml: | + [sources.my_source] + type = "http_server" + address = "0.0.0.0:8090" + decoding.codec = "json" + framing.method = "newline_delimited" + + [transforms.route_logs] + type = "route" + inputs = ["my_source"] + route.audit = '.log_type == "audit"' + route.container = 'exists(.kubernetes)' + route.journal = '!exists(.kubernetes)' + + [sinks.stdout] + inputs = ["route_logs.container", "route_logs.journal"] + type = "console" + encoding.codec = "json" + + [sinks.container] + inputs = ["route_logs.container"] + type = "file" + path = "/tmp/container/{{kubernetes.namespace_name}}_{{kubernetes.pod_name}}_{{kubernetes.container_name}}.json" + + [sinks.container.encoding] + codec = "json" + + [sinks.out_journal] + inputs = ["route_logs.journal"] + type = "file" + path = "/tmp/journal/journal.json" + + [sinks.out_journal.encoding] + codec = "json" + [sinks.out_audit] + inputs = ["route_logs.audit"] + type = "file" + path = "/tmp/audit/audit.json" + + [sinks.out_audit.encoding] + codec = "json" diff --git a/hack/manifests/receivers/http/http_receiver_deployment.yaml b/hack/manifests/receivers/http/http_receiver_deployment.yaml new file mode 100644 index 000000000..5a6bc0577 --- /dev/null +++ b/hack/manifests/receivers/http/http_receiver_deployment.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: http-receiver +spec: + replicas: 1 + template: + spec: + volumes: + - configMap: + defaultMode: 420 + name: http-receiver + name: config + containers: + - name: receiver + image: quay.io/openshift-logging/vector:latest + command: + - /usr/bin/vector + - --config-toml=/etc/vector/vector.toml + - --watch-config + ports: + - containerPort: 8090 + volumeMounts: + - mountPath: /etc/vector + name: config diff --git a/hack/manifests/receivers/http/http_receiver_service.yaml b/hack/manifests/receivers/http/http_receiver_service.yaml new file mode 100644 index 000000000..c4b82f000 --- /dev/null +++ b/hack/manifests/receivers/http/http_receiver_service.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: http-receiver +spec: + ports: + - port: 8090 + protocol: TCP +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# name: http-receiver +#spec: +# clusterIP: None # CRITICAL: This explicitly makes the service headless +# # selector: +# # app: targeted-receiver # Directs traffic straight to the pod matching this label +# ports: +# - port: 80 +# targetPort: 8090 diff --git a/hack/manifests/receivers/http/kustomization.yaml b/hack/manifests/receivers/http/kustomization.yaml new file mode 100644 index 000000000..ae7ce9aec --- /dev/null +++ b/hack/manifests/receivers/http/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +labels: + - pairs: + app.kubernetes.io/name: http + app.kubernetes.io/component: receiver + app.kubernetes.io/part-of: cluster-logging + includeSelectors: true + includeTemplates: true +resources: +- http_receiver_deployment.yaml +- http_receiver_configmap.yaml +- http_receiver_service.yaml \ No newline at end of file diff --git a/hack/manifests/receivers/loadbalancer/base/configmap.yaml b/hack/manifests/receivers/loadbalancer/base/configmap.yaml new file mode 100644 index 000000000..3339e4887 --- /dev/null +++ b/hack/manifests/receivers/loadbalancer/base/configmap.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-template-config +data: + # Notice the ${VARIABLE} syntax. We use braces to cleanly separate them from Nginx text. + nginx.conf.template: | + worker_processes auto; + pid /tmp/nginx.pid; # OpenShift non-root requirement + + events { + worker_connections ${WORKER_CONNECTIONS}; + } + + stream { + # Force DNS re-resolution to avoid stale IPs when backend pods restart + # DNS_RESOLVER is extracted from /etc/resolv.conf at container startup + resolver ${DNS_RESOLVER} valid=5s ipv6=off; + + # Use map to create a variable - required for dynamic DNS resolution + map $remote_addr $backend_address { + default ${TARGET_SERVICE}:${TARGET_PORT}; + } + + server { + listen 8888; + # Using a variable in proxy_pass forces per-connection DNS lookup + proxy_pass $backend_address; + proxy_timeout ${PROXY_TIMEOUT}; + + # Limit connection reuse to ensure fresh connections + proxy_socket_keepalive on; + } + } \ No newline at end of file diff --git a/hack/manifests/receivers/loadbalancer/base/deployment.yaml b/hack/manifests/receivers/loadbalancer/base/deployment.yaml new file mode 100644 index 000000000..9ebeccb34 --- /dev/null +++ b/hack/manifests/receivers/loadbalancer/base/deployment.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: loadbalancer +spec: + replicas: 1 + selector: + matchLabels: + app: loadbalancer + template: + metadata: + labels: + app: loadbalancer + spec: + containers: + - name: nginx + image: nginxinc/nginx-unprivileged:alpine + command: ["/bin/sh", "-c"] + args: + # Extract DNS resolver from /etc/resolv.conf and export it + # Then start nginx normally via the entrypoint + - | + export DNS_RESOLVER=$(awk '/^nameserver/ {print $2; exit}' /etc/resolv.conf) + exec /docker-entrypoint.sh nginx -g 'daemon off;' + env: + # 2. Define your custom injection variables here + - name: TARGET_SERVICE + value: "http-receiver.openshift-logging.svc.cluster.local" + - name: TARGET_PORT + value: "8080" + # 1. CRITICAL: Tell Nginx to output the finished template directly to the main config path + - name: NGINX_ENVSUBST_OUTPUT_DIR + value: "/etc/nginx" + - name: PROXY_TIMEOUT + value: "60s" + - name: WORKER_CONNECTIONS + value: "24" + + volumeMounts: + # Mount the template into Nginx's designated template scanning folder + - name: template-volume + mountPath: /etc/nginx/templates/nginx.conf.template + subPath: nginx.conf.template + ports: + - containerPort: 8888 + volumes: + - name: template-volume + configMap: + name: nginx-template-config \ No newline at end of file diff --git a/hack/manifests/receivers/loadbalancer/base/kustomization.yaml b/hack/manifests/receivers/loadbalancer/base/kustomization.yaml new file mode 100644 index 000000000..2ee30074a --- /dev/null +++ b/hack/manifests/receivers/loadbalancer/base/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +labels: + - pairs: + app.kubernetes.io/name: loadbalancer + app.kubernetes.io/component: loadbalancer + app.kubernetes.io/part-of: cluster-logging + includeSelectors: true + includeTemplates: true +resources: +- configmap.yaml +- deployment.yaml +- service.yaml \ No newline at end of file diff --git a/hack/manifests/receivers/loadbalancer/base/service.yaml b/hack/manifests/receivers/loadbalancer/base/service.yaml new file mode 100644 index 000000000..ef6ad93e0 --- /dev/null +++ b/hack/manifests/receivers/loadbalancer/base/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: loadbalancer +spec: + ports: + - port: 8888 + targetPort: 8888 + selector: + app: loadbalancer \ No newline at end of file diff --git a/hack/manifests/receivers/loadbalancer/overlays/http/kustomization.yaml b/hack/manifests/receivers/loadbalancer/overlays/http/kustomization.yaml new file mode 100644 index 000000000..b3c015133 --- /dev/null +++ b/hack/manifests/receivers/loadbalancer/overlays/http/kustomization.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../../base + +patches: +- patch: |- + - op: replace + path: /spec/template/spec/containers/0/env/0/value + value: http-receiver.openshift-logging.svc.cluster.local + - op: replace + path: /spec/template/spec/containers/0/env/1/value + value: "8090" + target: + kind: Deployment \ No newline at end of file diff --git a/hack/manifests/receivers/lokistack/kustomization.yaml b/hack/manifests/receivers/lokistack/kustomization.yaml new file mode 100644 index 000000000..77ec00ea0 --- /dev/null +++ b/hack/manifests/receivers/lokistack/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: openshift-logging +resources: + - loki_stack.yaml diff --git a/hack/manifests/lokistack/lokistack/loki_stack.yaml b/hack/manifests/receivers/lokistack/loki_stack.yaml similarity index 88% rename from hack/manifests/lokistack/lokistack/loki_stack.yaml rename to hack/manifests/receivers/lokistack/loki_stack.yaml index 8680309bc..fe2a44dcd 100644 --- a/hack/manifests/lokistack/lokistack/loki_stack.yaml +++ b/hack/manifests/receivers/lokistack/loki_stack.yaml @@ -13,7 +13,7 @@ spec: - version: v13 effectiveDate: '2023-10-15' secret: - name: loki-s3 + name: test type: s3 storageClassName: gp3-csi tenants: @@ -25,4 +25,4 @@ spec: openshift.io/cluster-monitoring: "true" namespaceSelector: matchLabels: - openshift.io/cluster-monitoring: "true" \ No newline at end of file + openshift.io/cluster-monitoring: "true" diff --git a/hack/manifests/receivers/syslog/configmap.yaml b/hack/manifests/receivers/syslog/configmap.yaml new file mode 100644 index 000000000..36078c305 --- /dev/null +++ b/hack/manifests/receivers/syslog/configmap.yaml @@ -0,0 +1,53 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + app: rsyslog-server + name: rsyslog-conf +data: + rsyslog.conf: | + #$ModLoad imuxsock + #$SystemLogSocketName /var/lib/rsyslog/rsyslog.sock + $ModLoad imudp + $UDPServerRun 55514 + $ModLoad imtcp + $InputTCPServerRun 55514 + template(name="DebugJsonFormat" type="list") { + constant(value="{") + property(name="timegenerated" format="jsonf") + constant(value=",") + property(name="timereported" format="jsonf") + constant(value=",") + property(name="hostname" format="jsonf") + constant(value=",") + property(name="syslogfacility-text" format="jsonf") + constant(value=",") + property(name="syslogpriority-text" format="jsonf") + constant(value=",") + property(name="syslogtag" format="jsonf") + constant(value=",") + property(name="programname" format="jsonf") + constant(value=",") + property(name="app-name" format="jsonf") + constant(value=",") + property(name="procid" format="jsonf") + constant(value=",") + property(name="msgid" format="jsonf") + constant(value=",") + property(name="msg" format="jsonf") + constant(value="}\n") + } + + # For vector + :app-name, isequal, "audit" action(type="omfile" File="/log/openshift-audit.log") + &stop + :app-name, isequal, "application" action(type="omfile" File="/log/openshift-app-container.log") + &stop + :app-name, isequal, "infrastructure" action(type="omfile" File="/log/openshift-infra-container.log") + &stop + :app-name, isequal, "eventrouter" action(type="omfile" File="/log/openshift-eventrouter.log") + &stop + + # Journal log + action(type="omfile" File="/log/openshift-journal.log") + &stop \ No newline at end of file diff --git a/hack/manifests/receivers/syslog/deployment.yaml b/hack/manifests/receivers/syslog/deployment.yaml new file mode 100644 index 000000000..8af1d8a21 --- /dev/null +++ b/hack/manifests/receivers/syslog/deployment.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: rsyslog-server + labels: + app: rsyslog-server +spec: + replicas: 1 + selector: + matchLabels: + app: rsyslog-server + template: + metadata: + labels: + app: rsyslog-server + spec: + containers: + - name: rsyslog-server + image: registry.redhat.io/rhel9/rsyslog:9.8-1780596788 + ports: + - containerPort: 55514 + name: tcp + protocol: TCP + - containerPort: 55514 + name: udp + protocol: UDP + volumeMounts: + - mountPath: /etc/rsyslog + name: rsyslog-conf + - mountPath: /log + name: log + command: ["/usr/sbin/rsyslogd", "-i", "/tmp/rsyslog.pid", "-n", '-f', '/etc/rsyslog/rsyslog.conf'] + volumes: + - name: rsyslog-conf + configMap: + name: rsyslog-conf + - emptyDir: + sizeLimit: 1Gi + name: log \ No newline at end of file diff --git a/hack/manifests/receivers/syslog/kustomization.yaml b/hack/manifests/receivers/syslog/kustomization.yaml new file mode 100644 index 000000000..6a0709082 --- /dev/null +++ b/hack/manifests/receivers/syslog/kustomization.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +labels: + - pairs: + app.kubernetes.io/name: syslog + app.kubernetes.io/component: receiver + app.kubernetes.io/part-of: cluster-logging + includeSelectors: true + includeTemplates: true + +resources: +- ../base +- configmap.yaml +- deployment.yaml +- service_nodeport.yaml \ No newline at end of file diff --git a/hack/manifests/receivers/syslog/service_nodeport.yaml b/hack/manifests/receivers/syslog/service_nodeport.yaml new file mode 100644 index 000000000..5f1dfcd70 --- /dev/null +++ b/hack/manifests/receivers/syslog/service_nodeport.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: rsyslog-service + labels: + app: rsyslog-server +spec: + type: NodePort + ports: + - name: udp + port: 514 + protocol: UDP + targetPort: 55514 + nodePort: 32514 + - name: tcp + port: 514 + protocol: TCP + targetPort: 55514 + nodePort: 32514 + selector: + app: rsyslog-server \ No newline at end of file diff --git a/hack/manifests/uiplugin/kustomization.yaml b/hack/manifests/uiplugin/kustomization.yaml new file mode 100644 index 000000000..f09d623ac --- /dev/null +++ b/hack/manifests/uiplugin/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: openshift-cluster-observability-operator +resources: + - ui_plugin_logging.yaml diff --git a/hack/manifests/uiplugin/ui_plugin_logging.yaml b/hack/manifests/uiplugin/ui_plugin_logging.yaml new file mode 100644 index 000000000..eeffc63c6 --- /dev/null +++ b/hack/manifests/uiplugin/ui_plugin_logging.yaml @@ -0,0 +1,12 @@ +apiVersion: observability.openshift.io/v1alpha1 +kind: UIPlugin +metadata: + name: logging +spec: + type: Logging + logging: + lokiStack: + name: lokistack-dev + logsLimit: 50 + timeout: 30s + schema: otel