Created
July 21, 2022 13:58
-
-
Save RbkGh/862f536a7278f3d78ef570c555ce726e to your computer and use it in GitHub Desktop.
k8s deployment sample yaml file and ingress deployment
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: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: billable-api-server-backend-ingress | |
annotations: | |
kubernetes.io/ingress.class: "nginx" | |
# nginx.ingress.kubernetes.io/use-regex: "true" | |
nginx.ingress.kubernetes.io/ssl-redirect: "false" | |
nginx.ingress.kubernetes.io/force-ssl-redirect: "false" | |
kubernetes.io/ingress.global-static-ip-name: "billable-api-public-ip-ca" | |
#static ip name when using in gke | |
spec: | |
# tls: | |
# - secretName: tls-secret | |
rules: | |
- http: | |
paths: | |
- backend: | |
serviceName: billable-web-frontend-service | |
servicePort: 8888 | |
path: / | |
- backend: | |
serviceName: billable-api-server-backend-service | |
servicePort: 8080 | |
path: /billablehours-api |
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: billable-api-server-backend-deployment | |
labels: | |
app: billable-api-server-backend | |
spec: | |
replicas: 3 | |
# strategy: | |
# type: RollingUpdate | |
# rollingUpdate: | |
# maxSurge: 1 | |
# maxUnavailable: 25% | |
selector: | |
matchLabels: | |
app: billable-api-server-backend | |
template: | |
metadata: | |
labels: | |
app: billable-api-server-backend | |
tier: backend | |
spec: | |
terminationGracePeriodSeconds: 31 | |
containers: | |
- name: billable-api-server-backend | |
image: dockerrodneykb2/billable-api-server-backend:latest | |
imagePullPolicy: Always | |
ports: | |
- containerPort: 8080 | |
imagePullSecrets: | |
- name: billable-api-server-backend-docker-credentials | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: billable-api-server-backend-service | |
spec: | |
ports: | |
- port: 8080 | |
targetPort: 8080 | |
selector: | |
app: billable-api-server-backend | |
tier: backend | |
type: LoadBalancer | |
# use type NodePort when configuring with GKE,you can use ClusterIP with AWSKubernetes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
deployment k8s file and accompanying ingress sample