Kubernetes is an open-source platform for automating the deployment, scaling, and management of containerized applications. It is a popular tool fo...
For further actions, you may consider blocking this person and/or reporting abuse
Nice one! Just one comment: syntax highlighting for code blocks would improve readability. You can do it by specifying the language after the opening three backticks, for example (replace the single quotes with backticks in your head):
You can use bash, javascript, yaml, etc.
Thanks for the suggestion. That's really valuable. Yes, I will add it.
Awesome Write up Pavan✨
Glad you liked it!
Hi Pavan, Very nice hands-on content... But I have a quick question. I have set up the GKE cluster for the Hands-on. After installing the Nodejs, when when I run the command "npm install", I got this error. Please suggest me.
ganeshbhanda@cloudshell:~ (central-insight-3791)$ cd notes-app-cicd/
ganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$ npm install
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /home/ganeshbhanda/notes-app-cicd/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/home/ganeshbhanda/notes-app-cicd/node_modules'
npm ERR! [Error: EACCES: permission denied, mkdir '/home/ganeshbhanda/notes-app-cicd/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/home/ganeshbhanda/notes-app-cicd/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ganeshbhanda/.npm/_logs/2023-02-28T16_17_08_511Z-debug-0.log
ganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$ sudo npm install
sudo: npm: command not found
ganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$ sudo install npm
install: missing destination file operand after 'npm'
Try 'install --help' for more information.
Are you on the right path and running the command?
Have you installed the Node.js and npm properly?
I see the error that says 'sudo: npm: command not found'. So you have not installed npm I believe.
use this command
npm install -g npm
Check the version of Node.js and npm with the following commands (verify you have installed properly)
node -v
npm -v
Try and let me know
I just checked it. Here are the outputs.
ganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$ npm install -g npm
changed 25 packages in 10s
16 packages are looking for funding
run
npm fund
for detailsganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$ node -v
v18.12.1
ganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$ npm -v
9.5.1
ganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$ npm install
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /home/ganeshbhanda/notes-app-cicd/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/home/ganeshbhanda/notes-app-cicd/node_modules'
npm ERR! [Error: EACCES: permission denied, mkdir '/home/ganeshbhanda/notes-app-cicd/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/home/ganeshbhanda/notes-app-cicd/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ganeshbhanda/.npm/_logs/2023-02-28T17_28_26_878Z-debug-0.log
ganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$
Hi Pavan,
Can you please help me on this issue?
Please check this link - stackoverflow.com/questions/252909...
Thank you Pavan, this link helped me to move forward but when I ran the below command,
docker buildx create --use unix:///var/run/docker.sock --platform=linux/arm64 --platform=linux/arm64 -t docker.io/dockerisimage/node:14-alpine --push -f ./Dockerfile .
IT GAVE ME THE ERROR. Please help me on this.
ganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$ docker buildx create --use unix:///var/run/docker.sock --platform=linux/arm64 --platform=linux/arm64 -t docker.io/mydockerisimages/node:14-alpine --push -f ./Dockerfile .
unknown shorthand flag: 't' in -t
See 'docker buildx create --help'.
ganeshbhanda@cloudshell:~/notes-app-cicd (central-insight-3791)$
The command you used is for Mac M1, use the below commands to build and push your image.
Thank you for your help Pavan. But when I am authorizing GitHub (Using GitHub username and GitHub token) with Harness, I encountered this error:
Illegal character in path at index 50: github.com/TaraGithub/notes-app-ci... app cicd/info/refs?service=git-upload-pack
Please help me on this.
Thank you and a clean implementation. Kudos to you
2 missing steps for completion. Hope you could add them for any future readers:
The below line is needed so that the browser works
_* 32729 is the default assigned by KIND when you wont provide one. Otherwise you can provide one in the service.yaml _
Another thing missing in the dockerfile to expose the port 8000. Also, you code is pointing to port 8004
Roughly how much is it to run a basic kubernetes stack in google cloud? Need to know for creating a basic blog post site.