Created
September 16, 2018 17:58
-
-
Save iamlittle/b9512f97824188fa98eb34331efb03d0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: httpdconf | |
data: | |
index1-html: <html><body><h1>This is server 1</h1></body></html> | |
index2-html: <html><body><h1>This is server 2</h1></body></html> | |
index3-html: <html><body><h1>This is server 3</h1></body></html> | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: apache | |
spec: | |
ports: | |
- port: 8080 | |
targetPort: 80 | |
protocol: TCP | |
name: primary | |
selector: | |
app: apache | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: bash | |
spec: | |
containers: | |
- name: bash | |
image: bash | |
command: ['sleep', '3600'] | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: apache1 | |
labels: | |
app: apache | |
spec: | |
containers: | |
- name: apache | |
image: httpd | |
ports: | |
- containerPort: 80 | |
volumeMounts: | |
- name: httpdconf | |
mountPath: /usr/local/apache2/htdocs | |
volumes: | |
- name: httpdconf | |
configMap: | |
name: httpdconf | |
items: | |
- key: index1-html | |
path: index.html | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: apache2 | |
labels: | |
app: apache | |
spec: | |
containers: | |
- name: apache | |
image: httpd | |
ports: | |
- containerPort: 80 | |
volumeMounts: | |
- name: httpdconf | |
mountPath: /usr/local/apache2/htdocs | |
volumes: | |
- name: httpdconf | |
configMap: | |
name: httpdconf | |
items: | |
- key: index2-html | |
path: index.html | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: apache3 | |
labels: | |
app: apache | |
spec: | |
containers: | |
- name: apache | |
image: httpd | |
ports: | |
- containerPort: 80 | |
volumeMounts: | |
- name: httpdconf | |
mountPath: /usr/local/apache2/htdocs | |
volumes: | |
- name: httpdconf | |
configMap: | |
name: httpdconf | |
items: | |
- key: index3-html | |
path: index.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment