├── sample-dockerfile ├── sander.repo └── Dockerfile ├── countdown ├── pvc.yaml ├── nfs-pvc.yaml ├── README.md ├── pv.yaml ├── nfs-pv.yaml ├── pv-pod.yaml ├── nfs-pv-pod.yaml ├── advanced-dockerfile └── Dockerfile └── lab10.yaml /sample-dockerfile/sander.repo: -------------------------------------------------------------------------------- 1 | # repo 2 | -------------------------------------------------------------------------------- /countdown: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | COUNTER=$1 4 | COUNTER=$(( COUNTER * 60 )) 5 | 6 | while true 7 | do 8 | echo $COUNTER seconds remaining in break 9 | COUNTER=$(( COUNTER - 1 )) 10 | sleep 1 11 | done 12 | -------------------------------------------------------------------------------- /pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteOnce 8 | resources: 9 | requests: 10 | storage: 999Mi 11 | -------------------------------------------------------------------------------- /nfs-pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: nfs-pv-claim 5 | spec: 6 | accessModes: 7 | - ReadWriteMany 8 | resources: 9 | requests: 10 | storage: 100Mi 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ex180 files 2 | 3 | files in this repo are to be used with my EX180 prep course. See https://sandervanvugt.com, https://learning.oreilly.com for more details about this course, or contact me at mail@sandervanvugt.nl 4 | -------------------------------------------------------------------------------- /pv.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolume 2 | apiVersion: v1 3 | metadata: 4 | name: pv-volume 5 | labels: 6 | type: local 7 | spec: 8 | capacity: 9 | storage: 2Gi 10 | accessModes: 11 | - ReadWriteOnce 12 | hostPath: 13 | path: "/mnt/mydata" 14 | -------------------------------------------------------------------------------- /nfs-pv.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: nfs-pv 5 | spec: 6 | capacity: 7 | storage: 2Gi 8 | accessModes: 9 | - ReadWriteMany 10 | persistentVolumeReclaimPolicy: Retain 11 | nfs: 12 | path: /storage 13 | server: 192.168.130.1 14 | readOnly: false 15 | -------------------------------------------------------------------------------- /sample-dockerfile/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | MAINTAINER Sander 3 | 4 | # Add repo file 5 | COPY ./sander.repo /etc/yum.repos.d/ 6 | 7 | # Install cool software 8 | RUN yum --assumeyes update && \ 9 | yum --assumeyes install bash nmap iproute && \ 10 | yum clean all 11 | 12 | ENTRYPOINT ["/usr/bin/nmap"] 13 | CMD ["-sn", "172.17.0.0/24"] 14 | -------------------------------------------------------------------------------- /pv-pod.yaml: -------------------------------------------------------------------------------- 1 | kind: Pod 2 | apiVersion: v1 3 | metadata: 4 | name: pv-pod 5 | spec: 6 | volumes: 7 | - name: pv-storage 8 | persistentVolumeClaim: 9 | claimName: pv-claim 10 | containers: 11 | - name: pv-container 12 | image: bitnami/nginx 13 | volumeMounts: 14 | - mountPath: "/usr/share/nginx/html" 15 | name: pv-storage 16 | -------------------------------------------------------------------------------- /nfs-pv-pod.yaml: -------------------------------------------------------------------------------- 1 | kind: Pod 2 | apiVersion: v1 3 | metadata: 4 | name: nfs-pv-pod 5 | spec: 6 | volumes: 7 | - name: nfs-pv 8 | persistentVolumeClaim: 9 | claimName: nfs-pv-claim 10 | containers: 11 | - name: nfs-client1 12 | image: centos:7 13 | command: 14 | - sleep 15 | - "3600" 16 | volumeMounts: 17 | - mountPath: "/nfsshare" 18 | name: nfs-pv 19 | - name: nfs-client2 20 | image: centos:7 21 | command: 22 | - sleep 23 | - "3600" 24 | volumeMounts: 25 | - mountPath: "/nfsshare" 26 | name: nfs-pv 27 | -------------------------------------------------------------------------------- /advanced-dockerfile/Dockerfile: -------------------------------------------------------------------------------- 1 | # example from https://github.com/jboss-dockerfiles/wildfly/blob/master/Dockerfile 2 | # Use latest jboss/base-jdk:11 image as the base 3 | FROM jboss/base-jdk:11 4 | 5 | # Set the WILDFLY_VERSION env variable 6 | ENV WILDFLY_VERSION 24.0.1.Final 7 | ENV WILDFLY_SHA1 751e3ff9128a6fbe72016552a9b864f729a710cc 8 | ENV JBOSS_HOME /opt/jboss/wildfly 9 | 10 | USER root 11 | 12 | # Add the WildFly distribution to /opt, and make wildfly the owner of the extracted tar content 13 | # Make sure the distribution is available from a well-known place 14 | RUN cd $HOME \ 15 | && curl -O https://download.jboss.org/wildfly/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz \ 16 | && sha1sum wildfly-$WILDFLY_VERSION.tar.gz | grep $WILDFLY_SHA1 \ 17 | && tar xf wildfly-$WILDFLY_VERSION.tar.gz \ 18 | && mv $HOME/wildfly-$WILDFLY_VERSION $JBOSS_HOME \ 19 | && rm wildfly-$WILDFLY_VERSION.tar.gz \ 20 | && chown -R jboss:0 ${JBOSS_HOME} \ 21 | && chmod -R g+rw ${JBOSS_HOME} 22 | 23 | # Ensure signals are forwarded to the JVM process correctly for graceful shutdown 24 | ENV LAUNCH_JBOSS_IN_BACKGROUND true 25 | 26 | USER jboss 27 | 28 | # Expose the ports in which we're interested 29 | EXPOSE 8080 30 | 31 | # Set the default command to run on boot 32 | # This will boot WildFly in standalone mode and bind to all interfaces 33 | CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"] 34 | -------------------------------------------------------------------------------- /lab10.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | items: 3 | - apiVersion: image.openshift.io/v1 4 | kind: ImageStream 5 | metadata: 6 | annotations: 7 | openshift.io/generated-by: OpenShiftNewApp 8 | creationTimestamp: null 9 | labels: 10 | app: nginx 11 | app.kubernetes.io/component: nginx 12 | app.kubernetes.io/instance: nginx 13 | name: nginx 14 | spec: 15 | lookupPolicy: 16 | local: false 17 | tags: 18 | - annotations: 19 | openshift.io/imported-from: bitnami/nginx 20 | from: 21 | kind: DockerImage 22 | name: bitnami/nginx 23 | generation: null 24 | importPolicy: {} 25 | name: latest 26 | referencePolicy: 27 | type: "" 28 | status: 29 | dockerImageRepository: "" 30 | - apiVersion: apps/v1 31 | kind: Deployment 32 | metadata: 33 | annotations: 34 | image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"nginx:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"nginx\")].image"}]' 35 | openshift.io/generated-by: OpenShiftNewApp 36 | creationTimestamp: null 37 | labels: 38 | app: nginx 39 | app.kubernetes.io/component: nginx 40 | app.kubernetes.io/instance: nginx 41 | name: nginx 42 | spec: 43 | replicas: 1 44 | selector: 45 | matchLabels: 46 | deployment: nginx 47 | strategy: {} 48 | template: 49 | metadata: 50 | annotations: 51 | openshift.io/generated-by: OpenShiftNewApp 52 | creationTimestamp: null 53 | labels: 54 | deployment: nginx 55 | spec: 56 | containers: 57 | - image: ' ' 58 | name: nginx 59 | ports: 60 | - containerPort: 8080 61 | protocol: TCP 62 | - containerPort: 8443 63 | protocol: TCP 64 | resources: {} 65 | status: {} 66 | - apiVersion: v1 67 | kind: Service 68 | metadata: 69 | annotations: 70 | openshift.io/generated-by: OpenShiftNewApp 71 | creationTimestamp: null 72 | labels: 73 | app: nginx 74 | app.kubernetes.io/component: nginx 75 | app.kubernetes.io/instance: nginx 76 | name: nginx 77 | spec: 78 | ports: 79 | - name: 8080-tcp 80 | port: 8080 81 | protocol: TCP 82 | targetPort: 8080 83 | - name: 8443-tcp 84 | port: 8443 85 | protocol: TCP 86 | targetPort: 8443 87 | selector: 88 | deployment: bginx 89 | status: 90 | loadBalancer: {} 91 | kind: List 92 | metadata: {} 93 | --------------------------------------------------------------------------------