Add service account.
This commit is contained in:
35
nix/kubernetes/keys/package/k8s-service-account/package.nix
Normal file
35
nix/kubernetes/keys/package/k8s-service-account/package.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
# unpackPhase
|
||||
# patchPhase
|
||||
# configurePhase
|
||||
# buildPhase
|
||||
# checkPhase
|
||||
# installPhase
|
||||
# fixupPhase
|
||||
# installCheckPhase
|
||||
# distPhase
|
||||
{
|
||||
stdenv,
|
||||
sqlite,
|
||||
cfssl,
|
||||
k8s,
|
||||
all_hostnames,
|
||||
...
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
name = "k8s-service-account";
|
||||
nativeBuildInputs = [ cfssl ];
|
||||
buildInputs = [ ];
|
||||
|
||||
unpackPhase = "true";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out"
|
||||
cd "$out"
|
||||
cfssl gencert \
|
||||
-ca=${k8s.ca}/ca.pem \
|
||||
-ca-key=${k8s.ca}/ca-key.pem \
|
||||
-config=${./files/ca-config.json} \
|
||||
-profile=kubernetes \
|
||||
${./files/service-account-csr.json} | cfssljson -bare service-account
|
||||
'';
|
||||
})
|
||||
Reference in New Issue
Block a user