This commit is contained in:
Marc Beninca 2023-07-09 07:26:28 +02:00
parent de61dcf254
commit ad670c36ff

View file

@ -2,6 +2,9 @@
Kubernetes Kubernetes
********** **********
* Deployment → ReplicaSet → Pods → Containers
* 1 IP address per pod
Pods Pods
==== ====
@ -164,3 +167,115 @@ Write
.. warning:: .. warning::
ClusterIP is immutable! ClusterIP is immutable!
NameSpaces
==========
Special:
* default
* kube-node-lease
* kube-public
* kube-system
Outside:
* Nodes
* Pod Security Policies
* Persistent Volumes
.. code:: shell
kubectl api-resources \
--namespaced false
Read
----
.. code:: shell
kubectl \
get namespaces
Write
-----
.. code:: shell
kubectl \
create ns my-namespace
.. code:: shell
kubectl \
delete ns my-namespace
Jobs
====
* one-time
* sequential
* parallel
CronJob → Job → Pods
Read
----
.. code:: shell
kubectl \
get jobs \
-n my-namespace
Write
-----
.. code:: shell
kubectl \
create job my-job \
--image my-image \
-n my-namespace
.. code:: shell
kubectl \
create job my-job \
--from cronjob/my-cronjob \
-n my-namespace
.. code:: shell
kubectl \
apply -f file.yaml \
-n my-namespace
.. code:: yaml
apiVersion: batch/v1
kind: Job
metadata:
name: my-job
spec:
activeDeadlineSeconds: 60
backoffLimit: 4
completions: 1
parallelism: 1
template:
spec:
containers:
- name: my-container
image: my-image
restartPolicy: OnFailure
.. code:: shell
kubectl \
delete job my-job \
-n my-namespace
.. code:: shell
kubectl \
delete job my-job \
cascade=false \
-n my-namespace