Last active
July 26, 2024 08:56
-
-
Save eecsmap/f8e0012b5578dd5de60b4d7f30d2af15 to your computer and use it in GitHub Desktop.
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
# 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