---
# System prepended metadata

title: Cisco Meraki  08/02/2020 - 09/02/2020

---

# Cisco Meraki  08/02/2020 - 09/02/2020

## Trainers
[Rafael Tanaka](mailto:rafael.tanaka@jetstack.io)

## Setup

| Meeting ID | Password   |
| ---------- | ---------- |
| Zoom       | to confirm |

### Links

- [Download Zoom](https://zoom.us/download#client_4meeting)

## Schedule

| | |
|--|--|
|Start|9:30|
|Morning break|11:00-11:10|
|Lunch|12:15-13:15|
|Afternoon break|15:10-15:20|
|Finish|17:00|

## Attendee Resources

[Service Topology](https://kubernetes.io/docs/concepts/services-networking/service-topology/)


### Workshop: labelit

back-end-svc **Service**
```yaml=
apiVersion: v1
kind: Service
metadata:
  name: back-end-svc
spec:
  type: ClusterIP
  selector:
    app: back-end
  ports:
  - port: 8080
    targetPort: 8080
```

Workshop: **Environmentally friendly**

```yaml=
apiVersion: v1
kind: Pod
metadata:
  name: sample-web
  labels:
    app: config
spec:
  volumes:
  - name: varfile
    configMap:
      name: myvars
      items:
      - key: var.txt
        path: var.txt
  containers:
  - image: gcr.io/jetstack-workshops/sample-web:configmap
    name: sample-web
    env:
    - name: MYVAR
      valueFrom:
        configMapKeyRef:
          key: MYVAR
          name: myvars
    - name: MYSECRET
      valueFrom:
        secretKeyRef:
          key: secretenv
          name: mysecret
    volumeMounts:
    - name: varfile
      mountPath: /data/
```


Shipping deployment:

```yaml=
apiVersion: apps/v1
kind: deployment
metadata:
  name: shippingservice
spec:
  selector:
    matchLabels:
      app: shippingservice
  template:
    metadata:
      labels:
        app: shippingservice
    spec:
      containers:
      - name: server
        image: gcr.io/google-samples/microservices-demo/shippingservice:v0.2.1
        ports:
        - containerPort: 50051
        env:
        - name: PORT
          value: "50051"
        - name: DISABLE_STATS
          value: "1"
        - name: DISABLE_TRACING
          value: "1"
        - name: DISABLE_PROFILER
          value: "1"
        readinessProbe:
          periodSeconds: 5
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:50051"]
        livenessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:50051"]
#        resources:
#          requests:
#            cpu: 100m
#            memory: 64Mi
#          limits:
#            cpu: 200m
#            memory: 128Mi
```

If you are a nano kinda of guy you can change the default editor for `kubectl edit` just run the below command on your terminal:

```bash=
export KUBE_EDITOR=nano
```


workshop: **HPA**

```yaml=
apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: hpa-test
  name: hpa-test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hpa-test
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: hpa-test
    spec:
      containers:
      - image: busybox:1.33.0
        name: busybox
        command: ["/bin/sh", "-c", "sleep 6000"]
        resources:
          requests:
            cpu: "50m"
status: {}
```

autoscale command:

```bash=
kubectl autoscale deployment hpa-test --max=5 --min=1 --cpu-percent=50 --dry-run=client -o yaml > /root/manifests/hpa-test.yaml
```

Lifecycle hooks:

https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/

Best Practices:
https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-terminating-with-grace


ReadWriteMany:

https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes

## Links for pending workshops:

Init containers:
https://www.katacoda.com/jetstack-training/courses/kipday2/initcontainers

CronJob:
https://www.katacoda.com/jetstack-training/courses/kipday2/cronjob

RBAC:
https://www.katacoda.com/jetstack-training/courses/kipday2/rbac


Feedback form:

https://docs.google.com/forms/d/14FTN2JGsO4KdC-6uKL_Ih0GVW11Mc5Z0D0jeUmPRJbU/edit?gxids=7628