PHP K8s
Github Repo
3.x
3.x
  • ๐ŸšขIntroduction
  • ๐ŸŽ‰Support
  • โซUpgrading to 3.x
  • Getting Started
    • ๐Ÿš€Installation
    • ๐Ÿ™ŒShowcase
    • ๐Ÿ”’Authentication
    • โ™ป๏ธActive Development
      • ๐Ÿ“—Default Versions
      • ๐Ÿง™Supported Kubernetes versions
      • ๐Ÿ—ณ๏ธPackage versioning
  • Cluster Interaction
    • ๐ŸงญGetting Started
    • ๐ŸŽญCRUD Operations
    • ๐Ÿ“ฆImport from YAML
    • ๐Ÿ‘€Watching Resources
  • Resources
    • ๐Ÿ‘“Base Resource
      • Attributes Methods
      • Metadata Methods
      • Custom Callers
    • ๐Ÿง‘Namespace
    • ๐Ÿ–ฅ๏ธNode
    • ๐Ÿ“กEvent
    • ๐Ÿ“ฆWorkloads
      • Pod
      • Deployment
      • StatefulSet
      • DaemonSet
      • Job
      • CronJob
    • ๐ŸงตConfigurations
      • ConfigMap
      • Secret
    • ๐Ÿ“€Storage
      • StorageClass
      • PersistentVolume
      • PersistentVolumeClaim
    • ๐Ÿ“ถNetworking
      • Service
      • Ingress
    • โ†”๏ธScaling & Availability
      • HorizontalPodAutoscaler
      • PodDisruptionBudget
    • ๐Ÿ”‘RBAC
      • ClusterRole
      • ClusterRoleBinding
      • Role
      • RoleBinding
      • ServiceAccount
  • Instances
    • Affinity
    • Container
    • Container Probes
    • Expressions
    • Resource Metrics
    • RBAC Rules
    • Volumes
  • Advanced
    • ๐ŸฐMacros
    • โœจCreate classes for CRDs
      • ๐ŸŽ‡Getting started
      • ๐ŸฐMacros
      • ๐Ÿ‘€Watchable Resources
      • โ†”๏ธScalable Resources
      • ๐Ÿ’ŠPodable Resources
      • ๐Ÿ“„Loggable Resources
      • ๐Ÿš’Helper Traits
  • Frameworks
    • Laravel
    • PHP Helm
Powered by GitBook
On this page
  • ๐Ÿš€ Installation
  • ๐Ÿ™Œ Usage
  • Multiple connections
  • Getting the cluster instance

Was this helpful?

  1. Frameworks

Laravel

Just a simple port of renoki-co/php-k8s for easier access in Laravel.

PreviousHelper TraitsNextPHP Helm

Last updated 3 years ago

Was this helpful?

๐Ÿš€ Installation

You can install the package via composer:

composer require renoki-co/laravel-php-k8s

Publish the config:

php artisan vendor:publish --provider="RenokiCo\LaravelK8s\LaravelK8sServiceProvider" --tag="config"

๐Ÿ™Œ Usage

The cluster configuration can be found in the config/k8s.php file. You can get started directly with the /.kube/config file you already have.

use RenokiCo\LaravelK8s\LaravelK8sFacade as K8s;

foreach (K8s::getAllConfigMaps() as $cm) {
    // $cm->getName();
}

For further documentation, check .

Multiple connections

The package supports multiple connections configurations. If you wish to select a specific one (not the default one), call connection before getting the cluster.

use RenokiCo\LaravelK8s\LaravelK8sFacade as K8s;

$cluster = K8s::connection('http')->getCluster();

Getting the cluster instance

You can also call getCluster() to get the instance of \RenokiCo\PhpK8s\KubernetesCluster:

$cluster = K8s::getCluster();
renoki-co/php-k8s
CI
License
codecov
Total Downloads
Monthly Downloads
StyleCI
Latest Stable Version