ns,jobs
This commit is contained in:
parent
de61dcf254
commit
ad670c36ff
1 changed files with 115 additions and 0 deletions
|
@ -2,6 +2,9 @@
|
|||
Kubernetes
|
||||
**********
|
||||
|
||||
* Deployment → ReplicaSet → Pods → Containers
|
||||
* 1 IP address per pod
|
||||
|
||||
Pods
|
||||
====
|
||||
|
||||
|
@ -164,3 +167,115 @@ Write
|
|||
.. warning::
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue