Skip to content

Commit 0b283e9

Browse files
author
Ryan Faircloth
authored
Merge pull request #1 from splunk/deploy
Deploy
2 parents 236fa1b + d81f73b commit 0b283e9

File tree

7 files changed

+198
-2
lines changed

7 files changed

+198
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: mib-server
5+
labels:
6+
app: sc4-snmp-mib-server
7+
environment: production
8+
tier: backend
9+
spec:
10+
replicas: 2
11+
selector:
12+
matchLabels:
13+
app: sc4-snmp-mib-server
14+
environment: production
15+
template:
16+
metadata:
17+
labels:
18+
app: sc4-snmp-mib-server
19+
environment: production
20+
tier: backend
21+
spec:
22+
containers:
23+
- name: mib-server
24+
image: ghcr.io/splunk/splunk-connect-for-snmp-mib-server:1.0.0
25+
ports:
26+
- containerPort: 9000
27+
---

deploy/k8s/mib-server-static.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: mib-server
5+
labels:
6+
app: sc4-snmp-mib-server
7+
environment: production
8+
tier: backend
9+
spec:
10+
ports:
11+
- port: 9000
12+
targetPort: 9000
13+
selector:
14+
app: sc4-snmp-mib-server
15+
---
16+

deploy/k8s/traps-deployment.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: traps
6+
labels:
7+
app: sc4-snmp-traps
8+
environment: production
9+
tier: frontend
10+
spec:
11+
replicas: 1
12+
selector:
13+
matchLabels:
14+
app: sc4-snmp-traps
15+
environment: production
16+
tier: frontend
17+
template:
18+
metadata:
19+
labels:
20+
app: sc4-snmp-traps
21+
environment: production
22+
tier: frontend
23+
spec:
24+
containers:
25+
- name: traps
26+
image: ghcr.io/splunk/splunk-connect-for-snmp-traps:0.1.10
27+
args: ["--log=DEBUG"]
28+
resources:
29+
requests:
30+
memory: "2Gi"
31+
cpu: "1"
32+
limits:
33+
memory: "8Gi"
34+
cpu: "4"
35+
ports:
36+
- containerPort: 2162
37+
env:
38+
- name: SPLUNK_HEC_URL
39+
valueFrom:
40+
secretKeyRef:
41+
name: remote-splunk
42+
key: SPLUNK_HEC_URL
43+
- name: SPLUNK_HEC_TOKEN
44+
valueFrom:
45+
secretKeyRef:
46+
name: remote-splunk
47+
key: SPLUNK_HEC_TOKEN
48+
- name: SPLUNK_HEC_TLS_VERIFY
49+
valueFrom:
50+
secretKeyRef:
51+
name: remote-splunk
52+
key: SPLUNK_HEC_TLS_VERIFY
53+
---
54+

deploy/k8s/traps-static.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: sc4snmp-env-file
5+
data:
6+
SPLUNK_HEC_URL: https://splunk-s1-standalone-headless:8088
7+
SC4SNMP_DEST_SPLUNK_HEC_TLS_VERIFY: "yes"
8+
---
9+
apiVersion: v1
10+
kind: Service
11+
metadata:
12+
name: traps
13+
labels:
14+
app: sc4-snmp-traps-svc
15+
environment: production
16+
tier: frontend
17+
annotations:
18+
metallb.universe.tf/allow-shared-ip: sedge
19+
spec:
20+
loadBalancerIP: replace-me
21+
ports:
22+
- port: 162
23+
targetPort: 2162
24+
protocol: UDP
25+
selector:
26+
app: sc4-snmp-traps
27+
type: LoadBalancer
28+
externalTrafficPolicy: Local
29+
---
30+

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sphinx-material==0.0.32

docs/source/gettingstarted.rst

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
... Getting Started
2+
3+
Getting Started
4+
===================================================
5+
6+
Requirements (Splunk Enterprise/Enterprise Cloud)
7+
---------------------------------------------------
8+
9+
1. Splunk index for events "netops"
10+
2. Splunk index for metrics "net_metrics"
11+
3. Splunk hec token with no index restriction *OR* Splunk hec token with access to _internal, netops and net_metrics
12+
4. Known Splunk URL with trusted certificate (must be trusted by standard red hat trusted chain)
13+
5. Physical or virtual linux host (Prefer Ubuntu or RHEL 8.1) RHEL hosts must have snap support enabled see https://snapcraft.io/docs/installing-snapd
14+
6. One IP allocation in addition to the ip allocated to the host. *Note: In the future clustering (scale out) will use this IP as a shared resource
15+
16+
Setup Micro K8s
17+
---------------------------------------------------
18+
19+
The following setup instructions are validated for release 1.20x but are subject to change.
20+
21+
1. Install MicroK8s ``sudo snap install microk8s --classic``
22+
2. Check completion status ``sudo microk8s status --wait-ready``
23+
3. Install optional modules ``sudo microk8s enable dashboard dns registry metallb``
24+
4. Alias kubectl ``alias kubectl="microk8s kubectl"``
25+
26+
Setup Secrets
27+
---------------------------------------------------
28+
29+
Execute the following commands, use the correct values for your env:
30+
31+
* Setup URL and token secret
32+
33+
.. code-block:: bash
34+
35+
kubectl create secret generic remote-splunk \
36+
--from-literal=SPLUNK_HEC_URL=https://fqdn:8088/services/collector \
37+
--from-literal=SPLUNK_HEC_TLS_VERIFY=yes \
38+
--from-literal=SPLUNK_HEC_TOKEN=sometoken
39+
40+
41+
* Get the manifests
42+
43+
.. code-block:: bash
44+
45+
git clone https://github.com/splunk/splunk-connect-for-snmp.git
46+
47+
* Apply the manifests, replace the ip ``10.0.101.22`` with the shared IP noted above
48+
49+
.. code-block:: bash
50+
51+
cat splunk-connect-for-snmp/deploy/k8s/*.yaml | sed 's/loadBalancerIP: replace-me/loadBalancerIP: 10.0.101.22/' | kubectl apply -f -
52+
53+
* Confirm deployment using ``kubectl get pods`` two(2) instances of mib-server and one (1) instance of traps example
54+
55+
.. code-block:: bash
56+
57+
NAME READY STATUS RESTARTS AGE
58+
mib-server-54557f5846-rzg9q 1/1 Running 0 1m
59+
mib-server-54557f5846-pbt2h 1/1 Running 0 1m
60+
traps-676859cb8d-tnc7v 1/1 Running 0 1m
61+
62+
* Test the trap from a linux system with snmp installed replace the ip ``10.0.101.22`` with the shared ip above
63+
64+
.. code-block:: bash
65+
66+
snmptrap -v2c -c public 10.0.101.22 123 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.5.0 s test

docs/source/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ collection of SNMP data for Splunk Enterprise, Splunk Enterprise Cloud and Splun
99

1010

1111
.. toctree::
12-
:maxdepth: 2
13-
:caption: Contents:
12+
:caption: Table of Contents
13+
:maxdepth: 1
14+
15+
gettingstarted
1416

1517

1618

0 commit comments

Comments
 (0)