Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/progrhyme/compose-to-minikube
Sample App Run by docker-compose and Kubernetes
https://github.com/progrhyme/compose-to-minikube
docker-compose kompose minikube sample
Last synced: 18 days ago
JSON representation
Sample App Run by docker-compose and Kubernetes
- Host: GitHub
- URL: https://github.com/progrhyme/compose-to-minikube
- Owner: progrhyme
- License: mit
- Created: 2017-12-09T14:24:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-23T02:51:17.000Z (about 7 years ago)
- Last Synced: 2024-11-05T22:42:00.755Z (2 months ago)
- Topics: docker-compose, kompose, minikube, sample
- Language: Ruby
- Size: 35.2 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# compose-to-minikube
This is a sample Rails application which is run by both
[docker-compose](https://docs.docker.com/compose/) and
[Kubernetes](https://kubernetes.io/).# Prerequisites
- [Docker](https://www.docker.com/)
- Kubernetes cluster. [Minikube](https://github.com/kubernetes/minikube) is handy for this sample.
- [kubectl](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-options/)
- Optional: [kompose](http://kompose.io)# Prepare Local Registry
Use https://hub.docker.com/_/registry/ like following command:
```sh
docker run -d -p 5000:5000 \
-v ~/.dockerregistry:/var/lib/registry \
--restart always \
--name registry \
registry:2
```# Run Application
## docker-compose
```sh
docker-compose up
docker-compose exec rails rake db:migrate
```## Kubernetes
### (1) By manual configuration
```sh
kubectl apply -f k8s-config.yaml
kubectl apply -f k8s-apps.yaml
kubectl get pods
kubectl exec -it app-XXXXXXXXX-XXXXX rake db:migrate # Specify your pod's name
```### (2) By kompose
```sh
kompose up
kubectl get pods
kubectl exec -it rails-XXXXXXXXX-XXXXX rake db:migrate # Specify your pod's name
```# See Also
- [Docker ComposeからMinikube + Komposeに移行してみよう - Qiita](https://qiita.com/progrhyme/items/116948c9fef37f3e995b)
# License
The MIT License (MIT)