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
# Example YAML configuration for the sidecar pattern. | |
# It defines a main application container which writes | |
# the current date to a log file every five seconds. | |
# The sidecar container is nginx serving that log file. | |
# (In practice, your sidecar is likely to be a log collection | |
# container that uploads to external storage.) | |
# To run: |
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
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: apple-app | |
labels: | |
app: apple | |
spec: | |
containers: | |
- name: apple-app | |
image: hashicorp/http-echo |
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
# Create a pod containing the PHP-FPM application (my-php-app) | |
# and nginx, each mounting the `shared-files` volume to their | |
# respective /var/www/html directories. | |
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: phpfpm-nginx-example | |
spec: | |
volumes: |
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
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: pod-using-configmap | |
spec: | |
# Add the ConfigMap as a volume to the Pod | |
volumes: | |
# `name` here must match the name | |
# specified in the volume mount |
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
kind: Deployment | |
apiVersion: extensions/v1beta1 | |
metadata: | |
name: nginx-deployment | |
spec: | |
# A deployment's specification really only | |
# has a few useful options | |
# 1. How many copies of each pod do we want? | |
replicas: 3 |
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
# Example YAML configuration for the adapter pattern. | |
# It defines a main application container which writes | |
# the current date and system usage information to a log file | |
# every five seconds. | |
# The adapter container reads what the application has written and | |
# reformats it into a structure that a hypothetical monitoring | |
# service requires. |
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
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: hostname-service | |
spec: | |
# Expose the service on a static port on each node | |
# so that we can access the service from outside the cluster | |
type: NodePort | |
# When the node receives a request on the static port (30163) |
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
# Note - an NFS server isn't really a Kubernetes | |
# concept. We're just creating it in Kubernetes | |
# for illustration and convenience. In practice, | |
# it might be run in some other system. | |
# Create a service to expose the NFS server | |
# to pods inside the cluster. | |
kind: Service | |
apiVersion: v1 |
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
# Create a pod that reads and writes to the | |
# NFS server via an NFS volume. | |
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: pod-using-nfs | |
spec: | |
# Add the server as an NFS volume for the pod | |
volumes: |
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
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: example-configmap | |
data: | |
# Configuration values can be set as key-value properties | |
database: mongodb | |
database_uri: mongodb://localhost:27017 | |
# Or set as complete file contents (even JSON!) |
NewerOlder