2019-03-07 18:03:51 +01:00
|
|
|
# Example: kubernetes nginx deployment
|
|
|
|
|
|
|
|
|
|
A simple example creating kubernetes nginx deployment and associated docker
|
|
|
|
|
image
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
2019-03-07 23:24:28 +01:00
|
|
|
### Building and applying kubernetes configuration
|
2019-03-07 18:03:51 +01:00
|
|
|
|
|
|
|
|
```
|
2019-03-12 21:08:35 +01:00
|
|
|
nix eval -f ./. --json result | kubectl apply -f -
|
2019-03-07 18:03:51 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Building and pushing docker images
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
nix run -f ./. pushDockerImages -c copy-docker-images
|
|
|
|
|
```
|
2019-03-07 23:24:28 +01:00
|
|
|
|
|
|
|
|
### Running tests
|
|
|
|
|
|
|
|
|
|
Test will spawn vm with kubernetes and run test script, which checks if everyting
|
|
|
|
|
works as expected.
|
|
|
|
|
|
|
|
|
|
```
|
2019-03-12 21:05:36 +01:00
|
|
|
nix build -f ./. test-script
|
2019-03-07 23:24:28 +01:00
|
|
|
cat result | jq '.'
|
|
|
|
|
```
|