-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
46 lines (34 loc) · 1.57 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
VAULT_ADDR=http://127.0.0.1:8200
export VAULT_ADDR
SHA256SUM=$(shell sha256sum vault/plugin/vault-plugin-secrets-kubernetes | awk {'print $$1'})
PLUGIN_NAME=vault-plugin-secrets-kubernetes
build:
CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo -o vault/plugin/${PLUGIN_NAME} .
#goupx vault/plugin/${PLUGIN_NAME}
login:
echo "123qwe" | vault login -
add-plugin:
vault write sys/plugins/catalog/${PLUGIN_NAME} sha256="${SHA256SUM}" command=${PLUGIN_NAME}
enable-plugin:
vault secrets enable -path=k8s -plugin-name=${PLUGIN_NAME} plugin
vault secrets list
list-plugins:
vault read sys/plugins/catalog
configure-plugin:
vault write k8s/config token=${TOKEN} api-url=${MASTER_URL} CA=${MASTER_CA}
vault read k8s/config
create-sa:
vault write k8s/sa/it-deployer namespace=it service-account-name=deployer
get-token:
vault read k8s/secrets/it-deployer
up:
docker-compose down
docker-compose up -d
test:
go test -v -cover $(shell go list ./... | grep -v /vendor/)
init-plugin: login add-plugin enable-plugin list-plugins
crosscompile:
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo -o vault/plugin/${PLUGIN_NAME}-linux-amd64 .
CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo -o vault/plugin/${PLUGIN_NAME}-linux-arm64 .
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -a -ldflags="-s -w" -installsuffix cgo -o vault/plugin/${PLUGIN_NAME}-windows-amd64 .
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -a -ldflags="-s -w" -installsuffix cgo -o vault/plugin/${PLUGIN_NAME}-darwin-amd64 .