Difference between revisions of "Selector:"

From wikieduonline
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
  https://aws.github.io/aws-eks-best-practices/reliability/docs/dataplane/
 
  https://aws.github.io/aws-eks-best-practices/reliability/docs/dataplane/
<pre>
 
apiVersion: apps/v1
 
kind: Deployment
 
metadata:
 
  name: web-server
 
spec:
 
  replicas: 3
 
  selector:
 
    matchLabels:
 
      app: web-server
 
  template:
 
    metadata:
 
      labels:
 
        app: web-server
 
    spec:
 
      topologySpreadConstraints:
 
        - maxSkew: 1
 
          whenUnsatisfiable: ScheduleAnyway
 
          topologyKey: topology.kubernetes.io/zone
 
          labelSelector:
 
            matchLabels:
 
              app: web-server
 
      containers:
 
      - name: web-app
 
        image: nginx
 
        resources:
 
          requests:
 
            cpu: 1
 
  
</pre>
+
apiVersion: apps/v1
 +
[[kind: Deployment]]
 +
metadata:
 +
  name: web-server
 +
spec:
 +
  replicas: 3
 +
  [[selector:]]
 +
    [[matchLabels:]]
 +
      app: web-server
 +
  template:
 +
    metadata:
 +
      labels:
 +
        app: web-server
 +
    spec:
 +
      topologySpreadConstraints:
 +
        - maxSkew: 1
 +
          whenUnsatisfiable: ScheduleAnyway
 +
          topologyKey: topology.kubernetes.io/zone
 +
          labelSelector:
 +
            matchLabels:
 +
              app: web-server
 +
      containers:
 +
      - name: web-app
 +
        image: nginx
 +
        resources:
 +
          requests:
 +
            cpu: 1
 +
 
  
  
Line 43: Line 42:
 
== See also ==
 
== See also ==
 
* {{Kubernetes selectors}}
 
* {{Kubernetes selectors}}
 +
 +
[[Category:K8s]]

Latest revision as of 17:41, 15 February 2024

kind: Deployment
kind: Service


https://aws.github.io/aws-eks-best-practices/reliability/docs/dataplane/
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-server
spec:
  replicas: 3
  selector:
    matchLabels:
      app: web-server
  template:
    metadata:
      labels:
        app: web-server
    spec:
      topologySpreadConstraints:
        - maxSkew: 1
          whenUnsatisfiable: ScheduleAnyway
          topologyKey: topology.kubernetes.io/zone
          labelSelector:
            matchLabels:
              app: web-server
      containers:
      - name: web-app
        image: nginx
        resources:
          requests:
            cpu: 1


nodeSelector:


See also[edit]

Advertising: