quick_apps

Home

Quick Application Deployments in Kubernetes

This document provides command sequences to quickly deploy and test a couple of sample applications (Nginx and "Radarhack") in separate Kubernetes namespaces. It also demonstrates testing access from a different client namespace.

(Assumption: The dockersec/siege image is used for testing. If not available, or if siege is not the desired test tool, these commands can be adapted for other images like alpine/curl or curlimages/curl.)

1. Deploying Nginx (wwwnginx namespace)

  1. Create namespace, deploy Nginx, and expose as ClusterIP service:

    kubectl create ns wwwnginx
    kubectl apply -n wwwnginx -f https://raw.githubusercontent.com/xxradar/kuberneteslearning/master/nginx-deployment.yaml
    kubectl apply -n wwwnginx -f https://raw.githubusercontent.com/xxradar/kuberneteslearning/master/nginx-expose-clusterip.yaml
  2. Test access from within the wwwnginx namespace using siege: This command runs a temporary pod named siege-www to test the my-nginx-clusterip service.

    kubectl run siege-www -it -n wwwnginx --image=dockersec/siege --rm -- siege -c1 -r1 http://my-nginx-clusterip

    (Added distinct pod name siege-www, -it, --rm, and siege options -c1 -r1 for a single quick test.)

2. Deploying Radarhack App (radarhack namespace)

  1. Create namespace, deploy "Radarhack" app, and expose as ClusterIP service:

    kubectl create ns radarhack
    kubectl apply -n radarhack -f https://raw.githubusercontent.com/xxradar/kuberneteslearning/master/radarhack-deploy.yaml
    kubectl apply -n radarhack -f https://raw.githubusercontent.com/xxradar/kuberneteslearning/master/radarhack-expose-clusterip.yaml
  2. Test access from within the radarhack namespace using siege: This command runs a temporary pod named siege-radarhack to test the my-radarhack-clusterip service.

    kubectl run siege-radarhack -it -n radarhack --image=dockersec/siege --rm -- siege -c1 -r1 http://my-radarhack-clusterip

    (Added distinct pod name siege-radarhack, -it, --rm, and siege options -c1 -r1.)

3. Testing from a Separate Client Namespace

  1. Create a client namespace:

  2. Test access to wwwnginx service from the client namespace: Uses the fully qualified domain name (FQDN) of the service.

    (Added distinct pod name siege-client-to-www, -it, --rm, and siege options -c1 -r1.)

  3. Test access to radarhack service from the client namespace: Uses the FQDN of the service.

    (Added distinct pod name siege-client-to-radarhack, -it, --rm, and siege options -c1 -r1.)

4. Additional Demo Application (app_routable_demo)

For another demonstration application, you can clone the following repository:

Home

Last updated