Difference between revisions of "Selector:"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
  
 +
<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>
  
  
 
== See also ==
 
== See also ==
 
* {{Kubernetes selectors}}
 
* {{Kubernetes selectors}}

Revision as of 15:39, 16 December 2022

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


See also

Advertising: