n istio-system 输出: serviceaccount/grafana created configmap/grafana created service/grafana created deployment.apps...created configmap/istio-grafana-dashboards created configmap/istio-services-grafana-dashboards created deployment.apps...clusterrole.rbac.authorization.k8s.io/kiali created clusterrolebinding.rbac.authorization.k8s.io/kiali created service/kiali created deployment.apps... created clusterrolebinding.rbac.authorization.k8s.io/prometheus created service/prometheus created deployment.apps.../v1alpha1" unable to recognize "/usr/local/istio-1.8.1/samples/addons/kiali.yaml": no matches for kind
部署应用 首先,我们部署一个示例应用,在该应用程序上测试 Prometheus 指标自动缩放,资源清单文件如下所示:(podinfo.yaml) --- apiVersion: apps/v1 kind...比如 pod: {group: "apps", resource: "deployment"} 这么写表示的就是将指标中 podinfo 这个标签和 apps 这个 api 组中的 deployment...比如template: "kube_>_>" 这么写表示,假如 > 为 apps,> 为 deployment,那么它就是将指标中...kube_apps_deployment 标签和 deployment 资源关联起来。...matches:通过正则表达式来匹配指标名,可以进行分组 as:默认值为 $1,也就是第一个分组。as 为空就是使用默认值的意思。
假设deploy.yaml您要检查以下文件,以检查其当前目录中保存的最佳安全性和配置做法: apiVersion: apps/v1 kind: Deployment metadata: name:...我们应该得到如下输出: deploy.yaml: (object: portainer/portainer apps/v1, Kind=Deployment) container "portainer"...deploy.yaml: (object: portainer/portainer apps/v1, Kind=Deployment) container "portainer" is not set...deploy.yaml: (object: portainer/portainer apps/v1, Kind=Deployment) container "portainer" has memory...deploy.yaml: (object: portainer/portainer apps/v1, Kind=Deployment) container "portainer" has memory
68 # 将apps/v1beta2 改为 apps/v1 69 apiVersion: apps/v1 70 kind: Deployment 71 metadata: 72 labels:...": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1" 3 unable to recognize.../v1" 4 unable to recognize "manifests/kube-state-metrics-serviceMonitor.yaml": no matches for kind "...": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1" 7 unable to recognize...": no matches for kind "ServiceMonitor" in version "monitoring.coreos.com/v1" 11 unable to recognize
清单文件指定Label # nginx_deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment...deployment.apps/nginx-deployment created kubectl get pods -o wide NAME...清单文件指定亲和性 # nginx_deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment...sum by iterating through the elements of this field and adding // "weight" to the sum if the node matches...A null node selector term // matches no objects. type NodeSelectorTerm struct { // matchExpressions
kubectl apply namespace/bookbuyer configured serviceaccount/bookbuyer created service/bookbuyer created deployment.apps...configured service/bookstore created service/bookstore-v1 created serviceaccount/bookstore-v1 created deployment.apps...kubectl apply namespace/bookthief configured serviceaccount/bookthief created service/bookthief created deployment.apps...namespace/bookwarehouse configured serviceaccount/bookwarehouse created service/bookwarehouse created deployment.apps...matches: - buy-a-book - books-bought sources: - kind: ServiceAccount name: bookbuyer
随便创建几个工作负载,冒充微服务: $ kubectl create deploy ingress --image=nginx deployment.apps/ingress created $ kubectl...create deploy backend1 --image=nginx deployment.apps/backend1 created $ kubectl create deploy backend2...--image=nginx deployment.apps/backend2 created $ kubectl create deploy database --image=nginx deployment.apps...ingress --replicas=2 deployment.apps/ingress scaled $ kubectl get pods | cut -d - -f 1 | sort | uniq...$ kubectl scale deployment ingress --replicas=1 deployment.apps/ingress scaled $ kubectl get pods | cut
apiVersion: apps/v1 kind: Deployment metadata: name: cck-deployment spec: selector: matchLabels...HorizontalPodAutoscaler 对象,默认最小副本数为 1,cpu 或者 内存达到定义的限制开始扩容,最大副本数量为 4 apiVersion: autoscaling/v2beta1 kind...: HorizontalPodAutoscaler metadata: name: cck-deployment spec: scaleTargetRef: apiVersion: apps.../v1 kind: Deployment name: cck-deployment minReplicas: 1 maxReplicas: 8 metrics: - type...------ ------ ------- AbleToScale True ReadyForNewScale recommended size matches
资源清单如下所示:(hpa-demo.yaml) apiVersion: apps/v1 kind: Deployment metadata: name: hpa-demo spec: selector...资源清单如下所示:(hpa-mem-demo.yaml) apiVersion: apps/v1 kind: Deployment metadata: name: hpa-mem-demo spec...首先,我们部署一个示例应用,在该应用程序上测试 Prometheus 指标自动缩放,资源清单文件如下所示:(hpa-prome-demo.yaml) apiVersion: apps/v1 kind:...比如 nginx:{group:"apps",resource:"deployment"} 这么写表示的就是将指标中 nginx 这个标签和 apps 这个 api 组中的 deployment 资源关联起来...kube_apps_deployment 标签和 deployment 资源关联起来。
for kind "Deployment" in version "extensions/v1beta1" 这是因为我们的k8s集群是v1.16.xx版本,Deployment的版本已经改成了apps...apiVersion: apps/v1 kind: Deployment metadata: name: naftis-mysql labels: app: naftis-mysql...persistentvolumeclaim/naftis-mysql created service/naftis-mysql created pod/naftis-mysql-test created deployment.apps...pending> 80:31682/TCP 4m25s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps.../naftis-api 1/1 1 1 65s deployment.apps/naftis-mysql 1/1 1
/v1 kind: Deployment metadata: name: myapp1 spec: selector: matchLabels: app: myapp1...myapp1.yml [root@k8s-node1 ~]# vim demo/app/myapp2.yml [root@k8s-node1 ~]# kubectl apply -f demo/app/ deployment.apps.../myapp1 created service/myapp1 created deployment.apps/myapp2 created service/myapp2 created [root@k8s-node1...mysql.yml [root@k8s-node1 ~]# kubectl apply -f demo/ingressrouteTCP/mysql.yml configmap/mysql created deployment.apps...: Deployment apiVersion: apps/v1 metadata: name: whoamiudp labels: app: whoamiudp spec: replicas
1,ReplicationController apiVersion: v1 kind: ReplicationController metadata: name: apple-rctl labels.../ReplicaSet.yaml error: unable to recognize "deployment/ReplicaSet.yaml": no matches for kind "ReplicaSet...% kubectl apply -f deployment/ReplicaSet.yaml replicaset.apps/apple-rc create 3,StatefulSet 使用statefulset...apiVersion: apps/v1 kind: StatefulSet metadata: name: apple-ss spec: selector: matchLabels:...% kubectl apply -f deployment/statefulset.yaml statefulset.apps/apple-ss created 启动后我们发现状态一直没有ready
/argocd-applicationset-controller created deployment.apps/argocd-dex-server created deployment.apps/argocd-notifications-controller...created deployment.apps/argocd-redis created deployment.apps/argocd-repo-server created deployment.apps...Deployment default guestbook-ui Synced Healthy deployment.apps/guestbook-ui created [...Deployment default guestbook-ui Synced Healthy deployment.apps/guestbook-ui...Deployment default guestbook-ui Synced Healthy deployment.apps/guestbook-ui unchanged
/istio-egressgateway 1/1 1 1 20m deployment.apps/istio-ingressgateway 1...created service/reviews created serviceaccount/bookinfo-reviews created deployment.apps/reviews-v1 created...deployment.apps/reviews-v2 created deployment.apps/reviews-v3 created service/productpage created serviceaccount.../bookinfo-productpage created deployment.apps/productpage-v1 created 3.2 检查是否部署完成 ~/github/istio/istio.../prometheus created unable to recognize "samples/addons/kiali.yaml": no matches for kind "MonitoringDashboard
RUN_MODE: allinone ... --- # deployment.yaml apiVersion: apps/v1 kind: Deployment metadata:...# deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: demo-deployment spec: replicas...: MTIzNDU2Cg== ... --- # deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: demo-deployment...# deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: demo-deployment spec: replicas...apiVersion: apps/v1 kind: Deployment metadata: name: demo-deployment spec: replicas: 1 selector
kubectl rollout status deployment.v1.apps/nginx-deployment################查看历史并回滚####################...#################查看更新历史-看看我们设置的历史总记录数是否生效了kubectl rollout history deployment.v1.apps/nginx-deployment...#回滚kubectl rollout undo deployment.v1.apps/nginx-deployment --to-revision=2###############累计更新#######...########暂停记录版本kubectl rollout pause deployment.v1.apps/nginx-deployment#多次更新操作。...kubectl rollout history deployment.v1.apps/nginx-deployment#让多次累计生效kubectl rollout resume deployment.v1
namespace: server spec: matches: - name: api pathRegex: /api methods: ["*"]...: server-routes matches: - api sources: - kind: ServiceAccount name: client...(1)部署应用 apiVersion: v1 kind: Namespace metadata: name: whoami --- apiVersion: v1 kind: ServiceAccount...: name: whoami-client namespace: whoami --- kind: Deployment apiVersion: apps/v1 metadata: name...: Deployment apiVersion: apps/v1 metadata: name: whoami-tcp namespace: whoami spec: replicas: 2
prometheus部署yaml apiVersion: apps/v1 kind: Deployment metadata: name: prometheus-deployment spec:...default protocol: TCP port: 80 targetPort: 9090 --- apiVersion: route.openshift.io/v1 kind...部署prometheus $ k apply -f prometheus.yaml deployment.apps/prometheus-deployment created service/prometheus-service...80/TCP 88s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps...DESIRED CURRENT READY AGE replicaset.apps/prometheus-deployment-77cb49fb5d 1 1
# nginx_deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec...sum by iterating through the elements of this field and adding // "weight" to the sum if the node matches...preferredDuringSchedulingIgnoredDuringExecution,omitempty"` } // An empty preferred scheduling term matches...A null preferred scheduling term matches no objects. type PreferredSchedulingTerm struct { // weight...deployment.apps/nginx-deployment created 观察变化 kubectl get pod --watch -o wide NAME
领取专属 10元无门槛券
手把手带您无忧上云