├── 10-1-kuard-deployment.yaml ├── 11-1-fluentd.yaml ├── 11-2-nginx-fast-storage.yaml ├── 12-1-job-oneshot.yaml ├── 12-2-job-oneshot-failure1.yaml ├── 12-3-job-parallel.yaml ├── 12-4-rs-queue.yaml ├── 12-5-service-queue.yaml ├── 12-6-load-queue.sh ├── 12-7-job-consumers.yaml ├── 13-1-my-config.txt ├── 13-2-kuard-config.yaml ├── 13-3-kuard-secret.yaml ├── 13-4-kuard-secret-ips.yaml ├── 16-1-dns-service.yaml ├── 16-10-mongo-simple.yaml ├── 16-11-mongo-service.yaml ├── 16-12-mongo-configmap.yaml ├── 16-13-mongo.yaml ├── 16-2-external-ip-service.yaml ├── 16-3-external-ip-endpoints.yaml ├── 16-4-nfs-volume.yaml ├── 16-5-nfs-volume-claim.yaml ├── 16-6-mysql-replicaset.yaml ├── 16-7-mysql-service.yaml ├── 16-8-storageclass.yaml ├── 16-9-dynamic-volume-claim.yaml ├── 19-1-kuard-pod-securitycontext.yaml ├── 19-10-kuard-pod.yaml ├── 19-11-networkpolicy-default-deny.yaml ├── 19-12-networkpolicy-kuard-allow-test-source.yaml ├── 19-2-amicontained-pod.yaml ├── 19-3-amicontained-pod-securitycontext.yaml ├── 19-4-baseline-ns.yaml ├── 19-5-baseline-ns.yaml ├── 19-6-kuard-pod.yaml ├── 19-7-service-account.yaml ├── 19-8-kuard-pod-runtimeclass.yaml ├── 19-9-networkpolicy-default-deny.yaml ├── 20-1-allowedrepos-constraint-template.yaml ├── 20-2-allowedrepos-constraint.yaml ├── 20-3-compliant-pod.yaml ├── 20-4-noncompliant-pod.yaml ├── 20-5-allowedrepos-constraint-dryrun.yaml ├── 20-6-imagepullpolicyalways-mutation.yaml ├── 20-7-config-sync.yaml ├── 20-8-uniqueingresshost-constraint-template.yaml ├── 5-1-kuard-pod.yaml ├── 5-2-kuard-pod-health.yaml ├── 5-3-kaurd-pod-resreq.yaml ├── 5-4-kaurd-pod-reslim.yaml ├── 5-5-kuard-pod-vol.yaml ├── 5-6-kuard-pod-full.yaml ├── 8-1-simple-ingress.yaml ├── 8-2-host-ingress.yaml ├── 8-3-path-ingress.yaml ├── 8-4-tls-secret.yaml ├── 8-5-tls-ingress.yaml ├── 9-1-kuard-rs.yaml ├── LICENSE └── README.md /10-1-kuard-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: kuard 5 | labels: 6 | run: kuard 7 | spec: 8 | selector: 9 | matchLabels: 10 | run: kuard 11 | replicas: 1 12 | template: 13 | metadata: 14 | labels: 15 | run: kuard 16 | spec: 17 | containers: 18 | - name: kuard 19 | image: gcr.io/kuar-demo/kuard-amd64:blue 20 | -------------------------------------------------------------------------------- /11-1-fluentd.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: DaemonSet 3 | metadata: 4 | name: fluentd 5 | labels: 6 | app: fluentd 7 | spec: 8 | selector: 9 | matchLabels: 10 | app: fluentd 11 | template: 12 | metadata: 13 | labels: 14 | app: fluentd 15 | spec: 16 | containers: 17 | - name: fluentd 18 | image: fluent/fluentd:v0.14.10 19 | resources: 20 | limits: 21 | memory: 200Mi 22 | requests: 23 | cpu: 100m 24 | memory: 200Mi 25 | volumeMounts: 26 | - name: varlog 27 | mountPath: /var/log 28 | - name: varlibdockercontainers 29 | mountPath: /var/lib/docker/containers 30 | readOnly: true 31 | terminationGracePeriodSeconds: 30 32 | volumes: 33 | - name: varlog 34 | hostPath: 35 | path: /var/log 36 | - name: varlibdockercontainers 37 | hostPath: 38 | path: /var/lib/docker/containers 39 | -------------------------------------------------------------------------------- /11-2-nginx-fast-storage.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: DaemonSet 3 | metadata: 4 | labels: 5 | app: nginx 6 | ssd: "true" 7 | name: nginx-fast-storage 8 | spec: 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | ssd: "true" 13 | template: 14 | metadata: 15 | labels: 16 | app: nginx 17 | ssd: "true" 18 | spec: 19 | nodeSelector: 20 | ssd: "true" 21 | containers: 22 | - name: nginx 23 | image: nginx:1.10.0 24 | -------------------------------------------------------------------------------- /12-1-job-oneshot.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: oneshot 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: kuard 10 | image: gcr.io/kuar-demo/kuard-amd64:blue 11 | imagePullPolicy: Always 12 | command: 13 | - "/kuard" 14 | args: 15 | - "--keygen-enable" 16 | - "--keygen-exit-on-complete" 17 | - "--keygen-num-to-gen=10" 18 | restartPolicy: OnFailure 19 | -------------------------------------------------------------------------------- /12-2-job-oneshot-failure1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: oneshot 5 | labels: 6 | chapter: jobs 7 | spec: 8 | template: 9 | metadata: 10 | labels: 11 | chapter: jobs 12 | spec: 13 | containers: 14 | - name: kuard 15 | image: gcr.io/kuar-demo/kuard-amd64:blue 16 | imagePullPolicy: Always 17 | command: 18 | - "/kuard" 19 | args: 20 | - "--keygen-enable" 21 | - "--keygen-exit-on-complete" 22 | - "--keygen-exit-code=1" 23 | - "--keygen-num-to-gen=3" 24 | restartPolicy: OnFailure 25 | -------------------------------------------------------------------------------- /12-3-job-parallel.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: parallel 5 | labels: 6 | chapter: jobs 7 | spec: 8 | parallelism: 5 9 | completions: 10 10 | template: 11 | metadata: 12 | labels: 13 | chapter: jobs 14 | spec: 15 | containers: 16 | - name: kuard 17 | image: gcr.io/kuar-demo/kuard-amd64:blue 18 | imagePullPolicy: Always 19 | command: 20 | - "/kuard" 21 | args: 22 | - "--keygen-enable" 23 | - "--keygen-exit-on-complete" 24 | - "--keygen-num-to-gen=10" 25 | restartPolicy: OnFailure 26 | -------------------------------------------------------------------------------- /12-4-rs-queue.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: ReplicaSet 3 | metadata: 4 | labels: 5 | app: work-queue 6 | component: queue 7 | chapter: jobs 8 | name: queue 9 | spec: 10 | replicas: 1 11 | selector: 12 | matchLabels: 13 | app: work-queue 14 | component: queue 15 | chapter: jobs 16 | template: 17 | metadata: 18 | labels: 19 | app: work-queue 20 | component: queue 21 | chapter: jobs 22 | spec: 23 | containers: 24 | - name: queue 25 | image: "gcr.io/kuar-demo/kuard-amd64:blue" 26 | imagePullPolicy: Always 27 | -------------------------------------------------------------------------------- /12-5-service-queue.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: work-queue 6 | component: queue 7 | chapter: jobs 8 | name: queue 9 | spec: 10 | ports: 11 | - port: 8080 12 | protocol: TCP 13 | targetPort: 8080 14 | selector: 15 | app: work-queue 16 | component: queue 17 | -------------------------------------------------------------------------------- /12-6-load-queue.sh: -------------------------------------------------------------------------------- 1 | 2 | # Create a work queue called 'keygen' 3 | curl -X PUT localhost:8080/memq/server/queues/keygen 4 | 5 | # Create 100 work items and load up the queue. 6 | for i in work-item-{0..99}; do 7 | curl -X POST localhost:8080/memq/server/queues/keygen/enqueue \ 8 | -d "$i" 9 | done 10 | -------------------------------------------------------------------------------- /12-7-job-consumers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | labels: 5 | app: message-queue 6 | component: consumer 7 | chapter: jobs 8 | name: consumers 9 | spec: 10 | parallelism: 5 11 | template: 12 | metadata: 13 | labels: 14 | app: message-queue 15 | component: consumer 16 | chapter: jobs 17 | spec: 18 | containers: 19 | - name: worker 20 | image: "gcr.io/kuar-demo/kuard-amd64:blue" 21 | imagePullPolicy: Always 22 | command: 23 | - "/kuard" 24 | args: 25 | - "--keygen-enable" 26 | - "--keygen-exit-on-complete" 27 | - "--keygen-memq-server=http://queue:8080/memq/server" 28 | - "--keygen-memq-queue=keygen" 29 | restartPolicy: OnFailure 30 | -------------------------------------------------------------------------------- /13-1-my-config.txt: -------------------------------------------------------------------------------- 1 | # This is a sample config file that I might use to configure an application 2 | parameter1 = value1 3 | parameter2 = value2 4 | -------------------------------------------------------------------------------- /13-2-kuard-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard-config 5 | spec: 6 | containers: 7 | - name: test-container 8 | image: gcr.io/kuar-demo/kuard-amd64:blue 9 | imagePullPolicy: Always 10 | command: 11 | - "/kuard" 12 | - "$(EXTRA_PARAM)" 13 | env: 14 | # An example of an environment variable used inside the container 15 | - name: ANOTHER_PARAM 16 | valueFrom: 17 | configMapKeyRef: 18 | name: my-config 19 | key: another-param 20 | # An example of an environment variable passed to the command to start 21 | # the container (above). 22 | - name: EXTRA_PARAM 23 | valueFrom: 24 | configMapKeyRef: 25 | name: my-config 26 | key: extra-param 27 | volumeMounts: 28 | # Mounting the ConfigMap as a set of files 29 | - name: config-volume 30 | mountPath: /config 31 | volumes: 32 | - name: config-volume 33 | configMap: 34 | name: my-config 35 | restartPolicy: Never 36 | -------------------------------------------------------------------------------- /13-3-kuard-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard-tls 5 | spec: 6 | containers: 7 | - name: kuard-tls 8 | image: gcr.io/kuar-demo/kuard-amd64:blue 9 | imagePullPolicy: Always 10 | volumeMounts: 11 | - name: tls-certs 12 | mountPath: "/tls" 13 | readOnly: true 14 | volumes: 15 | - name: tls-certs 16 | secret: 17 | secretName: kuard-tls 18 | -------------------------------------------------------------------------------- /13-4-kuard-secret-ips.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard-tls 5 | spec: 6 | containers: 7 | - name: kuard-tls 8 | image: gcr.io/kuar-demo/kuard-amd64:blue 9 | imagePullPolicy: Always 10 | volumeMounts: 11 | - name: tls-certs 12 | mountPath: "/tls" 13 | readOnly: true 14 | imagePullSecrets: 15 | - name: my-image-pull-secret 16 | volumes: 17 | - name: tls-certs 18 | secret: 19 | secretName: kuard-tls 20 | -------------------------------------------------------------------------------- /16-1-dns-service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: external-database 5 | spec: 6 | type: ExternalName 7 | externalName: database.company.com 8 | -------------------------------------------------------------------------------- /16-10-mongo-simple.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: mongo 5 | spec: 6 | serviceName: "mongo" 7 | replicas: 3 8 | selector: 9 | matchLabels: 10 | app: mongo 11 | template: 12 | metadata: 13 | labels: 14 | app: mongo 15 | spec: 16 | containers: 17 | - name: mongodb 18 | image: mongo:3.4.24 19 | command: 20 | - mongod 21 | - --replSet 22 | - rs0 23 | ports: 24 | - containerPort: 27017 25 | name: peer 26 | -------------------------------------------------------------------------------- /16-11-mongo-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mongo 5 | spec: 6 | ports: 7 | - port: 27017 8 | name: peer 9 | clusterIP: None 10 | selector: 11 | app: mongo 12 | -------------------------------------------------------------------------------- /16-12-mongo-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: mongo-init 5 | data: 6 | init.sh: | 7 | #!/bin/bash 8 | 9 | # Need to wait for the readiness health check to pass so that the 10 | # mongo names resolve. This is kind of wonky. 11 | until ping -c 1 ${HOSTNAME}.mongo; do 12 | echo "waiting for DNS (${HOSTNAME}.mongo)..." 13 | sleep 2 14 | done 15 | 16 | until /usr/bin/mongo --eval 'printjson(db.serverStatus())'; do 17 | echo "connecting to local mongo..." 18 | sleep 2 19 | done 20 | echo "connected to local." 21 | 22 | HOST=mongo-0.mongo:27017 23 | 24 | until /usr/bin/mongo --host=${HOST} --eval 'printjson(db.serverStatus())'; do 25 | echo "connecting to remote mongo..." 26 | sleep 2 27 | done 28 | echo "connected to remote." 29 | 30 | if [[ "${HOSTNAME}" != 'mongo-0' ]]; then 31 | until /usr/bin/mongo --host=${HOST} --eval="printjson(rs.status())" \ 32 | | grep -v "no replset config has been received"; do 33 | echo "waiting for replication set initialization" 34 | sleep 2 35 | done 36 | echo "adding self to mongo-0" 37 | /usr/bin/mongo --host=${HOST} \ 38 | --eval="printjson(rs.add('${HOSTNAME}.mongo'))" 39 | fi 40 | 41 | if [[ "${HOSTNAME}" == 'mongo-0' ]]; then 42 | echo "initializing replica set" 43 | /usr/bin/mongo --eval="printjson(rs.initiate(\ 44 | {'_id': 'rs0', 'members': [{'_id': 0, \ 45 | 'host': 'mongo-0.mongo:27017'}]}))" 46 | fi 47 | echo "initialized" 48 | 49 | while true; do 50 | sleep 3600 51 | done 52 | -------------------------------------------------------------------------------- /16-13-mongo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: mongo 5 | spec: 6 | serviceName: "mongo" 7 | replicas: 3 8 | selector: 9 | matchLabels: 10 | app: mongo 11 | template: 12 | metadata: 13 | labels: 14 | app: mongo 15 | spec: 16 | containers: 17 | - name: mongodb 18 | image: mongo:3.4.1 19 | command: 20 | - mongod 21 | - --replSet 22 | - rs0 23 | ports: 24 | - containerPort: 27017 25 | name: web 26 | - name: init-mongo 27 | image: mongo:3.4.1 28 | command: 29 | - bash 30 | - /config/init.sh 31 | volumeMounts: 32 | - name: config 33 | mountPath: /config 34 | volumes: 35 | - name: config 36 | configMap: 37 | name: "mongo-init" 38 | -------------------------------------------------------------------------------- /16-2-external-ip-service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: external-ip-database 5 | spec: 6 | ports: 7 | - port: 3306 8 | -------------------------------------------------------------------------------- /16-3-external-ip-endpoints.yaml: -------------------------------------------------------------------------------- 1 | kind: Endpoints 2 | apiVersion: v1 3 | metadata: 4 | name: external-ip-database 5 | subsets: 6 | - addresses: 7 | - ip: 192.168.0.1 8 | ports: 9 | - port: 3306 10 | -------------------------------------------------------------------------------- /16-4-nfs-volume.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: database 5 | labels: 6 | volume: my-volume 7 | spec: 8 | accessModes: 9 | - ReadWriteMany 10 | capacity: 11 | storage: 1Gi 12 | nfs: 13 | server: 192.168.0.1 14 | path: "/exports" 15 | -------------------------------------------------------------------------------- /16-5-nfs-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: database 5 | spec: 6 | accessModes: 7 | - ReadWriteMany 8 | resources: 9 | requests: 10 | storage: 1Gi 11 | selector: 12 | matchLabels: 13 | volume: my-volume 14 | -------------------------------------------------------------------------------- /16-6-mysql-replicaset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: ReplicaSet 3 | metadata: 4 | name: mysql 5 | # labels so that we can bind a Service to this Pod 6 | labels: 7 | app: mysql 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: mysql 13 | template: 14 | metadata: 15 | labels: 16 | app: mysql 17 | spec: 18 | containers: 19 | - name: database 20 | image: mysql 21 | resources: 22 | requests: 23 | cpu: 1 24 | memory: 2Gi 25 | env: 26 | # Environment variables are not a best practice for security, 27 | # but we're using them here for brevity in the example. 28 | # See Chapter 11 for better options. 29 | - name: MYSQL_ROOT_PASSWORD 30 | value: some-password-here 31 | livenessProbe: 32 | tcpSocket: 33 | port: 3306 34 | ports: 35 | - containerPort: 3306 36 | volumeMounts: 37 | - name: database 38 | # /var/lib/mysql is where MySQL stores its databases 39 | mountPath: "/var/lib/mysql" 40 | volumes: 41 | - name: database 42 | persistentVolumeClaim: 43 | claimName: database 44 | -------------------------------------------------------------------------------- /16-7-mysql-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | spec: 6 | ports: 7 | - port: 3306 8 | protocol: TCP 9 | selector: 10 | app: mysql 11 | -------------------------------------------------------------------------------- /16-8-storageclass.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: storage.k8s.io/v1 2 | kind: StorageClass 3 | metadata: 4 | name: default 5 | annotations: 6 | storageclass.beta.kubernetes.io/is-default-class: "true" 7 | labels: 8 | kubernetes.io/cluster-service: "true" 9 | provisioner: kubernetes.io/azure-disk 10 | -------------------------------------------------------------------------------- /16-9-dynamic-volume-claim.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: my-claim 5 | annotations: 6 | volume.beta.kubernetes.io/storage-class: default 7 | spec: 8 | accessModes: 9 | - ReadWriteOnce 10 | resources: 11 | requests: 12 | storage: 10Gi 13 | -------------------------------------------------------------------------------- /19-1-kuard-pod-securitycontext.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | spec: 6 | securityContext: 7 | runAsNonRoot: true 8 | runAsUser: 1000 9 | runAsGroup: 3000 10 | fsGroup: 2000 11 | containers: 12 | - image: gcr.io/kuar-demo/kuard-amd64:blue 13 | name: kuard 14 | securityContext: 15 | allowPrivilegeEscalation: false 16 | readOnlyRootFilesystem: true 17 | privileged: false 18 | ports: 19 | - containerPort: 8080 20 | name: http 21 | protocol: TCP 22 | -------------------------------------------------------------------------------- /19-10-kuard-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | labels: 6 | app: kuard 7 | spec: 8 | containers: 9 | - image: gcr.io/kuar-demo/kuard-amd64:blue 10 | name: kuard 11 | ports: 12 | - containerPort: 8080 13 | name: http 14 | protocol: TCP 15 | -------------------------------------------------------------------------------- /19-11-networkpolicy-default-deny.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: NetworkPolicy 3 | metadata: 4 | name: default-deny-ingress 5 | spec: 6 | podSelector: {} 7 | policyTypes: 8 | - Ingress 9 | -------------------------------------------------------------------------------- /19-12-networkpolicy-kuard-allow-test-source.yaml: -------------------------------------------------------------------------------- 1 | kind: NetworkPolicy 2 | apiVersion: networking.k8s.io/v1 3 | metadata: 4 | name: access-kuard 5 | spec: 6 | podSelector: 7 | matchLabels: 8 | app: kuard 9 | ingress: 10 | - from: 11 | - podSelector: 12 | matchLabels: 13 | run: test-source 14 | -------------------------------------------------------------------------------- /19-2-amicontained-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: amicontained 5 | spec: 6 | containers: 7 | - image: jess/amicontained:v0.4.9 8 | name: amicontained 9 | command: [ "/bin/sh", "-c", "--" ] 10 | args: [ "amicontained" ] 11 | -------------------------------------------------------------------------------- /19-3-amicontained-pod-securitycontext.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: amicontained 5 | annotations: 6 | container.apparmor.security.beta.kubernetes.io/amicontained: "runtime/default" 7 | spec: 8 | securityContext: 9 | runAsNonRoot: true 10 | runAsUser: 1000 11 | runAsGroup: 3000 12 | fsGroup: 2000 13 | seccompProfile: 14 | type: RuntimeDefault 15 | containers: 16 | - image: jess/amicontained:v0.4.9 17 | name: amicontained 18 | command: [ "/bin/sh", "-c", "--" ] 19 | args: [ "amicontained" ] 20 | securityContext: 21 | capabilities: 22 | add: ["SYS_TIME"] 23 | drop: ["NET_BIND_SERVICE"] 24 | allowPrivilegeEscalation: false 25 | readOnlyRootFilesystem: true 26 | privileged: false 27 | -------------------------------------------------------------------------------- /19-4-baseline-ns.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: baseline-ns 5 | labels: 6 | pod-security.kubernetes.io/enforce: baseline 7 | pod-security.kubernetes.io/enforce-version: v1.22 8 | pod-security.kubernetes.io/audit: restricted 9 | pod-security.kubernetes.io/audit-version: v1.22 10 | pod-security.kubernetes.io/warn: restricted 11 | pod-security.kubernetes.io/warn-version: v1.22 12 | -------------------------------------------------------------------------------- /19-5-baseline-ns.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: baseline-ns 5 | labels: 6 | pod-security.kubernetes.io/enforce: baseline 7 | pod-security.kubernetes.io/enforce-version: v1.22 8 | pod-security.kubernetes.io/audit: restricted 9 | pod-security.kubernetes.io/audit-version: v1.22 10 | pod-security.kubernetes.io/warn: restricted 11 | pod-security.kubernetes.io/warn-version: v1.22 12 | -------------------------------------------------------------------------------- /19-6-kuard-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | labels: 6 | app: kuard 7 | spec: 8 | containers: 9 | - image: gcr.io/kuar-demo/kuard-amd64:blue 10 | name: kuard 11 | ports: 12 | - containerPort: 8080 13 | name: http 14 | protocol: TCP 15 | -------------------------------------------------------------------------------- /19-7-service-account.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: default 5 | automountServiceAccountToken: false 6 | -------------------------------------------------------------------------------- /19-8-kuard-pod-runtimeclass.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | labels: 6 | app: kuard 7 | spec: 8 | runtimeClassName: firecracker 9 | containers: 10 | - image: gcr.io/kuar-demo/kuard-amd64:blue 11 | name: kuard 12 | ports: 13 | - containerPort: 8080 14 | name: http 15 | protocol: TCP 16 | -------------------------------------------------------------------------------- /19-9-networkpolicy-default-deny.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: NetworkPolicy 3 | metadata: 4 | name: default-deny-ingress 5 | spec: 6 | podSelector: {} 7 | policyTypes: 8 | - Ingress 9 | -------------------------------------------------------------------------------- /20-1-allowedrepos-constraint-template.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: templates.gatekeeper.sh/v1beta1 2 | kind: ConstraintTemplate 3 | metadata: 4 | name: k8sallowedrepos 5 | annotations: 6 | description: Requires container images to begin with a repo string from a 7 | specified list. 8 | spec: 9 | crd: 10 | spec: 11 | names: 12 | kind: K8sAllowedRepos 13 | validation: 14 | # Schema for the `parameters` field 15 | openAPIV3Schema: 16 | properties: 17 | repos: 18 | type: array 19 | items: 20 | type: string 21 | targets: 22 | - target: admission.k8s.gatekeeper.sh 23 | rego: | 24 | package k8sallowedrepos 25 | 26 | violation[{"msg": msg}] { 27 | container := input.review.object.spec.containers[_] 28 | not strings.any_prefix_match(container.image, input.parameters.repos) 29 | msg := sprintf("container <%v> has an invalid image repo <%v>, allowed repos are %v", [container.name, container.image, input.parameters.repos]) 30 | } 31 | 32 | violation[{"msg": msg}] { 33 | container := input.review.object.spec.initContainers[_] 34 | not strings.any_prefix_match(container.image, input.parameters.repos) 35 | msg := sprintf("initContainer <%v> has an invalid image repo <%v>, allowed repos are %v", [container.name, container.image, input.parameters.repos]) 36 | } 37 | 38 | violation[{"msg": msg}] { 39 | container := input.review.object.spec.ephemeralContainers[_] 40 | not strings.any_prefix_match(container.image, input.parameters.repos) 41 | msg := sprintf("ephemeralContainer <%v> has an invalid image repo <%v>, allowed repos are %v", [container.name, container.image, input.parameters.repos]) 42 | } 43 | -------------------------------------------------------------------------------- /20-2-allowedrepos-constraint.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: constraints.gatekeeper.sh/v1beta1 2 | kind: K8sAllowedRepos 3 | metadata: 4 | name: repo-is-kuar-demo 5 | spec: 6 | enforcementAction: deny 7 | match: 8 | kinds: 9 | - apiGroups: [""] 10 | kinds: ["Pod"] 11 | namespaces: 12 | - "default" 13 | parameters: 14 | repos: 15 | - "gcr.io/kuar-demo/" 16 | -------------------------------------------------------------------------------- /20-3-compliant-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | spec: 6 | containers: 7 | - image: gcr.io/kuar-demo/kuard-amd64:blue 8 | name: kuard 9 | ports: 10 | - containerPort: 8080 11 | name: http 12 | protocol: TCP 13 | -------------------------------------------------------------------------------- /20-4-noncompliant-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: nginx-noncompliant 5 | spec: 6 | containers: 7 | - name: nginx 8 | image: nginx 9 | -------------------------------------------------------------------------------- /20-5-allowedrepos-constraint-dryrun.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: constraints.gatekeeper.sh/v1beta1 2 | kind: K8sAllowedRepos 3 | metadata: 4 | name: repo-is-kuar-demo 5 | spec: 6 | enforcementAction: dryrun 7 | match: 8 | kinds: 9 | - apiGroups: [""] 10 | kinds: ["Pod"] 11 | namespaces: 12 | - "default" 13 | parameters: 14 | repos: 15 | - "gcr.io/kuar-demo/" 16 | -------------------------------------------------------------------------------- /20-6-imagepullpolicyalways-mutation.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: mutations.gatekeeper.sh/v1alpha1 2 | kind: Assign 3 | metadata: 4 | name: demo-image-pull-policy 5 | spec: 6 | applyTo: 7 | - groups: [""] 8 | kinds: ["Pod"] 9 | versions: ["v1"] 10 | match: 11 | scope: Namespaced 12 | kinds: 13 | - apiGroups: ["*"] 14 | kinds: ["Pod"] 15 | excludedNamespaces: ["system"] 16 | location: "spec.containers[name:*].imagePullPolicy" 17 | parameters: 18 | assign: 19 | value: Always 20 | -------------------------------------------------------------------------------- /20-7-config-sync.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.gatekeeper.sh/v1alpha1 2 | kind: Config 3 | metadata: 4 | name: config 5 | namespace: "gatekeeper-system" 6 | spec: 7 | sync: 8 | syncOnly: 9 | - group: "" 10 | version: "v1" 11 | kind: "Namespace" 12 | - group: "" 13 | version: "v1" 14 | kind: "Pod" 15 | -------------------------------------------------------------------------------- /20-8-uniqueingresshost-constraint-template.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: templates.gatekeeper.sh/v1beta1 2 | kind: ConstraintTemplate 3 | metadata: 4 | name: k8suniqueingresshost 5 | annotations: 6 | description: Requires all Ingress hosts to be unique. 7 | spec: 8 | crd: 9 | spec: 10 | names: 11 | kind: K8sUniqueIngressHost 12 | targets: 13 | - target: admission.k8s.gatekeeper.sh 14 | rego: | 15 | package k8suniqueingresshost 16 | 17 | identical(obj, review) { 18 | obj.metadata.namespace == review.object.metadata.namespace 19 | obj.metadata.name == review.object.metadata.name 20 | } 21 | 22 | violation[{"msg": msg}] { 23 | input.review.kind.kind == "Ingress" 24 | regex.match("^(extensions|networking.k8s.io)$", input.review.kind.group) 25 | host := input.review.object.spec.rules[_].host 26 | other := data.inventory.namespace[_][otherapiversion]["Ingress"][name] 27 | regex.match("^(extensions|networking.k8s.io)/.+$", otherapiversion) 28 | other.spec.rules[_].host == host 29 | not identical(other, input.review) 30 | msg := sprintf("ingress host conflicts with an existing ingress <%v>", [host]) 31 | } 32 | -------------------------------------------------------------------------------- /5-1-kuard-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | spec: 6 | containers: 7 | - image: gcr.io/kuar-demo/kuard-amd64:blue 8 | name: kuard 9 | ports: 10 | - containerPort: 8080 11 | name: http 12 | protocol: TCP 13 | -------------------------------------------------------------------------------- /5-2-kuard-pod-health.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | spec: 6 | containers: 7 | - image: gcr.io/kuar-demo/kuard-amd64:blue 8 | name: kuard 9 | livenessProbe: 10 | httpGet: 11 | path: /healthy 12 | port: 8080 13 | initialDelaySeconds: 5 14 | timeoutSeconds: 1 15 | periodSeconds: 10 16 | failureThreshold: 3 17 | ports: 18 | - containerPort: 8080 19 | name: http 20 | protocol: TCP 21 | -------------------------------------------------------------------------------- /5-3-kaurd-pod-resreq.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | spec: 6 | containers: 7 | - image: gcr.io/kuar-demo/kuard-amd64:blue 8 | name: kuard 9 | resources: 10 | requests: 11 | cpu: "500m" 12 | memory: "128Mi" 13 | ports: 14 | - containerPort: 8080 15 | name: http 16 | protocol: TCP 17 | -------------------------------------------------------------------------------- /5-4-kaurd-pod-reslim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | spec: 6 | containers: 7 | - image: gcr.io/kuar-demo/kuard-amd64:1 8 | name: kuard 9 | resources: 10 | requests: 11 | cpu: "500m" 12 | memory: "128Mi" 13 | limits: 14 | cpu: "1000m" 15 | memory: "256Mi" 16 | ports: 17 | - containerPort: 8080 18 | name: http 19 | protocol: TCP 20 | -------------------------------------------------------------------------------- /5-5-kuard-pod-vol.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | spec: 6 | volumes: 7 | - name: "kuard-data" 8 | hostPath: 9 | path: "/var/lib/kuard" 10 | containers: 11 | - image: gcr.io/kuar-demo/kuard-amd64:1 12 | name: kuard 13 | volumeMounts: 14 | - mountPath: "/data" 15 | name: "kuard-data" 16 | ports: 17 | - containerPort: 8080 18 | name: http 19 | protocol: TCP 20 | -------------------------------------------------------------------------------- /5-6-kuard-pod-full.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: kuard 5 | spec: 6 | volumes: 7 | - name: "kuard-data" 8 | nfs: 9 | server: my.nfs.server.local 10 | path: "/exports" 11 | containers: 12 | - image: gcr.io/kuar-demo/kuard-amd64:1 13 | name: kuard 14 | ports: 15 | - containerPort: 8080 16 | name: http 17 | protocol: TCP 18 | resources: 19 | requests: 20 | cpu: "500m" 21 | memory: "128Mi" 22 | limits: 23 | cpu: "1000m" 24 | memory: "256Mi" 25 | volumeMounts: 26 | - mountPath: "/data" 27 | name: "kuard-data" 28 | livenessProbe: 29 | httpGet: 30 | path: /healthy 31 | port: 8080 32 | initialDelaySeconds: 5 33 | timeoutSeconds: 1 34 | periodSeconds: 10 35 | failureThreshold: 3 36 | readinessProbe: 37 | httpGet: 38 | path: /ready 39 | port: 8080 40 | initialDelaySeconds: 30 41 | timeoutSeconds: 1 42 | periodSeconds: 10 43 | failureThreshold: 3 44 | -------------------------------------------------------------------------------- /8-1-simple-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: simple-ingress 5 | spec: 6 | defaultBackend: 7 | service: 8 | name: alpaca 9 | port: 10 | number: 8080 11 | -------------------------------------------------------------------------------- /8-2-host-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: host-ingress 5 | spec: 6 | defaultBackend: 7 | service: 8 | name: be-default 9 | port: 10 | number: 8080 11 | rules: 12 | - host: alpaca.example.com 13 | http: 14 | paths: 15 | - pathType: Prefix 16 | path: / 17 | backend: 18 | service: 19 | name: alpaca 20 | port: 21 | number: 8080 22 | -------------------------------------------------------------------------------- /8-3-path-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: path-ingress 5 | spec: 6 | rules: 7 | - host: bandicoot.example.com 8 | http: 9 | paths: 10 | - pathType: Prefix 11 | path: "/" 12 | backend: 13 | service: 14 | name: bandicoot 15 | port: 16 | number: 8080 17 | - pathType: Prefix 18 | path: "/a/" 19 | backend: 20 | service: 21 | name: alpaca 22 | port: 23 | number: 8080 24 | -------------------------------------------------------------------------------- /8-4-tls-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | creationTimestamp: null 5 | name: tls-secret-name 6 | type: kubernetes.io/tls 7 | data: 8 | tls.crt: 9 | tls.key: 10 | -------------------------------------------------------------------------------- /8-5-tls-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: tls-ingress 5 | spec: 6 | tls: 7 | - hosts: 8 | - alpaca.example.com 9 | secretName: tls-secret-name 10 | rules: 11 | - host: alpaca.example.com 12 | http: 13 | paths: 14 | - pathType: Prefix 15 | path: "/" 16 | backend: 17 | service: 18 | name: alpaca 19 | port: 20 | number: 8080 21 | -------------------------------------------------------------------------------- /9-1-kuard-rs.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: ReplicaSet 3 | metadata: 4 | labels: 5 | app: kuard 6 | version: "2" 7 | name: kuard 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: kuard 13 | version: "2" 14 | template: 15 | metadata: 16 | labels: 17 | app: kuard 18 | version: "2" 19 | spec: 20 | containers: 21 | - name: kuard 22 | image: "gcr.io/kuar-demo/kuard-amd64:green" 23 | resources: 24 | requests: 25 | cpu: "500m" 26 | memory: "128Mi" 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # examples 2 | Example code and files from "Kubernetes: Up and Running" 3 | --------------------------------------------------------------------------------