This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
kubectl get daemonsets -n kube-system | |
kubectl describe daemonset kube-flannel-ds -n kube-system | |
echo “apiVersion: apps/v1 | |
kind: DaemonSet | |
metadata: | |
name: chippy | |
labels: | |
daemon: “yup” |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Status of pods where app=nginx | |
kubectl get pods -l app=nginx | |
#Give an nginx pod a label “test=sure” | |
kubectl label pod nginx-deployment-6fdbb596db-2s2tp test=sure | |
#Detailed description of pod with label “test=sure” | |
kubectl describe pod -l test=sure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Replication Controller and Replica Set yamls | |
#A replication controller is a precusor to a deployment | |
echo “apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: nginx | |
spec: | |
replicas: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Self Healing | |
#Nginx deployment yaml created in previous script | |
kubectl create -f nginx-deployment.yaml | |
#Check status of pods; including replicas | |
kubectl get pods | |
#Delete indicated pod within nginx deployment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Manually scaling an application through yaml and cml | |
#Nginx deployment yaml created in previous script | |
kubectl create -f nginx-deployment.yaml | |
#Detailed status of nginx deployment | |
kubectl describe deployment nginx-deployment | |
#Scale deployment to 3 replicas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Manually scaling an application (can also be done through yaml changes) | |
#Nginx deployment yaml created in previous script | |
kubectl create -f nginx-deployment.yaml | |
#Detailed status of nginx deployment | |
kubectl describe deployment nginx-deployment | |
#Scale deployment to 3 replicas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Create configmap yaml to create env variables for pod | |
echo “apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: school-config | |
namespace: default | |
data: | |
STUDENT_NAME: “Joshua Davidson” |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#How k8 configures application | |
#Create config map | |
kubectl create configmap my-map –from-literal=school=LinuxAcademy | |
#Check status of config map | |
kubectl get configmaps | |
#Detailed description of config map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Deployments, Rolling Update, Rollback | |
#Nginx deployment yaml | |
echo “apiVersion: apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: nginx-deployment | |
namespace: default | |
spec: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Basic status checks in kubernetes | |
#Check status of cluster | |
kubectl get nodes | |
#Determine if memory is low on specified node | |
kubectl describe node joshy914.mylabserver.com | grep MemoryPressure | |
#Determine if disk space is low on specified node | |
kubectl describe node joshy914.mylabserver.com | grep DiskPressure |
NewerOlder