DevOps
  • DevOps
  • Docker
    • Overview
  • Vagrant
    • Overview
    • Installation
    • Basic Commands
    • Vagrantfile
      • Example
    • Deploying Multiple Machine
    • Distribution
    • Reference
  • Running SQL Server on Windows Docker
    • Introduction
      • Windows Container & Hyper-V Container
    • System Requirements and Prerequisites
    • Version Compatibility
    • Enable Hyper-V & Containers and Install Docker on Window Servers
    • Using Docker to Run MSSQL Image
    • Install SSMS for remoting MSSQL Server Image
    • Using Docker-Compose to Build Up a MSSQL Image
    • Increase the default Windows container's storage
    • Reference
    • Appendix
  • Kubernetes
    • Install Kubernetes with kubeasz
    • Use Hyper-V Manager to create VM for K8S
      • Specification of the VM
      • Use Hyper-V Manager to turn on a VM for K8S
    • Installation
      • Install VirtualBox and its extension on Ubuntu
      • Install kubectl
      • Install minikube
    • Getting Started
      • Running Kubernetes Locally via Minikube
    • Assign Memory Resources to Containers and Pods
    • Assign CPU Resources to Containers and Pods
    • Quality of Services (QoS)
    • Volume for Storage
      • Configure a Pod to Use a Volume for Storage
      • *Configure a Pod to Use a PersistentVolume for Storage
    • In a nutshell...
    • Reference
  • Ansible
    • What is Ansible?
    • Set Up OS Environments for Ansible
    • Install Ansible
    • Structure for ansible
      • Inventory
      • Playbook
      • Modules
      • Variables
      • Conditions
    • Security - Ansible Fault
    • 實際操作測試1 - 使用ssh
    • 實際操作測試2 - Docker容器部署
    • Appendix
    • Reference
  • Azure
    • Overview
    • Terms
    • Getting Started
    • Azure DevOps Services
    • Reference
Powered by GitBook
On this page
  • Install:
  • Start minikube:
  • .yaml File Assignment:

Was this helpful?

  1. Kubernetes

In a nutshell...

Install:

  • VirtualBox and its extension

# Update Ubuntu
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove

# Install Required Linux Headers
sudo apt-get -y install gcc make linux-headers-$(uname -r) dkms

# Add VirtualBox Repository and key
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/sources.list'

# Install VirtualBox
sudo apt-get update
sudo apt-get install virtualbox-6.0

# Install VirtualBox Extension Pack

curl -O http://download.virtualbox.org/virtualbox/6.0.6/Oracle_VM_VirtualBox_Extension_Pack-6.0.6.vbox-extpack
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.6.vbox-extpack
  • kubectl

sudo apt-get update && sudo apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl
  • minikube

# install Minikube on Linux by downloading a static binary andadd the Minikube executable to your path
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
  && chmod +x minikube
sudo cp minikube /usr/local/bin && rm minikube

Start minikube:

sudo minikube start

.yaml File Assignment:

apiVersion: v1
# Type of the resources
kind: Pod 
metadata:
  # pod name
  name: syrus-memory-demo-2
  # Create a namespace so that the resources 
  # you create are isolated from the rest of your cluster.
  namespace: syrusk8s
spec:
  containers:
  # container name
  - name: syrus-demo-2-ctr
    # container image
    image: polinux/stress
    volumeMounts:
    - name: redis-storage
      mountPath: /data/redis
    emptyDir: {}
    resources:
      # specify the limit of the resources that this container can use
      limits:
        memory: "100Mi"
        cpu: "2"
      # specify how many memory is needed for this container
      requests:
        memory: "50Mi"
        cpu: "1"
    # docker run command
    command: ["stress"]
    # command arguments
    args: ["--vm", "1", "--vm-bytes", "250M", "--vm-hang", "1"]
  volumes:
  - name: redis-storage
    emptyDir: {}
Previous*Configure a Pod to Use a PersistentVolume for StorageNextReference

Last updated 6 years ago

Was this helpful?