PHP K8s
Github Repo
master
master
  • ๐Ÿšข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
  • emptyDir
  • ConfigMap
  • Secret
  • GCE Persistent Disk
  • AWS Elastic Block Store

Was this helpful?

Edit on GitHub
  1. Instances

Volumes

PreviousRBAC RulesNextMacros

Last updated 3 years ago

Was this helpful?

For more details, check the

emptyDir

$volume = K8s::volume()->emptyDirectory('some-volume');

$container->addMountedVolumes([
    $volume->mountTo('/some-path'),
]);

$pod->addVolumes([$volume]);

ConfigMap

$cm = K8s::configMap()
    ->setName('some-config-map')
    ->setData([
        'some-key' => 'value-for-file',
    ]);

$volume = K8s::volume()->fromConfigMap($cm);

$container->addMountedVolumes([
    $volume->mountTo('/some-path/file.txt', 'some-key'),
]);

$pod->addVolumes([$volume]);

Secret

$secret = K8s::secret()
    ->setName('some-secret')
    ->setData([
        'some-key' => 'value-for-file',
    ]);

$volume = K8s::volume()->fromSecret($secret);

$container->addMountedVolumes([
    $volume->mountTo('/some-path/file.txt', 'some-key'),
]);

$pod->addVolumes([$volume]);

GCE Persistent Disk

$volume = K8s::volume()->gcePersistentDisk('some-disk', 'ext4');

$container->addMountedVolumes([
    $volume->mountTo('/some-path'),
]);

$pod->addVolumes([$volume]);

AWS Elastic Block Store

$volume = K8s::volume()->awsEbs('vol-1234', 'ext4');

$container->addMountedVolumes([
    $volume->mountTo('/some-path'),
]);

$pod->addVolumes([$volume]);
official documentation