summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/cluster/kubernetes/apiserver.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/cluster/kubernetes/apiserver.nix')
-rw-r--r--nixos/modules/services/cluster/kubernetes/apiserver.nix44
1 files changed, 37 insertions, 7 deletions
diff --git a/nixos/modules/services/cluster/kubernetes/apiserver.nix b/nixos/modules/services/cluster/kubernetes/apiserver.nix
index 95bdb4c0d14e..616389dfaaca 100644
--- a/nixos/modules/services/cluster/kubernetes/apiserver.nix
+++ b/nixos/modules/services/cluster/kubernetes/apiserver.nix
@@ -238,14 +238,42 @@ in
type = int;
};
+ apiAudiences = mkOption {
+ description = ''
+ Kubernetes apiserver ServiceAccount issuer.
+ '';
+ default = "api,https://kubernetes.default.svc";
+ type = str;
+ };
+
+ serviceAccountIssuer = mkOption {
+ description = ''
+ Kubernetes apiserver ServiceAccount issuer.
+ '';
+ default = "https://kubernetes.default.svc";
+ type = str;
+ };
+
+ serviceAccountSigningKeyFile = mkOption {
+ description = ''
+ Path to the file that contains the current private key of the service
+ account token issuer. The issuer will sign issued ID tokens with this
+ private key.
+ '';
+ default = top.serviceAccountSigningKeyFile;
+ type = path;
+ };
+
serviceAccountKeyFile = mkOption {
description = ''
- Kubernetes apiserver PEM-encoded x509 RSA private or public key file,
- used to verify ServiceAccount tokens. By default tls private key file
- is used.
+ File containing PEM-encoded x509 RSA or ECDSA private or public keys,
+ used to verify ServiceAccount tokens. The specified file can contain
+ multiple keys, and the flag can be specified multiple times with
+ different files. If unspecified, --tls-private-key-file is used.
+ Must be specified when --service-account-signing-key is provided
'';
- default = null;
- type = nullOr path;
+ default = top.serviceAccountKeyFile;
+ type = path;
};
serviceClusterIpRange = mkOption {
@@ -357,8 +385,10 @@ in
${optionalString (cfg.runtimeConfig != "")
"--runtime-config=${cfg.runtimeConfig}"} \
--secure-port=${toString cfg.securePort} \
- ${optionalString (cfg.serviceAccountKeyFile!=null)
- "--service-account-key-file=${cfg.serviceAccountKeyFile}"} \
+ --api-audiences=${toString cfg.apiAudiences} \
+ --service-account-issuer=${toString cfg.serviceAccountIssuer} \
+ --service-account-signing-key-file=${cfg.serviceAccountSigningKeyFile} \
+ --service-account-key-file=${cfg.serviceAccountKeyFile} \
--service-cluster-ip-range=${cfg.serviceClusterIpRange} \
--storage-backend=${cfg.storageBackend} \
${optionalString (cfg.tlsCertFile != null)