Posts

Kubernetes replica backup

kubectl help sync data between primary and Replica bala:~ bala$ kubectl get pods NAME READY STATUS RESTARTS AGE redis-master-5ccf554d96-jlpvp 1/1 Running 0 133m redis-master-5ccf554d96-k7qcw 1/1 Running 0 133m redis-master-5ccf554d96-rsf9r 1/1 Running 0 133m redis-master-5ccf554d96-vnpkk 1/1 Running 0 133m redis-replica-858fc45586-2gslf 1/1 Running 0 133m redis-replica-858fc45586-45n7w 1/1 Running 0 133m redis-replica-858fc45586-5d4xm 1/1 Running 0 133m redis-replica-858fc45586-bqlt4 1/1 Running 0 133m bala:~ bala$ kubectl exec -it redis-master-5ccf554d96-jlpvp -- /bin/bash root@redis-master-5ccf554d96-jlpvp:/data# bala:~ bala$ kubectl exec -it redis-master-5ccf554d96-jlpvp -- redis-cli 127.0.0.1:6379> keys * (empty array) 127.0.0.1:6379> set key1 value1 OK 127.0.0....

exec command in Kubernetes

Colored Words Example bala:~ bala$ kubectl get pods NAME READY STATUS RESTARTS AGE redis-master-5ccf554d96-jlpvp 1/1 Running 0 10m redis-master-5ccf554d96-k7qcw 1/1 Running 0 10m redis-master-5ccf554d96-rsf9r 1/1 Running 0 10m redis-master-5ccf554d96-vnpkk 1/1 Running 0 10m redis-replica-858fc45586-2gslf 1/1 Running 0 10m redis-replica-858fc45586-45n7w 1/1 Running 0 10m redis-replica-858fc45586-5d4xm 1/1 Running 0 10m redis-replica-858fc45586-bqlt4 1/1 Running 0 10m bala:~ bala$ kubectl exec redis-master-5ccf554d96-vnpkk -- ls appendonly.aof dump.rdb bala:~ bala$ kubectl exec redis-master-5ccf554d96-vnpkk -- cat appendonly.aof bala:~ bala$ kubectl exec redis-master-5ccf554d96-vnpkk -- "cat appendonly.aof" error: Internal error occurred: Internal error occurred: error e...

kubectl

kubectl help kubectl help bala$ kubectl --help kubectl controls the Kubernetes cluster manager. Find more information at: https://kubernetes.io/docs/reference/kubectl/ Basic Commands (Beginner): create Create a resource from a file or from stdin expose Take a replication controller, service, deployment or pod and expose it as a new Kubernetes service run Run a particular image on the cluster set Set specific features on objects Basic Commands (Intermediate): explain Get documentation for a resource get Display one or many resources edit Edit a resource on the server delete Delete resources by file names, stdin, resources and names, or by resources and label selector Deploy Commands: rollout Manage the rollout of a resource scale Set a new size for a deployment, replica set, or replication controller autos...

Kubernetes config view

Image
Kubernetes Cheat Sheet Kubernetes basics bala$ kubectl get pods NAME READY STATUS RESTARTS AGE redis-5c995b7fbf-jxddf 1/1 Running 2 (18m ago) 11d redis-5c995b7fbf-vp2cd 1/1 Running 2 (18m ago) 11d redis-5c995b7fbf-z6pg7 1/1 Running 2 (18m ago) 11d redis-master-5ccf554d96-ssrql 1/1 Running 4 (18m ago) 11d redis-replica-858fc45586-97zbd 1/1 Running 2 (18m ago) 11d redis-replica-858fc45586-zfl92 1/1 Running 2 (18m ago) 11d Configuration bala:~ bala$ kubectl config view apiVersion: v1 clusters: - cluster: certificate-authority-data: DATA+OMITTED server: https://127.0.0.1:50022 name: kind-kind contexts: -...

Kubernates cheat sheet

Image
Kubernetes Cheat Sheet Kubernetes Cheat Sheet (EXAMPLE) This is an example cheat sheet. Feel free to customize for your own needs. Installation & Configuration pip3 install -U stups - Installs zkubectl stups configure stups.example.org - Might need "sudo" source <(zkubectl completion bash) source <(zkubectl completion zsh) Troubleshooting zkubectl get deploy - Get all application pods zkubectl get pods -l application=APP_NAME zkubectl describe pod POD_NAME - View status and reason zkubectl logs -f POD_NAME - Tail app logs Architecture Resource Types ...

Kubernates road map

Kubernetes Roadmap Kubernetes Roadmap Core Components Cluster: A group of machines managed by a control plane. Service: Expose an app running on Pods. apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app: MyApp ports: - protocol: TCP port: 80 targetPort: 9376 Pods: The smallest deployable unit. apiVersion: v1 kind: Pod metadata: name: nginx-pod spec: containers: - name: nginx image: nginx Stateful Application & Data Management Stateful Application: Apps requiring persistent data. apiVersion: apps/v1 kind: StatefulSet metadata: name: mysql spec: serviceName: mysql replicas: 3 selector: matchLabels: app: mysql Persistent Volume Claim: Attach persistent storage. apiVersion: v1 kind: Persiste...