Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let kube-rs get in-cluster default namespace #37

Merged
merged 1 commit into from
Oct 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/bin/constellation/kube.rs
Original file line number Diff line number Diff line change
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