Last active
March 30, 2022 12:12
-
-
Save duan-li/6f7f53c43c3d4c6910445abebccf9a6e to your computer and use it in GitHub Desktop.
minikube local dev ingress example
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
# ref https://k8s.io/examples/service/networking/example-ingress.yaml | |
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
name: local-dev-ingress | |
annotations: | |
nginx.ingress.kubernetes.io/rewrite-target: /$1 | |
spec: | |
rules: | |
- host: dev.test | |
http: | |
paths: | |
- path: / | |
pathType: Prefix | |
backend: | |
service: | |
name: web | |
port: | |
number: 8080 |
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
# kubectl create deployment web --image=gcr.io/google-samples/hello-app:1.0 --dry-run=client | |
-o yaml | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
creationTimestamp: null | |
labels: | |
app: web | |
name: web | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: web | |
strategy: {} | |
template: | |
metadata: | |
creationTimestamp: null | |
labels: | |
app: web | |
spec: | |
containers: | |
- image: gcr.io/google-samples/hello-app:1.0 | |
name: hello-app | |
resources: {} | |
status: {} |
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
# kubectl expose deployment web --type=NodePort --port=8080 --dry-run=client -o yaml | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
creationTimestamp: null | |
labels: | |
app: web | |
name: web | |
spec: | |
ports: | |
- port: 8080 | |
protocol: TCP | |
targetPort: 8080 | |
selector: | |
app: web | |
type: NodePort | |
status: | |
loadBalancer: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refs: