Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alicfeng/kubernetesclient

kubernetes client for k8s manager~
https://github.com/alicfeng/kubernetesclient

kubernetes php

Last synced: 20 days ago
JSON representation

kubernetes client for k8s manager~

Awesome Lists containing this project

README

        



KubernetesClient



A PHP Client For Manage Kubernetes Cluster


Based on official of Kubernetes interface as well as dependent GuzzleHttp to generate.




Build Status


Latest Stable Version


Total Downloads


License

## 🚀 Quick start

- **`standard`**

```
composer require alicfeng/kubernetes-client -vvv
```

- **`Laravel`**

```shell
php artisan vendor:publish --provider="AlicFeng\Kubernetes\ServiceProvider\AsmServiceProvider"
php artisan vendor:publish --provider="AlicFeng\Kubernetes\ServiceProvider\KubernetesServiceProvider"
# OR
php artisan vendor:publish --tag=kubernetes
php artisan vendor:publish --tag=asm
```

## ✨ Features

- [x] Service

- [x] Deployment

- [x] Pod

- [x] Job

- [x] ConfigMap

- [x] DaemonSet

- [x] Node

- [x] Secrets

- [x] StatefulSet

- [x] Event

- [x] PersistentVolumeClaim

- [x] Ingress

- [x] ReplicationController

- [ ] GagaWay

- [x] VirtualService

## ☛ Usage

Authorization support three method including token,username & password as well as cert file

```php
use AlicFeng\Kubernetes\Kubernetes;

$config = [
'base_uri' => 'https://127.0.0.1:6443',
'token' => 'token',
'namespace' => 'default'
];
$service = Kubernetes::service($config);
$metadata = [
'name' => 'demo-service'
];
$spec = [
'type' => 'NodePort',
'selector' => [
'k8s-app' => 'demo-service',
],
'ports' => [
[
'protocol' => 'TCP',
'port' => 80,
'targetPort' => 80,
'nodePort' => 30008
]
]
];

# Create Service
$service->setMetadata($metadata)->setSpec($spec)->create();

# Patch Service
$service->apply('name');

# Delete Service
$service->delete('name');

# Service Exist
$service->list()->exist('name');

# Item Service
$service->list()->item('name');
```

## 💖 Thanks developer

- [lsrong](https://github.com/lsrong)

- [lljiuzheyang](https://github.com/lljiuzheyang)

## ₤ Kubernetes

See the API documentation for an explanation of the options:

https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/