1. Nginx
What Will You Do¶
For this exercise,
- You will configure and deploy Nginx as a workload (Kubernetes deployment) on a Controller managed Kubernetes cluster
- You will use the provided Kubernetes YAML for Nginx
Assumptions¶
- You have already provisioned or imported one or more Kubernetes clusters using the Controller
Step 1: Create Workload¶
- Login into the Console
- Navigate to your Project and Select "Applications"
- Click on "New Workload"
- Provide a Name, select "k8s Yaml" for Package Type
- Select a namespace where you would like to deploy.
Step 2: Upload YAML File¶
The YAML file describes a "Kubernetes Deployment" that runs the nginx:1.7.9 Docker image. We will be using this to create a Kubernetes Deployment object.
Copy the YAML file below and save it as a file called "nginx.yaml"
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
Step 3: Place and Deploy¶
- Click on "Save and Go To Placement"
- Select the cluster where you would like to deploy the Nginx YAML file
- Navigate to the "Publish" and click on Publish.
Step 4: Debug¶
- Once publish is successful, click on "Debug". You should see the pods for "Nginx" in a "Running" state.
Recap¶
Congratulations! You have successfully deployed Nginx on your Kubernetes Cluster.