-
Clone repo:
SSH - git clone git@github.com:mahesh-tier1app/yc-k8-test.git HTTPS - git clone https://github.com/mahesh-tier1app/yc-k8-test.git cd yc-k8-test -
Download
license.licand put it into this directory
-
To build image:
docker build -t ycrash . -
Tag and push the Docker image to Docker Hub
docker tag ycrash <dockerhub-user>/<repo-name>:<tag-name> docker push <dockerhub-user>/<repo-name>:<tag-name>
-
To run the container locally:
docker run -ti --rm -p 8080:8080 --name ycrash -v $(pwd)/license.lic:/opt/workspace/yc/license.lic ycrash -
Then open http://localhost:8080
Kubernetes manifests (yaml) resides in kubernetes/ directory.
-
Copy
kubernetes/secret.yaml.templatetokubernetes/secret.yamlcp kubernetes/secret.yaml.template secret.yaml -
Edit
kubernetes/secret.yamland replace the license template with the real one. -
Change
imageproperty in thedeployment.yamlto update your Docker Hub repository. -
Assuming you have a running kubernetes cluster and kubectl ready to access the cluster, next step is to just run:
kubectl apply -f kubernetes -R -
There are a few ways of exposing a service in kubernetes to the outside. But for the initial scope, we can access it privately with:
kubectl port-forward svc/yc-web 8080:8080 -
Then the service should be accessible from http://localhost:8080
- Kubernetes deployment yaml is working. It's the simplest implementation, which is easy for initial review but not yet "production ready".