求知 文章 文库 Lib 视频 iPerson 课程 认证 咨询 工具 讲座 Model Center   Code  
会员   
要资料
 
 
 

Kubernetes教程
Kubernetes概述
Kubernetes设计架构
kubernetes设计理念
创建Kubernetes集群
基于Docker本地运行Kubernetes
使用Vagrant
本地运行Kubrenetes v1.0
Google Computer Engine入门
AWS EC2快速入门
在Azure上使用CoreOS和Weave的 Kubernetes
从零开始k8s
CoreOS部署Kubernetes集群
CloudStack部署Kubernetes集群
vSphere部署Kubernetes集群
Ferdora部署Kubernetes集群
CentOS部署Kubernetes集群
Ubuntu物理节点上部署Kubernets集群
Mesos部署Kubernetes集群
Kubernetes用户指南:应用程序管理
名词解释 Pods
名词解释 Labels
名词解释:Namespace
名词解释 Replication Controller
名词解释:Node
名词解释:ReplicaSets
名词解释 Services
名词解释 Volumes
名词解释:PV/PVC/StorageClass
名称解释:Deployment
名词解释:Secret
名词解释:StatefulSet
名词解释:DaemonSet
名词解释:Service Account
名词解释:CronJob
名词解释:Job
名词解释:Security Context和PSP
名词解释:Resource Quotas
名词解释:Network Policy
名词解释:Ingress
名词解释:ThirdPartyResources
名词解释:ConfigMap
名词解释:PodPreset
配置Kubernetes
管理应用:部署持续运行的应用
Horizontal Pod Autoscaling
管理应用:连接应用
管理应用: 在生产环境中使用Pods和容器
Kubernetes UI
Kube-API Server
授权插件
认证插件
API Server端口配置
Admission Controller
Service Accounts集群管理指南
使用Kubernetes在云上原生部署cassandra
Spark例子
Storm 示例
示例: 分布式任务队列 Celery, RabbitMQ和Flower
Kubernetes在Hazelcast平台上部署原生云应用
Meteor on Kuberenetes
配置文件使用入门
环境向导示例
在Kubernetes上运行你的第一个容器
kubectl
安装和设置kubectl
kubectl annotate
kubectl api-versions
kubectl apply
kubectl attach
kubectl cluster-info
kubectl config
kubectl config set-cluster
kubectl config set-context
kubectl config set-credentials
kubectl config set
kubectl config unset
kubectl config use-context
kubectl config view
kubectl create
kubectl delete
kubectl describe
kubectl edit
kubectl exec
kubectl logs
kubectl version
故障排查
应用程序相关的故障排查
 
 

名词解释:ThirdPartyResources
 
1330 次浏览
52次  

ThirdPartyResources

ThirdPartyResources是一种无需改变代码就可以扩展Kubernetes API的机制,可以用来管理自定义对象。每个ThirdPartyResource都包含以下属性

metadata:跟kubernetesmetadata一样

kind:自定义的资源类型,采用<kind mame>.<domain>的格式

description:资源描述

versions:版本列表

其他:还可以保护任何其他自定义的属性

ThirdPartyResources将在v1.7弃用

ThirdPartyResources将在v1.7弃用,并在未来版本中删除。建议从v1.7开始,迁移到CustomResourceDefinition。

下面的例子会创建一个/apis/stable.example .com/v1/namespaces/ <namespace> /crontabs/…的API

$ cat resource.yaml
apiVersion: extensions/v1beta1
kind: ThirdPartyResource
metadata:
name: cron-tab .stable.example.com
description: " A specification of a Pod to run on a cron style schedule"
versions:
- name: v1

$ kubectl create -f resource.yaml
thirdpartyresource " cron-tab.stable.example.com" created

API创建好后,就可以创建具体的CronTab对象了

$ cat my-cronjob.yaml
apiVersion: "stable.example.com/v1"
kind: CronTab
metadata:
name: my -new-cron-object
cronSpec: "* * * * /5"
image: my-awesome-cron-image

$ kubectl create -f my -crontab.yaml
crontab "my-new -cron-object" created

$ kubectl get crontab
NAME KIND
my-new-cron-object CronTab.v1.stable.example.com

ThirdPartyResources与RBAC

注意ThirdPartyResources不是namespace-scoped的资源,在普通用户使用之前需要绑定ClusterRole权限。

$ cat cron-rbac.yaml
apiVersion: rbac.authorization.k8s.io/ v1alpha1
kind: ClusterRole
metadata:
name: cron-cluster-role
rules:
- apiGroups:
- extensions
resources:
- thirdpartyresources
verbs:
- '*'
- apiGroups:
- stable.example.com
resources:
- crontabs
verbs:
- "*"

$ kubectl create -f cron-rbac.yaml
$ kubectl create clusterrolebinding user1 --clusterrol e= cron-cluster-role --user=user1 --user=user2 --group=group1


您可以捐助,支持我们的公益事业。

1元 10元 50元





认证码: 验证码,看不清楚?请点击刷新验证码 必填



1330 次浏览
52次
 捐助