Posts

Showing posts from November, 2018

How to find kubernetes cluster token

Image
Welcome to Linux guru, In this article i will explain you how to get kubernetes cluster token and certificate information by commands. Connect your kubernetes cluster using glocud command to your local machine. $ gcloud container clusters get-credentials clustername  --zone \ europe-west1-d --project projectname Once your kubernetes cluster connected to your local machine, lets find out token and other information. You will need to find out secret first. $ kubectl get secret NAME                  TYPE                                  DATA      AGE default-token- 7Dghp    kubernetes.io/service-account-token   3         3d Now, we will get token information using that secret which we got from above command. $  kubectl -o json get secret default-token-7Dghp | jq -r \ '.data.token' | base64 -d (Replace your secret in above command). Token Output :  sdklwksdKLJJDKASKLFkljfasjflaskfjasjflasjflkjasdfjasjfklasfjasfasfjskjfjslfkjkljfaksjfkljfkl

Install kubectl in linux

Image
Kubectl is a kubernetes command line tool. You can deploy and manage application in kubernetes using kubectl.Using kubectl, you can inspect cluster resources; create, delete, and update components. Install Kubectl ubuntu/debian : sudo apt-get update && sudo apt-get install -y apt-transport-https curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubectl Install kubectl on Centos / Fedora : cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOF yum install -y kubectl Install with snap on Ubuntu : $su

How to reset gitlab root password

Image
Login in your server with root access, then start ruby on rail consol and login. Start Rubi consol using below command :  gitlab-rails console production Wait until the console has loaded, you can search for email or username. user = User.where(id: 1).first or user = User.find_by(email: 'admin@local.host') You can change your password from below commands : user.password = 'secret_pass' user.password_confirmation = 'secret_pass' It’s important that you change both password and password_confirmation to make it work. Don’t forget to save the changes. user.save! Exit the console and try to login with your new password.