Skip to content

Instantly share code, notes, and snippets.

@eecsmap
Last active July 26, 2024 08:56
Show Gist options
  • Save eecsmap/f8e0012b5578dd5de60b4d7f30d2af15 to your computer and use it in GitHub Desktop.
Save eecsmap/f8e0012b5578dd5de60b4d7f30d2af15 to your computer and use it in GitHub Desktop.
# kubectl -n orchard apply -f k8s-demo.yaml
# kubectl -n orchard edit configmap k8s-demo
apiVersion: v1
data:
index.html: |
<h1>Hello k8s</h1>
<p>This is a test page...</p>
kind: ConfigMap
metadata:
name: k8s-demo
namespace: orchard
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8s-demo
spec:
replicas: 1
selector:
matchLabels:
app: k8s-demo
template:
metadata:
labels:
app: k8s-demo
spec:
containers:
- name: k8s-demo
image: nginx:latest
volumeMounts:
- mountPath: /usr/share/nginx/html/
name: k8s-demo-volume
volumes:
- name: k8s-demo-volume
configMap:
name: k8s-demo
---
apiVersion: v1
kind: Service
metadata:
annotations:
cloud.google.com/load-balancer-type: Internal
name: k8s-demo
namespace: orchard
spec:
type: LoadBalancer
selector:
app: k8s-demo
ports:
- protocol: TCP
port: 80
targetPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment