# 6.Kubernetes Security

## Setup

### Minikube

If you are using Minikube then you need to follow these steps to use local docker container images:

\`\`\`shell script minikube start eval $(minikube docker-env) ./gradlew docker

````
To see the exposed url for a service in Minikube just use:

```shell script
minikube service list
````

### Docker for Windows/Mac

If you are using Docker for Windows or Mac then the integrated single node Kubernetes automatically can use local container images for deployments.

## Deploy Images to Kubernetes

If you have docker installed you can work with building local docker images yourself and deploy these to Kubernetes.

As alternative you may also just use the corresponding container images already available remotely:

* [andifalk/library-server-container-root](https://hub.docker.com/repository/docker/andifalk/library-server-container-root)
* [andifalk/library-server-container-rootless](https://hub.docker.com/repository/docker/andifalk/library-server-container-rootless)

Use tags *latest* or *1.0*.

## Labs

* [Docker as Root](https://github.com/andifalk/cloud-native-microservices-security/tree/27bf31c7d9dcbdffa341bd3dc12a7c44c8279d9e/lab6/lab6/library-server-container-root/README.md)
* [Docker as NonRoot](https://github.com/andifalk/cloud-native-microservices-security/tree/27bf31c7d9dcbdffa341bd3dc12a7c44c8279d9e/lab6/lab6/library-server-container-rootless/README.md)
* [Kubernetes Deployment](https://github.com/andifalk/cloud-native-microservices-security/tree/27bf31c7d9dcbdffa341bd3dc12a7c44c8279d9e/lab6/lab6/kubernetes/first-iteration/README.md)
* [Secure Kubernetes Deployment](https://github.com/andifalk/cloud-native-microservices-security/tree/27bf31c7d9dcbdffa341bd3dc12a7c44c8279d9e/lab6/lab6/kubernetes/second-iteration/README.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://andifalk.gitbook.io/cloud-native-microservices-security/hands-on-labs/lab6.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
