Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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~
- Host: GitHub
- URL: https://github.com/alicfeng/kubernetesclient
- Owner: alicfeng
- Created: 2019-08-07T17:55:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-06T03:00:45.000Z (over 3 years ago)
- Last Synced: 2024-11-15T01:36:18.380Z (about 2 months ago)
- Topics: kubernetes, php
- Language: PHP
- Size: 156 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.
## 🚀 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/