forked from opensearch-project/observability
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opensearch-project#149 from parca-dev/tilt
Tilt for local dev
- Loading branch information
Showing
22 changed files
with
528 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
docker_prune_settings(num_builds=5) | ||
|
||
## Parca Agent | ||
|
||
docker_build( | ||
'parca.io/parca/parca-agent:dev', '', | ||
dockerfile='Dockerfile.dev', | ||
only=['./cmd', './pkg', './3rdparty', './go.mod', './go.sum', './parca-agent.bpf.c', './vmlinux.h', './Makefile'], | ||
) | ||
k8s_yaml('deploy/tilt/parca-agent-daemonSet.yaml') | ||
k8s_resource('parca-agent', port_forwards=[7071]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,41 @@ | ||
local agent = (import 'main.jsonnet'); | ||
function(serverVersion='v0.4.2') | ||
local ns = { | ||
apiVersion: 'v1', | ||
kind: 'Namespace', | ||
metadata: { | ||
name: 'parca', | ||
}, | ||
}; | ||
|
||
std.manifestYamlStream([ | ||
agent[name] | ||
for name in std.objectFields(agent) | ||
if agent[name] != null | ||
]) | ||
local server = (import 'parca/parca.libsonnet')({ | ||
name: 'parca', | ||
namespace: ns.metadata.name, | ||
image: 'ghcr.io/parca-dev/parca:' + serverVersion, | ||
version: serverVersion, | ||
replicas: 1, | ||
corsAllowedOrigins: '*', | ||
}); | ||
|
||
local agent = (import 'parca-agent/parca-agent.libsonnet')({ | ||
name: 'parca-agent', | ||
namespace: ns.metadata.name, | ||
version: 'dev', | ||
image: 'parca.io/parca/parca-agent:dev', | ||
stores: ['%s.%s.svc.cluster.local:%d' % [server.service.metadata.name, server.service.metadata.namespace, server.config.port]], | ||
logLevel: 'debug', | ||
insecure: true, | ||
insecureSkipVerify: true, | ||
tempDir: 'tmp', | ||
}); | ||
|
||
{ | ||
'0namespace': ns, | ||
} + { | ||
['parca-server-' + name]: server[name] | ||
for name in std.objectFields(server) | ||
if server[name] != null | ||
} + { | ||
['parca-agent-' + name]: agent[name] | ||
for name in std.objectFields(agent) | ||
if agent[name] != null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: parca |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: observability | ||
app.kubernetes.io/instance: parca-agent | ||
app.kubernetes.io/name: parca-agent | ||
app.kubernetes.io/version: dev | ||
name: parca-agent | ||
namespace: parca | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: observability | ||
app.kubernetes.io/instance: parca-agent | ||
app.kubernetes.io/name: parca-agent | ||
app.kubernetes.io/version: dev | ||
name: parca-agent | ||
namespace: parca | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: parca-agent | ||
subjects: | ||
- kind: ServiceAccount | ||
name: parca-agent | ||
namespace: parca |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: observability | ||
app.kubernetes.io/instance: parca-agent | ||
app.kubernetes.io/name: parca-agent | ||
app.kubernetes.io/version: dev | ||
name: parca-agent | ||
namespace: parca | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/component: observability | ||
app.kubernetes.io/instance: parca-agent | ||
app.kubernetes.io/name: parca-agent | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: observability | ||
app.kubernetes.io/instance: parca-agent | ||
app.kubernetes.io/name: parca-agent | ||
app.kubernetes.io/version: dev | ||
spec: | ||
containers: | ||
- args: | ||
- /bin/parca-agent | ||
- --log-level=debug | ||
- --node=$(NODE_NAME) | ||
- --kubernetes | ||
- --store-address=parca.parca.svc.cluster.local:7070 | ||
- --insecure | ||
- --insecure-skip-verify | ||
- --temp-dir=tmp | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
image: parca.io/parca/parca-agent:dev | ||
name: parca-agent | ||
ports: | ||
- containerPort: 7071 | ||
hostPort: 7071 | ||
name: http | ||
resources: {} | ||
securityContext: | ||
privileged: true | ||
readOnlyRootFilesystem: true | ||
volumeMounts: | ||
- mountPath: /tmp | ||
name: tmp | ||
- mountPath: /run | ||
name: run | ||
- mountPath: /lib/modules | ||
name: modules | ||
- mountPath: /sys/kernel/debug | ||
name: debugfs | ||
- mountPath: /sys/fs/cgroup | ||
name: cgroup | ||
- mountPath: /sys/fs/bpf | ||
name: bpffs | ||
hostPID: true | ||
nodeSelector: | ||
kubernetes.io/arch: amd64 | ||
kubernetes.io/os: linux | ||
serviceAccountName: parca-agent | ||
tolerations: | ||
- effect: NoSchedule | ||
operator: Exists | ||
- effect: NoExecute | ||
operator: Exists | ||
volumes: | ||
- emptyDir: {} | ||
name: tmp | ||
- hostPath: | ||
path: /run | ||
name: run | ||
- hostPath: | ||
path: /sys/fs/cgroup | ||
name: cgroup | ||
- hostPath: | ||
path: /lib/modules | ||
name: modules | ||
- hostPath: | ||
path: /sys/fs/bpf | ||
name: bpffs | ||
- hostPath: | ||
path: /sys/kernel/debug | ||
name: debugfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
apiVersion: policy/v1beta1 | ||
kind: PodSecurityPolicy | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: observability | ||
app.kubernetes.io/instance: parca-agent | ||
app.kubernetes.io/name: parca-agent | ||
app.kubernetes.io/version: dev | ||
name: parca-agent | ||
namespace: parca | ||
spec: | ||
allowPrivilegeEscalation: true | ||
allowedCapabilities: | ||
- '*' | ||
allowedHostPaths: | ||
- pathPrefix: /sys | ||
- pathPrefix: /lib/modules | ||
fsGroup: | ||
rule: RunAsAny | ||
hostIPC: true | ||
hostNetwork: true | ||
hostPID: true | ||
hostPorts: | ||
- max: 7071 | ||
min: 7071 | ||
privileged: true | ||
readOnlyRootFilesystem: true | ||
runAsUser: | ||
rule: RunAsAny | ||
seLinux: | ||
rule: RunAsAny | ||
supplementalGroups: | ||
rule: RunAsAny | ||
volumes: | ||
- configMap | ||
- emptyDir | ||
- projected | ||
- secret | ||
- downwardAPI | ||
- persistentVolumeClaim | ||
- hostPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: observability | ||
app.kubernetes.io/instance: parca-agent | ||
app.kubernetes.io/name: parca-agent | ||
app.kubernetes.io/version: dev | ||
name: parca-agent | ||
namespace: parca | ||
rules: | ||
- apiGroups: | ||
- policy | ||
resourceNames: | ||
- parca-agent | ||
resources: | ||
- podsecuritypolicies | ||
verbs: | ||
- use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: observability | ||
app.kubernetes.io/instance: parca-agent | ||
app.kubernetes.io/name: parca-agent | ||
app.kubernetes.io/version: dev | ||
name: parca-agent | ||
namespace: parca | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: parca-agent | ||
subjects: | ||
- kind: ServiceAccount | ||
name: parca-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app.kubernetes.io/component: observability | ||
app.kubernetes.io/instance: parca-agent | ||
app.kubernetes.io/name: parca-agent | ||
app.kubernetes.io/version: dev | ||
name: parca-agent | ||
namespace: parca |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
data: | ||
parca.yaml: |- | ||
"debug_info": | ||
"bucket": | ||
"config": | ||
"directory": "./tmp" | ||
"type": "FILESYSTEM" | ||
"cache": | ||
"config": | ||
"directory": "./tmp" | ||
"type": "FILESYSTEM" | ||
kind: ConfigMap | ||
metadata: | ||
name: parca-config | ||
namespace: parca |
Oops, something went wrong.