Difference between revisions of "Kind: ReplicaSet"

From wikieduonline
Jump to navigation Jump to search
Line 3: Line 3:
  
 
https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#example
 
https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#example
<pre>
+
 
apiVersion: apps/v1
+
apiVersion: apps/v1
kind: ReplicaSet
+
kind: ReplicaSet
metadata:
+
metadata:
  name: frontend
+
  name: frontend
  labels:
+
  labels:
    app: guestbook
+
    app: guestbook
    tier: frontend
+
    tier: frontend
spec:
+
spec:
  # modify replicas according to your case
+
  # modify replicas according to your case
  replicas: 3
+
  replicas: 3
  selector:
+
  selector:
    matchLabels:
+
    matchLabels:
      tier: frontend
+
      tier: frontend
  template:
+
  template:
    metadata:
+
    metadata:
      labels:
+
      labels:
        tier: frontend
+
        tier: frontend
    spec:
+
    spec:
      containers:
+
      [[containers:]]
      - name: php-redis
+
      - name: php-redis
        image: gcr.io/google_samples/gb-frontend:v3
+
        image: gcr.io/google_samples/gb-frontend:v3
</pre>
 
  
 
== Related ==
 
== Related ==

Revision as of 09:31, 16 December 2022


https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#example

apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: frontend
  labels:
    app: guestbook
    tier: frontend
spec:
  # modify replicas according to your case
  replicas: 3
  selector:
    matchLabels:
      tier: frontend
  template:
    metadata:
      labels:
        tier: frontend
    spec:
      containers:
      - name: php-redis
        image: gcr.io/google_samples/gb-frontend:v3

Related

See also

Advertising: