Let’s look at the following diagram to create Kubernetes Replication Controller:
![](https://datmt.com/wp-content/uploads/2021/06/image-19.png)
What to remember when creating ReplicationController
- apiVersion: v1
- You can define number of
replicas
,selector
andtemplate
underspec
spec->template
has its ownspec
section along sidemetadata
- You specify containers’ related attributes under
template
‘s spec
Create ReplicationController YAML file example
apiVersion: v1 kind: ReplicationController metadata: name: nginx spec: replicas: 3 selector: app: nginx template: metadata: name: nginx labels: app: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80
![](https://datmt.com/wp-content/uploads/2023/02/1585613908477.jpeg)
I build softwares that solve problems. I also love writing/documenting things I learn/want to learn.