Skip to content

Commit

Permalink
deploy: Separate out openshift manifests and make them work
Browse files Browse the repository at this point in the history
  • Loading branch information
brancz committed Oct 7, 2021
1 parent 7372f0d commit 8b23877
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,17 @@ jobs:
- name: Prepare
run: |
tar -zcvf deploy/manifests.tar.gz deploy/manifests
cp deploy/manifests/kubernetes/manifest.yaml deploy/kubernetes-manifest.yaml
cp deploy/manifests/openshift/manifest.yaml deploy/openshift-manifest.yaml
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
deploy/manifests.tar.gz
deploy/manifests/manifest.yaml
deploy/kubernetes-manifest.yaml
deploy/openshift-manifest.yaml
publish-docs:
name: Publish Docs
Expand Down
8 changes: 5 additions & 3 deletions deploy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ vendor:
.PHONY: manifests
manifests: vendor $(shell find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print)
rm -rf manifests tilt
mkdir manifests tilt
jsonnet --tla-str version="$(VERSION)" -J vendor main.jsonnet -m manifests | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
mkdir -p manifests/openshift manifests/kubernetes tilt
jsonnet --tla-str version="$(VERSION)" -J vendor main.jsonnet -m manifests/kubernetes | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
awk 'BEGINFILE {print "---"}{print}' manifests/kubernetes/* > manifests/kubernetes/manifest.yaml
jsonnet --tla-str version="$(VERSION)" -J vendor openshift.jsonnet -m manifests/openshift | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
awk 'BEGINFILE {print "---"}{print}' manifests/openshift/* > manifests/openshift/manifest.yaml
jsonnet -J vendor dev.jsonnet -m tilt | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {}
awk 'BEGINFILE {print "---"}{print}' manifests/parca-server* > manifests/manifest.yaml

fmt:
find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \
Expand Down
5 changes: 5 additions & 0 deletions deploy/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ function(version='v0.0.3-alpha.2')
kind: 'Namespace',
metadata: {
name: 'parca',
annotations: {
'pod-security.kubernetes.io/enforce': 'privileged',
'pod-security.kubernetes.io/audit': 'privileged',
'pod-security.kubernetes.io/warn': 'privileged',
},
},
};

Expand Down
32 changes: 32 additions & 0 deletions deploy/openshift.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
function(version='v0.0.3-alpha.2')
local ns = {
apiVersion: 'v1',
kind: 'Namespace',
metadata: {
name: 'parca',
annotations: {
'pod-security.kubernetes.io/enforce': 'privileged',
'pod-security.kubernetes.io/audit': 'privileged',
'pod-security.kubernetes.io/warn': 'privileged',
},
},
};

local parca = (import 'parca/parca.libsonnet')({
name: 'parca',
namespace: ns.metadata.name,
image: 'ghcr.io/parca-dev/parca:' + version,
version: version,
replicas: 1,
corsAllowedOrigins: '*',
securityContext: null,
});

{
'parca-agent-namespace': ns,
'parca-server-namespace': ns,
} + {
['parca-server-' + name]: parca[name]
for name in std.objectFields(parca)
if parca[name] != null
}

0 comments on commit 8b23877

Please sign in to comment.