quick_apps
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)
wwwnginx namespace)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.yamlTest access from within the
wwwnginxnamespace usingsiege: This command runs a temporary pod namedsiege-wwwto test themy-nginx-clusteripservice.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 -r1for a single quick test.)
2. Deploying Radarhack App (radarhack namespace)
radarhack namespace)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.yamlTest access from within the
radarhacknamespace usingsiege: This command runs a temporary pod namedsiege-radarhackto test themy-radarhack-clusteripservice.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
Create a
clientnamespace:Test access to
wwwnginxservice from theclientnamespace: 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.)Test access to
radarhackservice from theclientnamespace: 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)
app_routable_demo)For another demonstration application, you can clone the following repository:
Last updated