Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding go-releaser to spire for systemd support #21

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
project_name: spire-agent

builds:
- binary: "opt/spire-agent/spire-agent"
main: ./cmd/spire-agent/
id: spire-agent
goos:
- linux
goarch:
- amd64
- arm64

archives:
- id: "spire-agent"
builds:
- "spire-agent"
name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}_{{.Arch}}"
files:
- src: ./packaging/spire-agent.service
dst: /usr/lib/systemd/system
strip_parent: true
- src: ./packaging/spire-agent.conf
dst: /opt/spire-agent/conf/
strip_parent: true
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,14 @@ $(protoc_gen_go_spire_bin): | go-check
$(E)rm -rf $(protoc_gen_go_spire_base_dir)
$(E)mkdir -p $(protoc_gen_go_spire_dir)
$(E)GOBIN=$(protoc_gen_go_spire_dir) $(go_path) go install github.com/accuknox/spire-plugin-sdk/cmd/protoc-gen-go-spire@$(protoc_gen_go_spire_version)

.PHONY: local-release
local-release: build
ifeq (, $(shell which goreleaser))
@{ \
set -e ;\
go install github.com/goreleaser/goreleaser@latest ;\
}
endif
cd $(CURDIR); VERSION=$(shell git describe --tags --always --dirty) goreleaser release --clean --skip=publish --skip=sign --skip=validate --snapshot

7 changes: 7 additions & 0 deletions packaging/kmux-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kmux:
sink:
stream: knox-gateway

knox-gateway:
# dev
server: "knox-gw.stage.accuknox.com:3000"
42 changes: 42 additions & 0 deletions packaging/spire-agent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
agent {
data_dir = "/opt/spire-data"
log_level = "DEBUG"
trust_domain = "accuknox.com"
join_token = "{{.JoinToken}}"
insecure_bootstrap = true

# spire-server address
server_address = "{{.SpireHostAddr}}"
server_port = "{{.SpireHostPort}}"
#trust_bundle_url = "{{.SpireTrustBundleURL}}"

# exposing spire-agent
agent_address = "0.0.0.0"
agent_port = "9091"
socket_path ="/var/run/spire/agent.sock"
}

plugins {
NodeAttestor "join_token" {
plugin_data {
}
}
KeyManager "disk" {
plugin_data {
directory = "/opt/spire-data"
}
}
WorkloadAttestor "systemd" {
plugin_data {
container_id_cgroup_matchers = []
}
}
}

health_checks {
listener_enabled = true
bind_address = "0.0.0.0"
bind_port = "9090"
live_path = "/live"
ready_path = "/ready"
}
12 changes: 12 additions & 0 deletions packaging/spire-agent.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Spire-Agent

[Service]
User=root
KillMode=process
WorkingDirectory=/opt/spire-agent/
Environment=run -config /opt/spire-agent/conf/spire-agent.conf
ExecStart=/opt/spire-agent/spire-agent

[Install]
WantedBy=multi-user.target
Loading