Last active
August 15, 2022 13:26
-
-
Save prtha112/b957fb5e89f9df26e2227418a7634c41 to your computer and use it in GitHub Desktop.
sample-app-kub
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
--- | |
apiVersion: apps/v1 | |
kind: Deployment # Type of Kubernetes resource | |
metadata: | |
name: sample-app # Name of the Kubernetes resource | |
spec: | |
replicas: 3 # Number of pods to run at any given time | |
strategy: | |
rollingUpdate: | |
maxSurge: 25% | |
maxUnavailable: 25% | |
type: RollingUpdate | |
selector: | |
matchLabels: | |
app: sample-app # This deployment applies to any Pods matching the specified label | |
template: # This deployment will create a set of pods using the configurations in this template | |
metadata: | |
labels: # The labels that will be applied to all of the pods in this deployment | |
app: sample-app | |
spec: # Spec for the container which will run in the Pod | |
containers: | |
- name: sample-app | |
image: gcr.io/google-samples/node-hello:1.0 | |
imagePullPolicy: IfNotPresent | |
ports: | |
- containerPort: 8080 # Should match the port number that the Go application listens on | |
--- | |
apiVersion: v1 | |
kind: Service # Type of kubernetes resource | |
metadata: | |
name: sample-app # Name of the resource | |
spec: | |
type: NodePort | |
ports: # Take incoming HTTP requests on port 9090 and forward them to the targetPort of 8080 | |
- name: http | |
protocol: TCP | |
port: 80 | |
targetPort: 8080 | |
selector: | |
app: sample-app | |
--- | |
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
name: sample-app | |
spec: | |
defaultBackend: | |
service: | |
name: sample-app | |
port: | |
number: 80 |
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
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: sample-app | |
spec: | |
replicas: 3 | |
strategy: | |
rollingUpdate: | |
maxSurge: 25% | |
maxUnavailable: 25% | |
type: RollingUpdate | |
selector: | |
matchLabels: | |
app: sample-app | |
template: | |
metadata: | |
labels: | |
app: sample-app | |
spec: | |
containers: | |
- name: sample-app | |
image: gcr.io/google-samples/node-hello:1.0 | |
imagePullPolicy: IfNotPresent | |
ports: | |
- containerPort: 8080 |
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
--- | |
apiVersion: networking.k8s.io/v1 | |
kind: Ingress | |
metadata: | |
name: sample-app | |
spec: | |
defaultBackend: | |
service: | |
name: sample-app | |
port: | |
number: 80 |
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
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: sample-app | |
spec: | |
type: NodePort | |
ports: | |
- name: http | |
protocol: TCP | |
port: 80 | |
targetPort: 8080 | |
selector: | |
app: sample-app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment