Skip to content

Commit

Permalink
kube upt to deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
oshadmon committed Feb 4, 2022
1 parent 6a1aa88 commit ea28043
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 3 deletions.
64 changes: 62 additions & 2 deletions Kubernetes/depoy_kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,78 @@ kompose convert -f ~/docker-compose/docker-compose.yml
```commandline
minikube start --insecure-registry="${LOCAL_IP}:5000"
eval $(minikube docker-env)
# for RPI
minikube -p minikube docker-env
```

3. Start processes
```commandline
kubectl apply -f $HOME/kube
```

4. Stop processes
4Stop processes
```commandline
kubectl delete -f $HOME/kube
```

## Updating Service Information
In cases where standard `port-forwarding` doesn't work (ex. Minikube), user should attempt to change `ClusterIP` to `NodePort` in the
1. Edit the service you're unable to `port-forward` against
```commandline
kubectl edit service ${SERVICE_NAME}
```

2. replace `ClusterIP` to `NodePort`(using sed)
```yaml
# before
ports:
- name: "13480"
nodePort: 31266
port: 13480
protocol: TCP
targetPort: 13480
- name: "13481"
nodePort: 31956
port: 13481
protocol: TCP
targetPort: 13481
- name: "13482"
nodePort: 31296
port: 13482
protocol: TCP
targetPort: 13482
selector:
io.kompose.service: ${SERVICE_NAME}
sessionAffinity: None
type: ClusterIP

# after
ports:
- name: "13480"
nodePort: 31266
port: 13480
protocol: TCP
targetPort: 13480
- name: "13481"
nodePort: 31956
port: 13481
protocol: TCP
targetPort: 13481
- name: "13482"
nodePort: 31296
port: 13482
protocol: TCP
targetPort: 13482
selector:
io.kompose.service: ${SERVICE_NAME}
sessionAffinity: None
type: NodePort
```
3. Generate `IP:PORT` to execute against
```commandline
minikube service --url ${SERVICE_NAME}
```
## Commands
* list (running) pods
```commandline
Expand All @@ -47,5 +107,5 @@ kubectl logs ${POD_NAME}
```
* Port-Forwarding
```commandline
kubectl port-forward --address=${LOCAL_IP} service/${SERVICE_NAME} ${PORT}:${PORT}
kubectl port-forward --address=${LOCAL_IP} service/${SERVICE_NAME} LOCAL_PORT:REMOTE_PORT
```
2 changes: 1 addition & 1 deletion Kubernetes/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sudo apt-get -y update
sudo apt-get -y install curl
curl -L https://github.com/kubernetes/kompose/releases/download/v1.26.1/kompose-linux-amd64 -o kompose
chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
sudo install ./kompose /usr/local/bin/kompose
sudo apt-get update

# Validate
Expand Down

0 comments on commit ea28043

Please sign in to comment.