Open redbaron opened 7 years ago
hey redbaron, i got nix-kubernetes working. I don't know exacly why, but line 3 seems to be faulty. instead provide "-n" flag to "nix-kubernetes deploy" command.
# deployment.nix
{
default =
{ config, pkgs, lib, ... }:
with lib;
{
kubernetes.namespaces = {
default = {
name = "default";
};
};
kubernetes.deployments.redis = {
replicas = 1;
pod.containers.redis = {
image = "redis";
args = "redis-server --appendonly yes";
ports = [{ port = 6379; }];
requests.memory = "128Mi";
requests.cpu = "50m";
};
};
};
}
[sebastian@laptop:~/svm/src/nixops-machines]$ nix-kubernetes list
┌─────────┬────────────────────────────────────────────────────────┐
│ name │ path │
├─────────┼────────────────────────────────────────────────────────┤
│ default │ /home/sebastian/svm/src/nixops-machines/deployment.nix │
└─────────┴────────────────────────────────────────────────────────┘
[sebastian@laptop:~/svm/src/nixops-machines]$ nix-kubernetes deploy -d default -n default
Config: /nix/store/arrbyp0i401f4mssv378manf1ml5bbix-configurations
deploying: Namespace default
deploying: Deployment redis
deployment complete
I accidentally a PR #16 . Different solution though.
I am trying to wrap my head around using nix for kube resources management, having working up-to-date example would really help.