---
# System prepended metadata

title: 'Chapter 1 : Exercise'
tags: [Day 1 Exercises, Chapter 1]

---

# Chapter 1 : Exercise

###### tags: `Day 1 Exercises` `Chapter 1`

## If Docker doesn't respond add the following

```shell=
sudo addgroup --system docker
sudo adduser $USER docker
newgrp docker
```

## Add the following

```shell=
$ cat << EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-hello-deployment
  labels:
    app: api-hello
spec:
  replicas: 10
  selector:
    matchLabels:
      app: api-hello
  template:
    metadata:
      labels:
        app: api-hello
    spec:
      containers:
      - name: api-hello
        image: christianhxc/api-hello:1.0
        ports:
        - containerPort: 8080
EOF
```

## Do not use the following, please convert to a NodePort Service before applying. The node port should `30007`

```yaml=
kind: Service
apiVersion: v1
metadata:
  name: api-hello-service
spec:
  type: LoadBalancer
  selector:
    app: api-hello
  ports:
  - protocol: TCP
    port: 8080
    targetPort: 8080
```

## Determine your IP Address

```shell=
$ kubectl get nodes -o wide
$ kubectl describe node <node-name>
```