helper.py will scan dir for files with kubernetes component naming convention... sort them in order from external components to internals... run apply command to files in order
-
kubectl
- standard command-line tool for Kubernetes, you can perform all the operations of Kubernetes that are required.
-
kubectx
- multi cluster hopping tool
-
kubens
- multi component namespace tool
-
helm
-
kubernetes package manager
- download pre configured clusters
-
Templating Engine
- ability to set variables in template {context}
- use context variables in component configuration file
- ability to set variables in template {context}
-
-
create docker images
-
tag & push to cloud provider registry
-
create cluster
-
create secrets and config files
-
create deployments of pods
-
create their services (internal & external)
-
apply all
- apply namespace
- apply configMap
- apply secrets
- apply deployment
- apply service
- apply ingress
-
- MINICUBE
- minikube makes you build images and serivces using their commands
- MINICUBE
-
- AZURE CLOUD
- tag image
- push to azure container registry
- login using credentials command from AKS
- use kubectl with namespace to use azure kubernetes
- AZURE CLOUD
- brew update
- brew install hyperkit
- brew install minikube
- kubectl
- minikube
- minikube start --vm-driver=hyperkit
- kubectl get nodes
- minikube status
- kubectl version
- minikube delete
- minikube start --vm-driver=hyperkit --v=7 --alsologtostderr
- minikube status
- kubectl get nodes
- kubectl get pod
- kubectl get services
- kubectl create deployment nginx-depl --image=nginx
- kubectl get deployment
- kubectl get replicaset
- kubectl edit deployment nginx-depl
- kubectl logs {pod-name}
- kubectl exec -it {pod-name} -- bin/bash
- kubectl create deployment mongo-depl --image=mongo
- kubectl logs mongo-depl-{pod-name}
- kubectl describe pod mongo-depl-{pod-name}
- kubectl delete deployment mongo-depl
- kubectl delete deployment nginx-depl
- vim nginx-deployment.yaml
- kubectl apply -f nginx-deployment.yaml
- kubectl get pod
- kubectl get deployment
- kubectl delete -f nginx-deployment.yaml
- kubectl top: The kubectl top command returns current CPU and memory usage for a cluster’s pods or nodes, or for a particular pod or node if specified.
- 'minikube addons enable ingress'
-
kubens
- make sure to have kubectx installed
-
kubectl get ns
- kubectl api-resources --namespaced=true
- kubectl api-resources --namespaced=false
- kubectl config set-context --current --namespace=NAMESPACE
- kubens NAMESPACE
config files are for components to deploy onto the cluster... kind = component type
- There are multiple config files
- each component needs a config file
- components can have namespaces to group them up with one another to make groups within the cluster
- add namespace as key in config.yaml file
- Kind (type of component)
- Metadata
- name
- labels
- Spec
- replicas (load balance)
- selector (app label)
- Templates (pods) spec (each pod container has specs for its vm) - port config
- VALUES MUST BE BASE 64 ENCODED
- write: 'echo -n "secret string" | base64'
- paste that output into secrets.yaml key pair, value
-
Internal
- no need to identify type
- match the ports of container and service
-
External
-
identify type as LoadBalancer
-
MINICUBE
- minikube service SERVICE_NAME
-
- use third-party implementation to make an "ingress controller pod" and attatch to the apps ingress
- write: 'minikube addons enable ingress'