首页 > Web开发 > 详细

Kubernetes学习(五)

时间:2020-02-07 23:58:56      阅读:115      评论:0      收藏:0      [点我收藏+]

五 DaemonSet,Job,CronJob

技术分享图片

DaemonSet举例

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: daemonset-example
labels:
app: daemonset
spec:
selector:
matchLabels:
name: daemonset-example
template:
metadata:
labels:
name: daemonset-example
spec:
containers:
- name: daemonset-example
image: wangyanglinux/myapp:v4

技术分享图片

Job举例

apiVersion: batch/v1
kind: Job
metadata:
name: pi
spec:
template:
metadata:
name: pi
spec:
containers:
- name: pi
image: perl
command: [‘perl‘,‘-Mbignum=bpi‘,‘-wle‘,‘print bpi(2000)‘]
restartPolicy: Never

技术分享图片

 

 

 技术分享图片

技术分享图片

 

 CronJob举例说明

apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hello
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
args:
- /bin/sh
- -c
- date; echo Hello from the kubernetes cluster
restartPolicy: OnFailure

Kubernetes学习(五)

原文:https://www.cnblogs.com/lovedairan/p/12274923.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!