Skip to content

Commit

Permalink
Fixed host for in-cluster config
Browse files Browse the repository at this point in the history
  • Loading branch information
rennokki committed Mar 24, 2021
1 parent 043e664 commit 9147d9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/k8s.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@

'cluster' => [
'driver' => 'cluster',
'host' => env('KUBE_HOST', 'https://kubernetes.default.svc.cluster.local'),
],

],
Expand Down
7 changes: 5 additions & 2 deletions src/KubernetesCluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function loadFromConfig(array $config)
case 'kubeconfig': $this->configureWithKubeConfigFile($config); break;
case 'http': $this->configureWithHttpAuth($config); break;
case 'token': $this->configureWithToken($config); break;
case 'cluster': $this->configureInCluster(); break;
case 'cluster': $this->configureInCluster($config); break;
default: break;
}
}
Expand Down Expand Up @@ -135,10 +135,13 @@ protected function configureWithToken(array $config)
/**
* Load the In-Cluster configuration.
*
* @param array $config
* @return void
*/
protected function configureInCluster()
protected function configureInCluster(array $config)
{
$this->cluster = new PhpK8sCluster($config['host'] ?? 'https://kubernetes.default.svc.cluster.local');

$this->cluster->inClusterConfiguration();
}

Expand Down

0 comments on commit 9147d9a

Please sign in to comment.