Skip to content

Commit

Permalink
Merge pull request #28 from timebertt/parca-persistence
Browse files Browse the repository at this point in the history
Add persistent storage to parca
  • Loading branch information
timebertt authored Oct 28, 2023
2 parents 23b7f7b + dace3a1 commit 9cb9e1f
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 8 deletions.
4 changes: 3 additions & 1 deletion webhosting-operator/cmd/webhosting-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ func dropUnwantedMetadata(i interface{}) (interface{}, error) {
}

obj.SetManagedFields(nil)
delete(obj.GetAnnotations(), "kubectl.kubernetes.io/last-applied-configuration")
annotations := obj.GetAnnotations()
delete(annotations, "kubectl.kubernetes.io/last-applied-configuration")
obj.SetAnnotations(annotations)

return obj, nil
}
24 changes: 17 additions & 7 deletions webhosting-operator/config/profiling/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/parca-dev/parca/releases/download/v0.18.0/kubernetes-manifest.yaml
- https://github.com/parca-dev/parca/releases/download/v0.20.0/kubernetes-manifest.yaml
# provide parca running in namespace "parca" with the permissions required for service discovery in namespace
# "webhosting-system" and scrape the pprof endpoints of webhosting-operator
- parca_rbac.yaml
- parca_ingress.yaml
- parca-pvc.yaml

generatorOptions:
disableNameSuffixHash: true
Expand All @@ -32,9 +33,18 @@ secretGenerator:
- auth=parca_auth.secret.txt

patches:
- patch: |
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: parca
$patch: delete
- path: patch-deployment-pvc.yaml
- target:
kind: Deployment
name: parca
namespace: parca
patch: |
- op: add
path: /spec/template/spec/containers/0/args/-
value: --enable-persistence
- op: add
path: /spec/template/spec/containers/0/args/-
value: --storage-path=/var/lib/parca
- op: add
path: /spec/template/spec/containers/0/args/-
value: --storage-enable-wal
15 changes: 15 additions & 0 deletions webhosting-operator/config/profiling/parca-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/component: observability
app.kubernetes.io/instance: parca
app.kubernetes.io/name: parca
name: parca
namespace: parca
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Gi
18 changes: 18 additions & 0 deletions webhosting-operator/config/profiling/patch-deployment-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: parca
namespace: parca
spec:
# set replicas and strategy to play nicely with PVC
replicas: 1
strategy:
type: Recreate
rollingUpdate: null
template:
spec:
volumes:
- name: data
emptyDir: null
persistentVolumeClaim:
claimName: parca

0 comments on commit 9cb9e1f

Please sign in to comment.