nixos/kubernetes: use kubectl from kubernetes
- also clarify kubectl wrapper naming
This commit is contained in:
parent
43cc6e3246
commit
ec2028eb3c
3 changed files with 5 additions and 5 deletions
|
@ -266,7 +266,7 @@ in
|
|||
in
|
||||
''
|
||||
export KUBECONFIG=${clusterAdminKubeconfig}
|
||||
${kubectl}/bin/kubectl apply -f ${concatStringsSep " \\\n -f " files}
|
||||
${kubernetes}/bin/kubectl apply -f ${concatStringsSep " \\\n -f " files}
|
||||
'';
|
||||
})]);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ let
|
|||
${master.ip} api.${domain}
|
||||
${concatMapStringsSep "\n" (machineName: "${machines.${machineName}.ip} ${machineName}.${domain}") (attrNames machines)}
|
||||
'';
|
||||
kubectl = with pkgs; runCommand "wrap-kubectl" { buildInputs = [ makeWrapper ]; } ''
|
||||
wrapKubectl = with pkgs; runCommand "wrap-kubectl" { buildInputs = [ makeWrapper ]; } ''
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${pkgs.kubernetes}/bin/kubectl $out/bin/kubectl --set KUBECONFIG "/etc/kubernetes/cluster-admin.kubeconfig"
|
||||
'';
|
||||
|
@ -48,7 +48,7 @@ let
|
|||
};
|
||||
};
|
||||
programs.bash.enableCompletion = true;
|
||||
environment.systemPackages = [ kubectl ];
|
||||
environment.systemPackages = [ wrapKubectl ];
|
||||
services.flannel.iface = "eth1";
|
||||
services.kubernetes = {
|
||||
proxy.hostname = "${masterName}.${domain}";
|
||||
|
|
|
@ -76,7 +76,7 @@ let
|
|||
}];
|
||||
});
|
||||
|
||||
kubectl = pkgs.runCommand "copy-kubectl" { buildInputs = [ pkgs.kubernetes ]; } ''
|
||||
copyKubectl = pkgs.runCommand "copy-kubectl" { } ''
|
||||
mkdir -p $out/bin
|
||||
cp ${pkgs.kubernetes}/bin/kubectl $out/bin/kubectl
|
||||
'';
|
||||
|
@ -84,7 +84,7 @@ let
|
|||
kubectlImage = pkgs.dockerTools.buildImage {
|
||||
name = "kubectl";
|
||||
tag = "latest";
|
||||
contents = [ kubectl pkgs.busybox kubectlPod2 ];
|
||||
contents = [ copyKubectl pkgs.busybox kubectlPod2 ];
|
||||
config.Entrypoint = ["/bin/sh"];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue