Skip to content

Commit 566119d

Browse files
committed
rmateus todo
Signed-off-by: Ricardo Mateus <[email protected]>
1 parent e81cf38 commit 566119d

File tree

1 file changed

+122
-0
lines changed
  • containers/srv/uyuni-container

1 file changed

+122
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
- run in kubernetes
2+
- use volumes to store data and recreate
3+
- clean system variables
4+
- split in different containers
5+
6+
# run in kubernetes with minikube
7+
```
8+
podman image save localhost/uyuni > uyuni.tar
9+
curl -sfL https://get.k3s.io | sh -
10+
k3s ctr image import uyuni.tar
11+
```
12+
13+
- Check if response the node with the current version
14+
`k3s kubectl get node`
15+
- Create the namespace (only dev)
16+
`kubectl create namespace uyuni`
17+
18+
- Create ingress, service, and deployment
19+
`k3s kubectl apply -f uyuni.yaml`
20+
21+
- Check ingress (its show your IP), service and pods
22+
`k3s kubectl get ingress,svc,pods -n uyuni`
23+
24+
- Test cluster and app
25+
curl -X GET http://YOUR_IP
26+
27+
- That is the output
28+
{"data":"RESTful with two Endpoint /users and /notes - v1.0.0"}
29+
30+
31+
*****************************************
32+
k3s kubectl ...
33+
34+
k3s kubectl create -f hub-opensuse152.yml
35+
k3s kubectl get po -A
36+
k3s kubectl describe pod hub-opensuse152
37+
k3s kubectl delete po hub-opensuse152
38+
39+
https://dev.to/fransafu/the-first-experience-with-k3s-lightweight-kubernetes-deploy-your-first-app-44ea
40+
41+
## create ymal configuration file
42+
podman pod create -n hub-opensuse152 -p 4505:4505 -p 4506:4506 -p 443:443 -p 5432:5432 --hostname hub-opensuse152
43+
44+
podman run --pod hub-opensuse152 -ti --name hub-opensuse152-server localhost/uyuni
45+
46+
podman generate kube hub-opensuse152 > hub-opensuse152.yml
47+
48+
open file and remove the last empty lines
49+
> change image to be load from localhost:5000/uyuni
50+
51+
podman pod rm hub-opensuse152
52+
53+
54+
## install minikube
55+
https://minikube.sigs.k8s.io/docs/start/
56+
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
57+
sudo rpm -ivh minikube-latest.x86_64.rpmdes
58+
59+
## start minikube
60+
minikube start --force --driver=podman
61+
62+
minikube kubectl -- get po -A
63+
64+
## image deployment?
65+
66+
67+
## deployment and management
68+
minikube kubectl -- delete po hub-opensuse152
69+
70+
minikube kubectl -- create -f hub-opensuse152.yml
71+
72+
minikube kubectl -- get po -A
73+
74+
minikube kubectl -- describe pod hub-opensuse152
75+
76+
77+
78+
79+
80+
81+
82+
83+
84+
85+
86+
---
87+
88+
# build image to minikube
89+
https://minikube.sigs.k8s.io/docs/handbook/pushing/#3-pushing-directly-to-in-cluster-cri-o-podman-env
90+
91+
# local registry
92+
https://hasura.io/blog/sharing-a-local-registry-for-minikube-37c7240d0615/
93+
94+
podman run -p 5000:5000 registry
95+
96+
find contaniner ip address
97+
> podman inspect -f '{{ .NetworkSettings.IPAddress }}' <Contanier_id>
98+
99+
- edit file
100+
/etc/containers/registries.conf
101+
add local image to the registry untrust
102+
---------------
103+
kube-registry.yaml: https://gist.github.com/coco98/b750b3debc6d517308596c248daf3bb1
104+
105+
minikube kubectl -- create -f kube-registry.yaml
106+
107+
minikube kubectl -- get po -n kube-system | grep kube-registry-v0 | \awk '{print $1;}'
108+
-out put goes to:
109+
minikube kubectl -- port-forward --namespace kube-system kube-registry-v0-qbclg 5000:5000
110+
111+
# run in kubernetes
112+
--- share image
113+
- build image
114+
sudo podman build -t uyuni .
115+
116+
-- tag image
117+
podman tag uyuni localhost:5000/uyuni
118+
podman push localhost:5000/uyuni
119+
120+
---
121+
122+
--

0 commit comments

Comments
 (0)