forked from Azure-Samples/aks-store-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Azure-Samples#138 from sabbour/ingress
Adding an Ingress option
- Loading branch information
Showing
1 changed file
with
304 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,304 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: rabbitmq | ||
spec: | ||
serviceName: rabbitmq | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: rabbitmq | ||
template: | ||
metadata: | ||
labels: | ||
app: rabbitmq | ||
spec: | ||
nodeSelector: | ||
"kubernetes.io/os": linux | ||
containers: | ||
- name: rabbitmq | ||
image: mcr.microsoft.com/mirror/docker/library/rabbitmq:3.10-management-alpine | ||
ports: | ||
- containerPort: 5672 | ||
name: rabbitmq-amqp | ||
- containerPort: 15672 | ||
name: rabbitmq-http | ||
env: | ||
- name: RABBITMQ_DEFAULT_USER | ||
value: "username" | ||
- name: RABBITMQ_DEFAULT_PASS | ||
value: "password" | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 128Mi | ||
limits: | ||
cpu: 250m | ||
memory: 256Mi | ||
volumeMounts: | ||
- name: rabbitmq-enabled-plugins | ||
mountPath: /etc/rabbitmq/enabled_plugins | ||
subPath: enabled_plugins | ||
volumes: | ||
- name: rabbitmq-enabled-plugins | ||
configMap: | ||
name: rabbitmq-enabled-plugins | ||
items: | ||
- key: rabbitmq_enabled_plugins | ||
path: enabled_plugins | ||
--- | ||
apiVersion: v1 | ||
data: | ||
rabbitmq_enabled_plugins: | | ||
[rabbitmq_management,rabbitmq_prometheus,rabbitmq_amqp1_0]. | ||
kind: ConfigMap | ||
metadata: | ||
name: rabbitmq-enabled-plugins | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: rabbitmq | ||
spec: | ||
selector: | ||
app: rabbitmq | ||
ports: | ||
- name: rabbitmq-amqp | ||
port: 5672 | ||
targetPort: 5672 | ||
- name: rabbitmq-http | ||
port: 15672 | ||
targetPort: 15672 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: order-service | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: order-service | ||
template: | ||
metadata: | ||
labels: | ||
app: order-service | ||
spec: | ||
nodeSelector: | ||
"kubernetes.io/os": linux | ||
containers: | ||
- name: order-service | ||
image: ghcr.io/azure-samples/aks-store-demo/order-service:latest | ||
ports: | ||
- containerPort: 3000 | ||
env: | ||
- name: ORDER_QUEUE_HOSTNAME | ||
value: "rabbitmq" | ||
- name: ORDER_QUEUE_PORT | ||
value: "5672" | ||
- name: ORDER_QUEUE_USERNAME | ||
value: "username" | ||
- name: ORDER_QUEUE_PASSWORD | ||
value: "password" | ||
- name: ORDER_QUEUE_NAME | ||
value: "orders" | ||
- name: FASTIFY_ADDRESS | ||
value: "0.0.0.0" | ||
resources: | ||
requests: | ||
cpu: 1m | ||
memory: 50Mi | ||
limits: | ||
cpu: 75m | ||
memory: 128Mi | ||
startupProbe: | ||
httpGet: | ||
path: /health | ||
port: 3000 | ||
failureThreshold: 3 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 5 | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: 3000 | ||
failureThreshold: 3 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 5 | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: 3000 | ||
failureThreshold: 5 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 3 | ||
initContainers: | ||
- name: wait-for-rabbitmq | ||
image: busybox | ||
command: ['sh', '-c', 'until nc -zv rabbitmq 5672; do echo waiting for rabbitmq; sleep 2; done;'] | ||
resources: | ||
requests: | ||
cpu: 1m | ||
memory: 50Mi | ||
limits: | ||
cpu: 75m | ||
memory: 128Mi | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: order-service | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: http | ||
port: 3000 | ||
targetPort: 3000 | ||
selector: | ||
app: order-service | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: product-service | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: product-service | ||
template: | ||
metadata: | ||
labels: | ||
app: product-service | ||
spec: | ||
nodeSelector: | ||
"kubernetes.io/os": linux | ||
containers: | ||
- name: product-service | ||
image: ghcr.io/azure-samples/aks-store-demo/product-service:latest | ||
ports: | ||
- containerPort: 3002 | ||
env: | ||
- name: AI_SERVICE_URL | ||
value: "http://ai-service:5001/" | ||
resources: | ||
requests: | ||
cpu: 1m | ||
memory: 1Mi | ||
limits: | ||
cpu: 2m | ||
memory: 10Mi | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: 3002 | ||
failureThreshold: 3 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 5 | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: 3002 | ||
failureThreshold: 5 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 3 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: product-service | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- name: http | ||
port: 3002 | ||
targetPort: 3002 | ||
selector: | ||
app: product-service | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: store-front | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: store-front | ||
template: | ||
metadata: | ||
labels: | ||
app: store-front | ||
spec: | ||
nodeSelector: | ||
"kubernetes.io/os": linux | ||
containers: | ||
- name: store-front | ||
image: ghcr.io/azure-samples/aks-store-demo/store-front:latest | ||
ports: | ||
- containerPort: 8080 | ||
name: store-front | ||
env: | ||
- name: VUE_APP_ORDER_SERVICE_URL | ||
value: "http://order-service:3000/" | ||
- name: VUE_APP_PRODUCT_SERVICE_URL | ||
value: "http://product-service:3002/" | ||
resources: | ||
requests: | ||
cpu: 1m | ||
memory: 200Mi | ||
limits: | ||
cpu: 1000m | ||
memory: 512Mi | ||
startupProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
failureThreshold: 3 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
failureThreshold: 3 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 3 | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
failureThreshold: 5 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 3 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: store-front | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
selector: | ||
app: store-front | ||
type: ClusterIP | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: store-front | ||
spec: | ||
ingressClassName: webapprouting.kubernetes.azure.com | ||
rules: | ||
- http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: store-front | ||
port: | ||
number: 80 | ||
|