Skip to content

Commit

Permalink
adding more references
Browse files Browse the repository at this point in the history
  • Loading branch information
BretFisher committed Aug 20, 2023
1 parent b34bafa commit c817a44
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions references/S16 Inspecting Kubernetes Resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ kubectl delete pod/my-apache-xxxx-yyyy
- [Logging Architecture](https://kubernetes.io/docs/concepts/cluster-administration/logging/)
- [Loki - Like Prometheus, but for logs](https://github.com/grafana/loki)
- [ELK Stack](https://www.elastic.co/what-is/elk-stack)
- [Stern multi-pod log tailing](https://github.com/stern/stern)

```shell
kubectl logs deploy/my-apache
Expand Down
49 changes: 49 additions & 0 deletions references/S17 Exposing Kubernetes Ports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Exposing Kubernetes Ports

## Service Types

- [Service Docs](https://kubernetes.io/docs/concepts/services-networking/service/)
- [Service Examples](https://kubernetes.io/docs/tutorials/services/)

```shell
kubectl expose
```

## Creating a ClusterIP Service

- [cURL utility](https://curl.se/)

```shell
kubectl get pods -w
kubectl create deployment httpenv --image=bretfisher/httpenv
kubectl scale deployment/httpenv --replicas=5
kubectl expose deployment/httpenv --port 8888
kubectl get service
kubectl run tmp-shell --rm -it --image bretfisher/netshoot -- bash
curl httpenv:8888
```

## Creating a NodePort and LoadBalancer Service

```shell
kubectl get all
kubectl expose deployment/httpenv --port 8888 --name httpenv-np --type NodePort
kubectl get services
curl localhost:32334
kubectl expose deployment/httpenv --port 8888 --name httpenv-lb --type LoadBalancer
kubectl get services
curl localhost:8888
kubectl delete service/httpenv service/httpenv-np
kubectl delete service/httpenv-lb deployment/httpenv
```

## Kubernetes Services DNS

- [Kubernetes DNS Specification](https://github.com/kubernetes/dns/blob/master/docs/specification.md)
- [CoreDNS for Kubernetes](https://coredns.io/plugins/kubernetes/)

```shell
curl <hostname>
kubectl get namespaces
curl <hostname>.<namespace>.svc.cluster.local
```

0 comments on commit c817a44

Please sign in to comment.