Test Ubuntu Deployment/Pod
In order to properly test our logging solution, we will first add a ubuntu deployment to our Kubernetes cluster.
Create our Deployment
Create a yaml file to define our pod:test ubuntu deployment
Code Block |
---|
$ vi ubuntu.yaml |
Code Block |
---|
language | yml |
---|
title | ubuntu.yaml |
---|
|
apiVersion: v1
kind: Service
metadata:
name: ubuntu
labels:
app: ubuntu
spec:
type: NodePort
ports:
- port: 22
targetPort: 22
nodePort: 30022
selector:
app: ubuntu
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ubuntu
labels:
app: ubuntu
spec:
replicas: 1
selector:
matchLabels:
app: ubuntu
template:
metadata:
labels:
app: ubuntu
spec:
containers:
- name: ubuntu
image: rastasheep/ubuntu-sshd:18.04
|
Deploy it
...
kubectl apply -f ubuntu.yaml |
Delete it
Want to start over, you can by deleting your previously applied yaml file.
Code Block |
---|
kubectl delete -f ubuntu.yaml |
Test SSH connection
Login to the pod using SSH (default password is root)
Code Block |
---|
ssh -p 30022 root@localhost |
References