You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/RESOURCES.md
+3-5
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,10 @@
10
10
11
11
Instances are custom classes that makes the build of containers, for example, more object-oriented that passing an array.
12
12
13
+
-[Affinity](instances/Affinity.md) - used to declare affinities and anti-affinities
13
14
-[Container](instances/Container.md) - used for Pods & Templates
14
15
-[Container Probes](instances/Probes.md) - used for Pods' Probes
16
+
-[Expressions](instances/Expression.md) - used for various match/fields expressions
15
17
-[Resource Metrics](instances/Metrics.md) - used for Horizontal Pod Autoscalers
16
18
-[Rules](instances/Rules.md) - used for Roles & Cluster Roles
17
19
-[Volumes](instances/Volumes.md) - used for mounting volumes in pods and containers
@@ -22,6 +24,7 @@ Each resource inherits a default "base" class that is making the Resource build-
22
24
23
25
**Check the documentation for [General Resources](kinds/Resource.md) and [K8s API Usage](Usage.md) before diving in to the actual resources documentation.**
24
26
27
+
-[Nodes](kinds/Node.md)
25
28
-[Namespaces](kinds/Namespace.md)
26
29
-[Config Maps](kinds/ConfigMap.md)
27
30
-[Secrets](kinds/Secret.md)
@@ -60,11 +63,6 @@ The following list of resources are work in progress and they will be available
60
63
- poddisruptionbudgets
61
64
- podsecuritypolicies
62
65
63
-
The following concepts are work in progress as instances:
64
-
65
-
- pod affinity
66
-
- node affinity
67
-
68
66
# Discussable
69
67
70
68
The following list of resources might not be useful for the basic needs, so they will be gladly accepted via PR in case there is a need of the resources or they might get discussed and implemented after further reasearch on the structure of the resource.
Copy file name to clipboardexpand all lines: docs/kinds/Pod.md
+12-3
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,17 @@ $pod = $cluster->pod()
35
35
36
36
Pods can attach volumes so that container can mount them. Please check the [Container documentation](../instances/Container.md) where you can find details on how to attach volumes for different drivers.
37
37
38
+
## Attaching affinities & anti-affinities
39
+
40
+
Pods can declare `affinity` to handle pod and node affinities and anti-affinities. Check [Affinity documentation](../instances/Affinity.md) to read more about the pod affinity and anti-affinity declarations.
41
+
42
+
You can simply attach affinities for both pod and node by calling specialized methods:
43
+
44
+
```php
45
+
$pod->setPodAffinity($affinity);
46
+
$pod->setNodeAffinity($affinity);
47
+
```
48
+
38
49
## Container Retrieval
39
50
40
51
Retrieving the containers and init containers can be retrieved as an array of `\RenokiCo\PhpK8s\Instances\Container` classes or as an array.
@@ -59,9 +70,7 @@ foreach ($containers as $container) {
59
70
60
71
## Pod Logs
61
72
62
-
Pods can contain logs, and PHP K8s is good at it. Before checking how it works, please see the [Live Tracking](../../README.md#live-tracking) section from README to see how the closures really work at interpreting the real-time data in Kubernetes.
63
-
64
-
Retrieve a single string with all logs until the point of call:
73
+
Pods can contain logs, and PHP K8s is good at it. You can retrieve a single string with all logs until the point of call:
0 commit comments