Difference between revisions of "Kind: ReplicaSet"

From wikieduonline
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
 +
https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#example
  
 
+
[[apiVersion:]] apps/v1
https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#example
+
kind: ReplicaSet
<pre>
+
[[metadata:]]
apiVersion: apps/v1
+
  name: frontend
kind: ReplicaSet
+
  labels:
metadata:
+
    app: guestbook
  name: frontend
+
    tier: frontend
  labels:
+
[[spec:]]
    app: guestbook
+
  # modify replicas according to your case
    tier: frontend
+
  replicas: 3
spec:
+
  selector:
  # modify replicas according to your case
+
    matchLabels:
  replicas: 3
+
      tier: frontend
  selector:
+
  template:
    matchLabels:
+
    metadata:
      tier: frontend
+
      labels:
  template:
+
        tier: frontend
    metadata:
+
    spec:
      labels:
+
      [[containers:]]
        tier: frontend
+
      - name: php-redis
    spec:
+
        image: gcr.io/google_samples/gb-frontend:v3
      containers:
 
      - name: php-redis
 
        image: gcr.io/google_samples/gb-frontend:v3
 
</pre>
 
  
 
== Related ==
 
== Related ==
 
* <code>[[kind: Deployment]]</code>
 
* <code>[[kind: Deployment]]</code>
 +
* <code>[[kind: Pod]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 09:40, 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[edit]

See also[edit]

Advertising: