Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.3.2 - Can't create Service object because no rc #47

Open
mrismailt opened this issue Oct 5, 2022 · 1 comment
Open

2.3.2 - Can't create Service object because no rc #47

mrismailt opened this issue Oct 5, 2022 · 1 comment

Comments

@mrismailt
Copy link

mrismailt commented Oct 5, 2022

The following app deployment code in 2.3.1 doesn't work because the generator flag has been deprecated:

kubectl run kubia --image=luksa/kubia --port=8080 --generator=run/v1

Therefore, we are forced to run the command without that flag, as follows:

kubectl run kubia --image=luksa/kubia --port=8080

This means that we don't end up creating a ReplicationController and thus, the following code from 2.3.2 for deploying a Service object of type LoadBalancer doesn't work:

k expose rc kubia --type=LoadBalancer --name kubia-http

What is the correct way to run the code from 2.3.1 to create a ReplicationController that would allow us to follow along with the remaining examples in the chapter?

@TigrekTechnologies
Copy link

ReplicationControllers have been deprecated in favor of ReplicaSets. However, you should not be creating these directly but instead managing them through Deployments. So, in order to continue following along with the book, the following code from the book:

kubectl run kubia --image=luksa/kubia --port=8080 --generator=run/v1

should be replaced with:

kubectl create kubia --image=luksa/kubia --port=8080

This will create a Deployment and you can use k get replicaset to view the ReplicaSet (instead of the ReplicationController like shown in 2.3.4). Basically any example you come across in the book that uses an rc can (hopefully) be replaced with a ReplicaSet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants