-
Notifications
You must be signed in to change notification settings - Fork 35
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
Replace docker with podman #19
Conversation
This commit updates the cloud-native tutorial to use Podman instead of Docker/Docker Desktop.
``` | ||
We can now build the image directly using `minikube image build`: | ||
```console | ||
$ minikube image build -t $(minikube ip):42631/nodeserver:1.0.0 --file Dockerfile-run . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This did not work for me in a Windows cmd shell.
I had to do the following which did work:
C:\Users\midawson\workshop\tutorial\nodeserver>minikube ip
172.26.219.253
C:\Users\midawson\workshop\tutorial\nodeserver> minikube image build -t 172.26.219.253:42631/nodeserver:1.0.0 --file Dockerfile-run .
It also took quite a while to run without output so might be worth mentioning that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll investigate tomorrow a bit more. Also I'll check if we can do pull/push etc. using the podman Desktop registry UI.
``` | ||
Next, we push the image into the registry using: | ||
```console | ||
$ minikube image push $(minikube ip):42631/nodeserver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the IP isntead of $(minikube ip) here as well
@@ -448,7 +445,7 @@ Kubernetes has a concept of a 'Service', which is an abstract way to expose an a | |||
3. You can forward the `nodeserver-service` to your device by: | |||
|
|||
```sh | |||
kubectl port-forward service/nodeserver-service 3000 | |||
minikube kubectl -- port-forward service/nodeserver-service 3000 | |||
``` | |||
|
|||
You can now access the application endpoints from your browser. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be handy to add the links to the app, metrics and health endpoints again here, just like in the other sections.
export POD_NAME=$(kubectl get pods --namespace grafana -o jsonpath="{.items[0].metadata.name}") | ||
kubectl --namespace grafana port-forward $POD_NAME 3001:3000 | ||
export POD_NAME=$(minikube kubectl -- get pods --namespace grafana -o jsonpath="{.items[0].metadata.name}") | ||
minikube kubectl -- --namespace grafana port-forward $POD_NAME 3001:3000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the On Windows section the corresponding change is missing.
minikube needs to be added in front of kubectl in both lines
minikube
needs to be changed to minikube kubectl --
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same is true right at the end where is says kubectl config set-context --current --namespace=default
kubectl needs to be changed to minikube kubectl --
cloud-native/README.md
Outdated
Install docker compose | ||
1. Select the Docker icon in the Menu Bar | ||
2. Click `Preferences/Settings > Kubernetes > Enable Kubernetes`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not refer to docker anymore right?
should likely be
podman machine init --cpus 4 --memory 8096 --disk-size 50
podman machine start
podman system connection default podman-machine-default-root
minikube start --driver=podman --container-runtime=cri-o
(with podman machine stop, podman machine rm first if the machine is already created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found other instructions which said
podman machine init --cpus 2 --memory 2048 --disk-size 20
podman machine start
podman system connection default podman-machine-default-root
podman info
so using less memory/cpus may make sense, I used the larger numbers but we should try the smaller ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the mac flow.
cloud-native/README.md
Outdated
Using [Chocolatey](https://docs.chocolatey.org/en-us/choco/setup#install-with-powershell.exe) Package Manager | ||
|
||
#### `microk8s` | ||
1. Install minikube with Chocolatey Package manager by using this command in PowerShell | ||
|
||
<details> | ||
``` | ||
choco install minikube | ||
``` | ||
|
||
```sh | ||
snap install --channel 1.14/stable microk8s --classic | ||
sudo usermod -a -G microk8s ibmuser | ||
sudo microk8s.start | ||
sudo snap alias microk8s.kubectl kubectl | ||
export PATH=/snap/bin:$PATH | ||
sudo microk8s.config >~/.kube/config | ||
microk8s.enable dns registry | ||
``` | ||
2. Start minikube |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using [Chocolatey](https://docs.chocolatey.org/en-us/choco/setup#install-with-powershell.exe) Package Manager | |
#### `microk8s` | |
1. Install minikube with Chocolatey Package manager by using this command in PowerShell | |
<details> | |
``` | |
choco install minikube | |
``` | |
```sh | |
snap install --channel 1.14/stable microk8s --classic | |
sudo usermod -a -G microk8s ibmuser | |
sudo microk8s.start | |
sudo snap alias microk8s.kubectl kubectl | |
export PATH=/snap/bin:$PATH | |
sudo microk8s.config >~/.kube/config | |
microk8s.enable dns registry | |
``` | |
2. Start minikube | |
1. Start minikube |
I think minikube installation is covered in other sections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have it as a prerequisite at the start of the document, we dont cover the installation process. In case of adding it, should we go with the binary/PATH method or with a package manager? The only drawback I see with the binary/PATH method is that the developers are not that much familiar otherwise in terms of time and steps its the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit reference 637936c
Had a few specific comments but overall on Windows seemed to flow ok. Three things we should think about for follow on PRs
|
One other thing is that at least on windows it does require admin access to install the pieces needed (podman which requires both hyperv and wsl). I think we better try to get a message to participants in advance with the warning that admin access is needed, and that they should if at all possible install X,Y,Z in advance depending on the platform |
One more, do we even need podman desktop? I don't think we use or mention it in the workshop (although we might want to change that). I wondered about that as the installation instructions don't include the link for Mac, although it is available. |
3bcc08d
to
637936c
Compare
@@ -337,6 +338,52 @@ You have now built a container image for your application called `nodeserver` wi | |||
|
|||
This runs your container image in a Podman container, mapping port 3000 from the container to port 3000 on your laptop so that you can access the application. | |||
|
|||
#### On Windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had locally and forgot to push:
- Instructions for windows users with images for using podman desktop for building and running container images.
My status on PR