Skip to content

Commit

Permalink
let kube get in-cluster default namespace given kube-rs/kube#74
Browse files Browse the repository at this point in the history
  • Loading branch information
alecmocatta committed Oct 24, 2019
1 parent 930073a commit dfc9ebd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/bin/constellation/kube.rs
Expand Up @@ -5,7 +5,7 @@ use ::kube::{
};
use serde_json::json;
use std::{
collections::HashMap, env, fs::read_to_string, net::{IpAddr, SocketAddr}, thread
collections::HashMap, env, net::{IpAddr, SocketAddr}, thread
};

use super::master;
Expand All @@ -15,10 +15,8 @@ pub fn kube_master(
master_bind: SocketAddr, fabric_port: u16, bridge_bind: SocketAddr, mem: u64, cpu: u32,
replicas: u32,
) {
let namespace =
read_to_string("/var/run/secrets/kubernetes.io/serviceaccount/namespace").unwrap();

let config = config::incluster_config().expect("failed to load in-cluster kubeconfig");
let namespace = config.default_ns.clone();
let client = APIClient::new(config);

let jobs = Api::v1ReplicaSet(client.clone()).within(&namespace); //.group("extensions").version("v1beta1");
Expand Down

0 comments on commit dfc9ebd

Please sign in to comment.