Let’s look at the following diagram to create Kubernetes Replication Controller:
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
I build softwares that solve problems. I also love writing/documenting things I learn/want to learn.