Skip to content

Commit 0eddbb9

Browse files
committed
2 parents 0aa6db6 + c2d35e5 commit 0eddbb9

File tree

3 files changed

+15
-174
lines changed

3 files changed

+15
-174
lines changed

docs/openshift/core-concepts/index.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ Two primary members
1616

1717
## Resources
1818

19-
**OpenShift**
19+
=== "OpenShift"
20+
21+
[Pods :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/nodes/pods/nodes-pods-using.html){ .md-button target="_blank"}
2022

21-
- [Pods](https://docs.openshift.com/container-platform/4.13/nodes/pods/nodes-pods-using.html){:target="_blank"}
22-
- [Nodes](https://docs.openshift.com/container-platform/4.13/nodes/nodes/nodes-nodes-viewing.html){:target="_blank"}
23+
[Nodes :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/nodes/nodes/nodes-nodes-viewing.html){ .md-button target="_blank"}
2324

24-
**IKS**
25+
=== "Kubernetes"
2526

26-
- [Objects](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/){:target="_blank"}
27-
- [Kube Basics](https://kubernetes.io/docs/tutorials/kubernetes-basics/){:target="_blank"}
27+
[Objects :fontawesome-solid-globe:](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/){ .md-button target="_blank"}
28+
29+
[Kube Basics :fontawesome-solid-globe:](https://kubernetes.io/docs/tutorials/kubernetes-basics/){ .md-button target="_blank"}
2830

2931

3032
## References

docs/openshift/core-concepts/namespaces-projects/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ It is not necessary to use multiple namespaces just to separate slightly differe
1212

1313
=== "OpenShift"
1414

15-
[Working with Projects :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/applications/projects/working-with-projects.html){ .md-button }
16-
[Creating Projects :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/cli_reference/openshift_cli/getting-started-cli.html#creating-a-project){ .md-button }
17-
[Configure Project Creation :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/applications/projects/configuring-project-creation.html){ .md-button }
15+
[Working with Projects :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/applications/projects/working-with-projects.html){ .md-button target="_blank"}
16+
17+
[Creating Projects :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/cli_reference/openshift_cli/getting-started-cli.html#creating-a-project){ .md-button target="_blank" }
18+
19+
[Configure Project Creation :fontawesome-solid-globe:](https://docs.openshift.com/container-platform/4.13/applications/projects/configuring-project-creation.html){ .md-button target="_blank"}
1820

1921
=== "Kubernetes"
2022

21-
[Namespaces :fontawesome-solid-globe:](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/){ .md-button }
23+
[Namespaces :fontawesome-solid-globe:](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/){ .md-button target="_blank"}
2224

2325
## References
2426

docs/openshift/state-persistence/index.md

Lines changed: 1 addition & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,4 @@
1-
# Volumes
2-
3-
On-disk files in a Container are ephemeral, which presents some problems for non-trivial applications when running in Containers. First, when a Container crashes, kubelet will restart it, but the files will be lost - the Container starts with a clean state. Second, when running Containers together in a Pod it is often necessary to share files between those Containers. The Kubernetes Volume abstraction solves both of these problems.
4-
5-
Docker also has a concept of volumes, though it is somewhat looser and less managed. In Docker, a volume is simply a directory on disk or in another Container.
6-
7-
A Kubernetes volume, on the other hand, has an explicit lifetime - the same as the Pod that encloses it. Consequently, a volume outlives any Containers that run within the Pod, and data is preserved across Container restarts. Of course, when a Pod ceases to exist, the volume will cease to exist, too. Perhaps more importantly than this, Kubernetes supports many types of volumes, and a Pod can use any number of them simultaneously.
8-
9-
10-
## Resources
11-
12-
**OpenShift**
13-
14-
- [Volume Lifecycle](https://docs.openshift.com/container-platform/4.13/storage/understanding-persistent-storage.html#lifecycle-volume-claim_understanding-persistent-storage){:target="_blank"}
15-
16-
**IKS**
17-
18-
- [Volumes](https://kubernetes.io/docs/concepts/storage/volumes/){:target="_blank"}
19-
20-
21-
## References
22-
23-
24-
```yaml
25-
apiVersion: v1
26-
kind: Pod
27-
metadata:
28-
name: my-pod
29-
spec:
30-
containers:
31-
- image: busybox
32-
command: ['sh', '-c', 'echo Hello Kubernetes! && sleep 3600']
33-
name: busybox
34-
volumeMounts:
35-
- mountPath: /cache
36-
name: cache-volume
37-
volumes:
38-
- name: cache-volume
39-
emptyDir: {}
40-
```
41-
42-
```yaml
43-
apiVersion: v1
44-
kind: Pod
45-
metadata:
46-
name: test-pd
47-
spec:
48-
containers:
49-
- image: bitnami/nginx
50-
name: test-container
51-
volumeMounts:
52-
- mountPath: /test-pd
53-
name: test-volume
54-
volumes:
55-
- name: test-volume
56-
hostPath:
57-
# directory location on host
58-
path: /data
59-
# this field is optional
60-
type: Directory
61-
```
62-
63-
# PersistentVolumes and PersistentVolumeClaims
64-
65-
Managing storage is a distinct problem from managing compute instances. The PersistentVolume subsystem provides an API for users and administrators that abstracts details of how storage is provided from how it is consumed.
66-
67-
A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using Storage Classes.
68-
69-
A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a Pod. Pods consume node resources and PVCs consume PV resources. Claims can request specific size and access modes (e.g., they can be mounted once read/write or many times read-only).
70-
71-
While PersistentVolumeClaims allow a user to consume abstract storage resources, it is common that users need PersistentVolumes with varying properties, such as performance, for different problems. Cluster administrators need to be able to offer a variety of PersistentVolumes that differ in more ways than just size and access modes, without exposing users to the details of how those volumes are implemented. For these needs, there is the StorageClass resource.
72-
73-
Pods access storage by using the claim as a volume. Claims must exist in the same namespace as the Pod using the claim. The cluster finds the claim in the Pod’s namespace and uses it to get the PersistentVolume backing the claim. The volume is then mounted to the host and into the Pod.
74-
75-
PersistentVolumes binds are exclusive, and since PersistentVolumeClaims are namespaced objects, mounting claims with “Many” modes (ROX, RWX) is only possible within one namespace.
76-
77-
78-
79-
## Resources
80-
**OpenShift**
81-
82-
- [Persistent Storage](https://docs.openshift.com/container-platform/4.13/storage/understanding-persistent-storage.html){:target="_blank"}
83-
- [Persistent Volume Types](https://docs.openshift.com/container-platform/4.13/storage/understanding-persistent-storage.html#types-of-persistent-volumes_understanding-persistent-storage){:target="_blank"}
84-
- [Expanding Peristent Volumes](https://docs.openshift.com/container-platform/4.13/storage/expanding-persistent-volumes.html){:target="_blank"}
85-
86-
**IKS**
87-
88-
- [Persistent Volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/){:target="_blank"}
89-
- [Writing Portable Configurations](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#writing-portable-configuration){:target="_blank"}
90-
- [Configuring Persistent Volume Storage](https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/){:target="_blank"}
91-
92-
## References
93-
94-
```yaml
95-
kind: PersistentVolume
96-
apiVersion: v1
97-
metadata:
98-
name: my-pv
99-
spec:
100-
storageClassName: local-storage
101-
capacity:
102-
storage: 128Mi
103-
accessModes:
104-
- ReadWriteOnce
105-
hostPath:
106-
path: "/mnt/data-1"
107-
```
108-
109-
```yaml
110-
apiVersion: v1
111-
kind: PersistentVolumeClaim
112-
metadata:
113-
name: my-pvc
114-
spec:
115-
storageClassName: local-storage
116-
accessModes:
117-
- ReadWriteOnce
118-
resources:
119-
requests:
120-
storage: 100Mi
121-
```
122-
123-
```yaml
124-
kind: Pod
125-
apiVersion: v1
126-
metadata:
127-
name: my-pod
128-
spec:
129-
containers:
130-
- name: nginx
131-
image: busybox
132-
command: ['sh', '-c', 'echo $(date):$HOSTNAME Hello Kubernetes! >> /mnt/data/message.txt && sleep 3600']
133-
volumeMounts:
134-
- mountPath: "/mnt/data"
135-
name: my-data
136-
volumes:
137-
- name: my-data
138-
persistentVolumeClaim:
139-
claimName: my-pvc
140-
```
141-
142-
=== "OpenShift"
143-
144-
``` Bash title="Get the Persistent Volumes in Project"
145-
oc get pv
146-
```
147-
148-
``` Bash title="Get the Persistent Volume Claims"
149-
oc get pvc
150-
```
151-
152-
``` Bash title="Get a specific Persistent Volume"
153-
oc get pv <pv_claim>
154-
```
155-
156-
=== "Kubernetes"
157-
158-
``` Bash title="Get the Persistent Volume"
159-
kubectl get pv
160-
```
161-
162-
``` Bash title="Get the Persistent Volume Claims"
163-
kubectl get pvc
164-
```
1+
# State Persistence
1652

1663
## Activities
1674

0 commit comments

Comments
 (0)