Skip to content

Commit 9ac9180

Browse files
committed
Ensure agent tries to download config after failure. Update OpenShift manifests
1 parent 552a286 commit 9ac9180

File tree

4 files changed

+48
-60
lines changed

4 files changed

+48
-60
lines changed

contrib/openshift/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Installing the Agent on an OpenShift Cluster
2+
3+
1. Go to the [Scanning Agents](https://plus.probely.app/scanning-agents/) page.
4+
Create an agent and take note of the **agent token**.
5+
2. Create the `probely` namespace
6+
```shell
7+
oc create namespace probely
8+
```
9+
3. Create the `agent token` secret
10+
```shell
11+
oc -n probely create secret generic farcaster-secrets \
12+
--from-literal=token=<YOUR_AGENT_TOKEN>
13+
```
14+
4. Deploy the agent pod
15+
```shell
16+
oc apply -f https://raw.githubusercontent.com/Probely/farcaster-onprem-agent/main/contrib/openshift/probely-agent-depl.yaml
17+
```
18+
5. Check that the agent is working properly
19+
```shell
20+
oc -n probely logs -f farcaster-agent-<id>
21+
```
22+
You should see output similar to:
23+
```
24+
Starting local DNS resolver ... done
25+
Setting HTTP proxy rules ... done
26+
Connecting to Probely ... done
27+
Setting local gateway rules ... done
28+
Starting WireGuard gateway ... done
29+
30+
Running...
31+
```

contrib/openshift/probely-agent-depl.yaml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: farcaster-agent
5+
namespace: probely
56
spec:
67
replicas: 1
78
selector:
@@ -14,30 +15,26 @@ spec:
1415
spec:
1516
containers:
1617
- name: agent
17-
privileged: true
1818
image: probely/farcaster-onprem-agent:v3
1919
imagePullPolicy: Always
20+
env:
21+
- name: FARCASTER_AGENT_TOKEN
22+
valueFrom:
23+
secretKeyRef:
24+
name: farcaster-secrets
25+
key: token
2026
resources:
2127
requests:
22-
cpu: 250m
23-
memory: 128Mi
28+
cpu: "1"
29+
memory: "128Mi"
2430
securityContext:
25-
capabilities:
26-
add:
27-
- NET_ADMIN
31+
allowPrivilegeEscalation: false
2832
volumeMounts:
29-
- name: farcaster-secrets
30-
mountPath: /secrets/farcaster/data
31-
readOnly: true
32-
- name: host-tun-dev
33-
mountPath: /dev/net/tun
33+
- name: run-tmpfs
34+
mountPath: /run
3435
volumes:
35-
- name: farcaster-secrets
36-
projected:
37-
sources:
38-
- secret:
39-
name: farcaster-tunnel-secrets
40-
- secret:
41-
name: farcaster-gateway-secrets
36+
- name: run-tmpfs
37+
emptyDir:
38+
medium: Memory
4239
terminationGracePeriodSeconds: 3
4340
minReadySeconds: 2

contrib/openshift/probely-agent-scc.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

farcaster-go/agent/agent.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ func (a *Agent) ConnectWait(maxTries int) error {
393393
a.gwDev = nil
394394
a.log.Debug("Gateway WireGuard device closed")
395395
}
396+
397+
a.cfg = nil
396398
}
397399

398400
forceTCP, _ := strconv.ParseBool(os.Getenv("FARCASTER_FORCE_TCP"))

0 commit comments

Comments
 (0)