|
| 1 | +You can install SC4S on AWS with EKS. To do this, you can use a deployment file and a basic configuration information. |
| 2 | + |
| 3 | +Refer to AWS [documentation](https://docs.aws.amazon.com/eks/latest/userguide/sample-deployment.html) on how to set up your AWS environment. |
| 4 | + |
| 5 | +Before you begin you also need to have `kubectl` installed. |
| 6 | + |
| 7 | +# Prepare your initial configuration |
| 8 | +1. First create a file named `/opt/sc4s/env_file` and add the following environment variables and values: |
| 9 | + |
| 10 | +``` dotenv |
| 11 | +--8<---- "ansible/resources/env_file" |
| 12 | +``` |
| 13 | +Then create a configmap with variables provided in the file |
| 14 | +``` |
| 15 | +kubectl create configmap sc4s-config --from-env-file=/opt/sc4s/env_file -n sc4s |
| 16 | +``` |
| 17 | + |
| 18 | +2. Create a deployment configuration file based on this: |
| 19 | +``` yaml |
| 20 | +--8<---- "docs/resources/docker/sc4s_deployment.yaml" |
| 21 | +``` |
| 22 | + |
| 23 | +Please note that this file may need to be modified based on your requirements, such as the ports being used. |
| 24 | +You can view the default range of ports opened by the nodePort [here](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport). |
| 25 | + |
| 26 | +3. (Optioinal) To use local filters you have to load them into a configmap, and uncomment parts of the deployment file related to them: |
| 27 | + |
| 28 | +``` |
| 29 | +kubectl create configmap sc4s-local-filter-config \ |
| 30 | + --from-file=/opt/sc4s/local/config/app_parsers -n sc4s |
| 31 | +``` |
| 32 | + |
| 33 | +This loads files from app_parsers directory only, [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-files) is the documentation explaining other use cases. |
| 34 | + |
| 35 | +# Deploy SC4S with your configuration |
| 36 | +1. To run SC4S simply run this command in the directory where your deployment file is located: |
| 37 | +```bash |
| 38 | +kubectl apply -f sc4s_deployment.yaml |
| 39 | +``` |
| 40 | + |
| 41 | +You can use a load balancer with SC4S, to set it up properly refer to our [documentation](../architecture/lb/index.md). |
| 42 | + |
| 43 | +2. You can use following commands to check if SC4S deployment and NodePort service is running. |
| 44 | + |
| 45 | +To get pods: |
| 46 | +```bash |
| 47 | +kubectl get pods -n sc4s |
| 48 | +``` |
| 49 | + |
| 50 | +To get NodePort service: |
| 51 | +```bash |
| 52 | +kubectl get services -n sc4s |
| 53 | +``` |
| 54 | + |
| 55 | +Check the logs using this command: |
| 56 | +```bash |
| 57 | +kubectl logs {your_pod_name} -n sc4s |
| 58 | +``` |
| 59 | + |
| 60 | +You should see something like this: |
| 61 | +```ini |
| 62 | +SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sourcetype=sc4s:fallback... |
| 63 | +SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sourcetype=sc4s:events... |
| 64 | +syslog-ng checking config |
| 65 | +sc4s version=3.37.0 |
| 66 | +Configuring the health check port to: 8080 |
| 67 | +[2025-08-01 17:40:50 +0000] [130] [INFO] Starting gunicorn 23.0.0 |
| 68 | +[2025-08-01 17:40:50 +0000] [130] [INFO] Listening at: http://0.0.0.0:8080 (130) |
| 69 | +[2025-08-01 17:40:50 +0000] [130] [INFO] Using worker: sync |
| 70 | +[2025-08-01 17:40:50 +0000] [133] [INFO] Booting worker with pid: 133 |
| 71 | +starting syslog-ng |
| 72 | +``` |
| 73 | + |
| 74 | +If the pod does not start you can debug it with this command: |
| 75 | +```bash |
| 76 | +kubectl describe pod {your_pod_name} -n sc4s |
| 77 | +``` |
| 78 | + |
| 79 | +3. You can use following commands to check if SC4S deployment and NodePort service is running. |
| 80 | + |
| 81 | + |
| 82 | +# Validate your configuration |
| 83 | + |
| 84 | +SC4S performs checks to ensure that the container starts properly and that the syntax of the underlying syslog-ng |
| 85 | +configuration is correct. Once the checks are complete, validate that SC4S properly communicate with Splunk. |
| 86 | +To do this, execute the following search in Splunk: |
| 87 | + |
| 88 | +```ini |
| 89 | +index=* sourcetype=sc4s:events "starting up" |
| 90 | +``` |
| 91 | + |
| 92 | +# Update SC4S |
| 93 | +Whenever the image is upgraded or when you want your configuration changes to be applied, run the command: |
| 94 | + |
| 95 | +```bash |
| 96 | +kubectl apply -f sc4s_deployment.yaml |
| 97 | +``` |
| 98 | + |
| 99 | +Kubectl will detect if there are any changes to be made and rollout new pods if necessary. |
| 100 | + |
| 101 | +# Stop SC4S |
| 102 | + |
| 103 | +To delete the deployment run this command in the directory where your deployment file is located: |
| 104 | +```bash |
| 105 | +kubectl delete -f sc4s_deployment.yaml |
| 106 | +``` |
0 commit comments