☁️ Cloud ☁️
CIS 1912
HW2 Recap
Mid-Semester Feedback
Traditional Infrastructure
Recall:
Spot Instances
Virtualization
Cloud: VMs
Cloud: Managed Open Source Software
Cloud: Managed Proprietary
Cloud
Functions
Cloud vs Local
Exposing Services
ClusterIP
NodePort
LoadBalancer
Ingress
Productionizing Kubernetes
Productionizing Kube
Secrets
TLS Certificates
Secrets: are we done?
How do we create our secrets securely?
Hashicorp Vault
Cert Manager
---
apiVersion: v1
kind: ConfigMap
metadata:
name: traefik-conf
namespace: kube-system
data:
traefik.toml: |
defaultEntryPoints = ["http","https"]
debug = false
logLevel = "INFO"
#Config to redirect http to https
[entryPoints]
[entryPoints.http]
address = ":80"
compress = true
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
compress = true
[entryPoints.https.tls]
[api]
[api.statistics]
recentErrors = 10
[kubernetes]
[metrics]
[metrics.prometheus]
buckets=[0.1,0.3,1.2,5.0]
entryPoint = "traefik"
[ping]
entryPoint = "http"
[accessLog]
[consul]
endpoint = "consul-consul-server:8500"
watch = true
[acme]
email = "admin@pennlabs.org"
storage = "traefik/acme/account"
acmeLogging = true
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: traefik-ingress-controller
namespace: kube-system
labels:
app: traefik-ingress-lb
spec:
selector:
matchLabels:
app: traefik-ingress-lb
template:
metadata:
labels:
app: traefik-ingress-lb
name: traefik-ingress-lb
spec:
serviceAccountName: traefik-ingress-controller
terminationGracePeriodSeconds: 60
initContainers:
- image: traefik:v1.7-alpine
name: consul-init
args:
- storeconfig
- --configfile=/config/traefik.toml
volumeMounts:
- mountPath: /config
name: config
containers:
- image: traefik:v1.7-alpine
name: traefik-ingress-lb
volumeMounts:
- mountPath: /config
name: config
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
- name: admin
containerPort: 8080
args:
- --api
- --kubernetes
- --configfile=/config/traefik.toml
livenessProbe:
httpGet:
path: /ping
port: 80
initialDelaySeconds: 3
periodSeconds: 3
timeoutSeconds: 1
volumes:
- name: config
configMap:
name: traefik-conf
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: traefik-ingress-controller
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- get
- list
- watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: traefik-ingress-controller
subjects:
- kind: ServiceAccount
name: traefik-ingress-controller
namespace: kube-system
---
kind: Service
apiVersion: v1
metadata:
name: traefik-ingress-service
namespace: kube-system
labels:
app: traefik-ingress-lb
spec:
selector:
app: traefik-ingress-lb
ports:
- protocol: TCP
port: 80
name: http
- protocol: TCP
port: 443
name: https
type: LoadBalancer
YAML Overload
Levels of abstraction:
Helm
replicas: 5
deploymentStrategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
ssl:
enabled: true
enforced: true
permanentRedirect: true
upstream: false
insecureSkipVerify: false
generateTLS: false
persistence:
enabled: false
dashboard:
enabled: false
accessLogs:
enabled: true
format: common
rbac:
enabled: true
metrics:
prometheus:
enabled: true
buckets: [0.1, 0.3, 1.2, 5]
service:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9100"
Helm Demo
HW3 Note
Back to Wharton Computing
“Several years ago, Wharton started their cloud transition from running all their IT services on-premises to a cloud deployment model that includes Amazon Web Services (AWS) ...
The IT teams biggest challenge with their cloud deployment was that every AWS VPC change required manual network changes that took at least one week or more to implement..”
Config on Cloud
Fin