Wednesday, 6 May 2020

Ansible PACKAGES AND INSTALLATION

#install multiple packages
yum: name="{{ item }}" state=present
with_items:
  - http 
  - htop
  - myapp

Ansible SERVER DIAGNOSTICS

Test Connection
ansible -i hosts all -m ping -u root

Diagnostics



manage nodes via "/etc/ansible/hosts" file

Debug (debug output for playbook)
- debug: var=result verbosity=2  

Ansible REMOTE CMD (Ad Hoc)


Ping specific node
ansible -i hosts nycweb01.prod.local -m ping

Ping with wildcard
ansible -i hosts "nycweb*" -m ping

Ping all nodes with SSH user 'root'
ansible -i hosts all -m ping -u root

run a command
ansible -i hosts dev -a 'uname -a'

check Yum packages
ansible -i hosts dev -m yum 

check if Docker rpm is installed
ansible -i hosts web01.nyc.local -m shell -a "rpm -qa | grep docker"

Get facts about a box
ansible -i hosts web01.nyc.local -m setup -a 'filter=facter_*'

run command with sudo
ansible -i hosts target-host -m shell -a "cat /etc/sudoers" --sudo 

limit command to a certain group or server: add --limit *.nyc

Copy your Ansible Master's public key to the managed node

ssh-keygen  ## generate public key
ssh-copy-id <name of node>  # copy key, provide password to node

Saturday, 2 May 2020

uninstall any application in windows 10 via cmd


Below example is to uninstall onedrive


  1. Open Command Prompt as Administrator

  2. Type in taskkill /f /im OneDrive.exe to terminate any OneDrive processes and hit Enter.

  3. Type in %SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall if you’re using 64-bit Windows 10 and hit Enter.

Wednesday, 29 April 2020

k8s pod ??

A pod is the smallest object model that you can create and run. You can add labels to a pod to identify a subset to run operations on. When you are ready to scale your app, you can use the label to tell Kubernetes which Pod you need to scale. 
A pod typically represents a process in your cluster. Pods contain at least one container that runs the job and additionally might have other containers in it called sidecars for monitoring, logging, and so on. Essentially, a pod is a group of containers.

$ kubectl (create|get|apply|delete) -f Resource.yaml

Kubernetes resource model



  • Config maps: holds configuration data for pods to consume
  • Daemon sets: ensures that each node in the cluster runs this pod
  • Deployments: defines a desired state of a deployment object
  • Events: provides life cycle events on pods and other deployment objects
  • Endpoints: allows an inbound connections to reach the cluster services
  • Ingress: a collection of rules that allows inbound connections to reach the cluster services
  • Jobs: creates one or more pods and when they complete successfully, the job is marked as completed
  • Node: a worker machine in Kubernetes
  • Namespaces: multiple virtual clusters backed by the same physical cluster
  • Pods: the smallest deployable units of computing that can be created and managed in Kubernetes
  • Persistent volumes: provides an API for users and administrators to abstract details about how storage is provided from how it is consumed
  • Replica sets: ensures that a specified number of pod replicas are running at any given time
  • Secrets: holds sensitive information, such as passwords, OAuth tokens, and SSH keys
  • Service accounts: provides an identity for processes that run in a pod
  • Services: an abstraction that defines a logical set of pods and a policy by which to access them, sometimes called a microservice
  • Stateful sets: the workload API object that manages stateful applications

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...