Note Please make sure the eks kubernetes version you are using is 1.23 I had issues with the latest one(1.27)
brew install awscli
export EDITOR=nano
subl ~/.aws/credentials
Then go to awsacademy account and copy the credentials to this file(replace all there is by default)
aws eks --region us-west-2 update-kubeconfig --name eks1
k create ns ns1
k config set-context --current --namespace=ns1
k apply -f file1.yaml
k apply -f file2.yaml
k apply -f monitoring.yaml
k get all -n kube-system
k get pods -o wide -l app=app1
k get pods -o wide -l app=app2
k get nodes
k get pods -o wide
k get pods -o wide | grep <node-name>
k delete daemonsets,replicasets,services,deployments,pods,rc,ingress,statefulset --all -n prometheus
k delete clusterrole prometheus-kube-state-metrics prometheus-alertmanager prometheus-pushgateway prometheus-server system:prometheus
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install my-kube-prometheus-stack prometheus-community/kube-prometheus-stack \
--create-namespace --namespace prometheus \
--set prometheus.service.type=LoadBalancer \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
--set grafana.service.type=LoadBalancer \
--set grafana.adminpassword=password
k get all -n prometheus
k port-forward my-kube-prometheus-stack-grafana -n prometheus 4002:80
k port-forward svc/prometheus-operated -n prometheus 4001:9090
k edit svc my-kube-prometheus-stack-prometheus -n prometheus
Change "port: 9090" to "port: 80" in http-web block
k get secret my-kube-prometheus-stack-grafana -n prometheus -o jsonpath="{.data.admin-user}" | base64 --decode ; echo
k get secret my-kube-prometheus-stack-grafana -n prometheus -o jsonpath="{.data.admin-password}" | base64 --decode ; echo