This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: webapp-rs | |
labels: | |
app: webapp | |
spec: | |
template: | |
metadata: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: ReplicaSet | |
metadata: | |
name: webapp-rs | |
labels: | |
app: webapp | |
spec: | |
template: | |
metadata: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: my-dep | |
namespace: default | |
spec: | |
replicas: 2 | |
strategy: | |
type: RollingUpdate | |
rollingUpdate: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: my-dep | |
namespace: default | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: my-dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: mydep-service | |
spec: | |
type: NodePort | |
ports: | |
- port: 8080 #service port | |
targetPort: 8080 #Pod Port | |
nodePort: 30088 #Node Port from the range - 30000-32767 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: labels-demo-pod | |
labels: | |
app: front-end | |
rel: dev | |
spec: | |
containers: | |
- name: httpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Deploy a Web Application | |
hosts: db_and_webserver1, db_and_webserver2 | |
tasks: | |
- name: Install dependencies | |
apt: name={{ item }} state=present | |
with_items: | |
- python | |
- python-setuptools | |
- python-dev | |
- build-essential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
RUN apt-get update && apt-get install -y openssh-server && apt-get install -y python python-setuptools python-dev build-essential python-pip | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:Passw0rd' | chpasswd | |
RUN sed -i 's/#*PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config | |
# SSH login fix. Otherwise user is kicked off after login | |
RUN sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from flask import Flask | |
from flaskext.mysql import MySQL # For newer versions of flask-mysql | |
# from flask.ext.mysql import MySQL # For older versions of flask-mysql | |
app = Flask(__name__) | |
mysql = MySQL() | |
mysql_database_host = 'MYSQL_DATABASE_HOST' in os.environ and os.environ['MYSQL_DATABASE_HOST'] or 'localhost' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KataContainers | |
- image coupled with kernel | |
- light vm layer | |
- can run in nested virturalization environments if hardware supports and you can enable it in bios (ex. only bare metal EC2 instances, limits many cloud providers) | |
- slower startup time | |
- OCI compliant | |
- previously known as ClearContainers by Intel | |
gvisor | |
- kernel implemented in userspace |
OlderNewer