- A Kubernetes cluster Minikube is just fine
- A MySQL box or container with a database and user with permissions to the DB.
- kubectl
- helm 2
- git
It's a good practice to have this tools on your computer as you will need them for ProdOps work.
- Get familiar with the prodops-lab code.
- Containerize the app.
- Build docker image and push to Artifactory.
- Create helm charts for prodops-lab.
- Deploy the application to Kubernetes.
- Application needs to be live and running.
- Troubleshooting and Debugging.
FROM node:alpine3.10
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND
# package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
# Install required NPM components.
RUN npm install
# Bundle app source
COPY src/app/* /usr/src/app/
# This will expose port 8080 for the app.
EXPOSE 8080
CMD [ "node", "main.js" ]
cd prodops-lab
sudo docker build -t rhiraldo/prodops-lab .
sudo docker tag rhiraldo/prodops-lab rhiraldo/prodops-lab:v2.3.5
sudo docker push rhiraldo/prodops-lab:v2.3.5
mkdir charts && cd charts
helm create prodops-lab
kubectl -n kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:tiller
helm init --service-account tiller
kubectl create secret generic prodops-lab-secret --from-literal=DB_PASSWORD=prodops
# Deploying with values from values.yaml
helm install --name prodops-lab ./prodops-lab/
# Deploying with values from overrides.yaml
helm install --name prodops-lab ./prodops-lab/ --namespace default -f ./prodops-lab/overrides.yaml
- CrashLoopBackoff
Run kubectl logs -p the -p option will read the logs of the previous (crashed) instance.
Run kubectl describe pod to see events.
- ImagePullBackoff
Check if your image name, tag and repo exist. If the repo does not allow anonymous access, do you have a ImagePullSecret specified?
- 29-Jan-2020 - Update README