Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Oguzhan Yilmaz committed Nov 1, 2023
1 parent 7f3f1d8 commit 667e875
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 71 deletions.
32 changes: 0 additions & 32 deletions docs/create-debug-container.md
Original file line number Diff line number Diff line change
@@ -1,32 +0,0 @@
```bash

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: dnsutils
namespace: default
spec:
containers:
- name: dnsutils
image: registry.k8s.io/e2e-test-images/jessie-dnsutils:1.3
command:
- sleep
- "infinity"
imagePullPolicy: IfNotPresent
restartPolicy: Always
# nodeName: ip-105-64-46-249.eu-central-1.compute.internal
EOF
```bash
```
k exec dnsutils -- nslookup kube-dns.kube-system
k exec dnsutils -- nslookup kubernetes.default
k exec dnsutils -- nslookup google.com
k exec dnsutils -- dig kubernetes.default | grep SERVER
k exec dnsutils -- dig kubernetes.default @kube-dns.kube-system | grep SERVER


k exec dnsutils -- nslookup karpenter.karpenter.svc
```
61 changes: 43 additions & 18 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,80 @@
# Troubleshooting Guide
- TODO: debug container dns utils
- TODO: aws cli ssh command
- TODO: karpenter, coredns, aws-node log commands


## Helpful bash functions

```bash
alias klogs_karpenter="kubectl logs -f -n karpenter -l app.kubernetes.io/name=karpenter"
alias klogs_coredns="kubectl logs -f -n kube-system deploy/coredns"
alias klogs_aws_node="kubectl logs -f -n kube-system -l k8s-app=aws-node"
```

## Debug Cluster DNS

````bash
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: dnsutils
namespace: default
spec:
containers:
- name: dnsutils
image: registry.k8s.io/e2e-test-images/jessie-dnsutils:1.3
command:
- sleep
- "infinity"
imagePullPolicy: IfNotPresent
restartPolicy: Always
# nodeName: ip-105-64-46-249.eu-central-1.compute.internal
EOF
```bash
```bash
kubectl exec dnsutils -- nslookup kube-dns.kube-system
kubectl exec dnsutils -- nslookup kubernetes.default
kubectl exec dnsutils -- nslookup google.com

```

kubectl exec dnsutils -- dig kubernetes.default | grep SERVER
kubectl exec dnsutils -- dig kubernetes.default @kube-dns.kube-system | grep SERVER

# if karpenter is installed
kubectl exec dnsutils -- nslookup karpenter.karpenter.svc

````

### AWS CLI SSM Session Manager

- [Install AWS CLI SSM Session Manager Plugin](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
- EC2 instance must have SSM Agent installed (possibly in userdata)
- Connect to EC2 instance via SSM Session Manager, or you can use the AWS Console UI
```bash
# you can SSH into the Karpenter nodes like this
aws ssm start-session --target i-061f1a56dfff5d8f3
```
```bash
# you can SSH into the Karpenter nodes like this
aws ssm start-session --target i-061f1a56dfff5d8f3
```

#### Error: Address is not allowed

- You can get the following error if you forget to set `hostNetwork: true` in the karpenter deployment.

```bash
Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "defaulting.webhook.karpenter.k8s.aws": failed to call webhook: Post "https://karpenter.karpenter.svc:8443/default/karpenter.k8s.aws?timeout=10s": Address is not allowed
```


### EKS Health Issues
TODO: here

- You may get this error if you route the Subnets on Secondary CIDR to a Internet Gateway, making it a public subnet.
- If this is the case, you must enable auto-assign public IP address for the subnet.
- If this is the case, you must enable auto-assign public IP address for the subnet.

```bash
Ec2SubnetInvalidConfiguration
One or more Amazon EC2 Subnets of [subnet-00782ed1060ae5f88, subnet-0af9794264f7165bc, subnet-0b974d5872910ab7b] for node group mymymy does not automatically assign public IP addresses to instances launched into it. If you want your instances to be assigned a public IP address, then you need to enable auto-assign public IP address for the subnet. See IP addressing in VPC guide: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip
```
### Test Pods having IP addresses from Secondary CIDR Block
```bash
kubectl create deployment nginx --image=nginx
kubectl scale --replicas=3 deployments/nginx
Expand All @@ -60,8 +90,3 @@ bg # and then+ Ctrl-C
# try to see if the pods are running on the secondary CIDR block (ignore daemonset pods)
kubectl get pods -o wide
```
###
```bash
```
32 changes: 11 additions & 21 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ theme:
toggle:
icon: material/brightness-4
name: Switch to light mode


font:
text: Roboto
code: Roboto Mono
Expand All @@ -38,30 +40,18 @@ theme:
- search.share
- content.code.copy
- content.tabs.link


icon:
repo: fontawesome/brands/github

# palette:
# # Palette toggle for light mode
# - scheme: slate
# media: "(prefers-color-scheme: dark)"
# primary: black
# accent: white
# toggle:
# icon: material/weather-sunny
# name: Switch to dark mode

# # Palette toggle for dark mode
# - scheme: default
# media: "(prefers-color-scheme: light)"
# primary: black
# accent: white
# toggle:
# icon: material/weather-night
# name: Switch to light mode

extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/oguzhan-yilmaz
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/in/oguzhan-y/
- icon: fontawesome/brands/twitter
link: https://twitter.com/oguzhan_y_

markdown_extensions:
- tables
- pymdownx.critic
Expand Down

0 comments on commit 667e875

Please sign in to comment.