Skip to content

Commit

Permalink
feat: patches
Browse files Browse the repository at this point in the history
  • Loading branch information
tkurzydym committed Jun 5, 2024
1 parent abbacf1 commit 26c88f8
Show file tree
Hide file tree
Showing 17 changed files with 218 additions and 22 deletions.
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,6 @@ To access them via a Domain Name add those entries to the /etc/hosts file.
127.0.0.1 jaeger.localhost
```

#### NodePorts

If you don't have admin rights or do not want to change the /etc/hosts file, the applications
can be accessed via the exposed NodePorts with the following assigned ports:

```
For Address Validation: http://localhost:30080
For Billing: http://localhost:30081
For Customer: http://localhost:30082
For Delivery: http://localhost:30083
For Prometheus: http://localhost:30090
For Grafana: http://localhost:30030
For Jaeger: http://localhost:30091
```

#### Port-Forwarding

If for whatever reason both options above are not working, you can also use port-forwarding to
Expand Down
3 changes: 2 additions & 1 deletion deployment/base/observability/jaeger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ spec:
type: prometheus
ingress:
enabled: true
ingressClassName: webapprouting.kubernetes.azure.com
ingressClassName: nginx # webapprouting.kubernetes.azure.com
hosts:
- jaeger.localhost
- jaeger.ok-cluster.azure.cloud.openknowledge.services
- jaeger.api-workshop-0.azure.cloud.openknowledge.services
- jaeger.api-workshop-1.azure.cloud.openknowledge.services
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

patches:
# Deployments
- target:
group: apps
version: v1
kind: Deployment
name: address-validation-deployment
path: patches/deployments/address-acr-name-patch.yaml
- target:
group: apps
version: v1
kind: Deployment
name: billing-deployment
path: patches/deployments/billing-acr-name-patch.yaml
- target:
group: apps
version: v1
kind: Deployment
name: customer-deployment
path: patches/deployments/customer-acr-name-patch.yaml
- target:
group: apps
version: v1
kind: Deployment
name: delivery-deployment
path: patches/deployments/delivery-acr-name-patch.yaml
- target:
group: apps
version: v1
kind: Deployment
name: backstage-deployment
path: patches/deployments/backstage-acr-name-patch.yaml
#Ingresses
- target:
group: networking.k8s.io
version: v1
kind: Ingress
name: address-validation-ingress
path: patches/ingresses/address-validation-ingress-patch.yml
- target:
group: networking.k8s.io
version: v1
kind: Ingress
name: backstage-ingress
path: patches/ingresses/backstage-ingress-patch.yml
- target:
group: networking.k8s.io
version: v1
kind: Ingress
name: billing-ingress
path: patches/ingresses/billing-ingress-patch.yml
- target:
group: networking.k8s.io
version: v1
kind: Ingress
name: customer-ingress
path: patches/ingresses/customer-ingress-patch.yml
- target:
group: networking.k8s.io
version: v1
kind: Ingress
name: delivery-ingress
path: patches/ingresses/delivery-ingress-patch.yml
- target:
group: networking.k8s.io
version: v1
kind: Ingress
name: pact-ingress
path: patches/ingresses/pact-ingress-patch.yml


resources:
- ../../base/
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: address-validation-deployment
labels:
app: address-validation-service
spec:
template:
spec:
containers:
- name: address-validation-service
image: docker.host.internal:5000/address-validation:latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: backstage-deployment
labels:
app: backstage
spec:
template:
spec:
containers:
- name: backstage
image: docker.host.internal:5000/backstage:latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: billing-deployment
labels:
app: billing-service
spec:
template:
spec:
containers:
- name: billing-service
image: docker.host.internal:5000/billing:latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: customer-deployment
labels:
app: customer-service
spec:
template:
spec:
containers:
- name: customer-service
image: docker.host.internal:5000/customer:latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: delivery-deployment
labels:
app: delivery-service
spec:
template:
spec:
containers:
- name: delivery-service
image: docker.host.internal:5000/delivery:latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- op: replace
path: /spec/ingressClassName
value: nginx
- op: replace
path: /spec/rules/0/host
value: address-validation.localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- op: replace
path: /spec/ingressClassName
value: nginx
- op: replace
path: /spec/rules/0/host
value: backstage.localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- op: replace
path: /spec/ingressClassName
value: nginx
- op: replace
path: /spec/rules/0/host
value: billing.localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- op: replace
path: /spec/ingressClassName
value: nginx
- op: replace
path: /spec/rules/0/host
value: customer.localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- op: replace
path: /spec/ingressClassName
value: nginx
- op: replace
path: /spec/rules/0/host
value: delivery.localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- op: replace
path: /spec/ingressClassName
value: nginx
- op: replace
path: /spec/rules/0/host
value: pact.localhost
21 changes: 21 additions & 0 deletions ingress-nginx-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
controller:
updateStrategy:
type: "RollingUpdate"
rollingUpdate:
maxUnavailable: 1
hostPort:
enabled: true
terminationGracePeriodSeconds: 0
service:
type: "NodePort"
watchIngressWithoutClass: true
nodeSelector:
ingress-ready: "true"
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Equal"
effect: "NoSchedule"
publishService:
enabled: false
extraArgs:
publish-status-address: "localhost"
4 changes: 3 additions & 1 deletion kube-prometheus-stack-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ prometheus:
enabled: true
ingressClassName: webapprouting.kubernetes.azure.com
hosts:
- prometheus.localhost
- prometheus.ok-cluster.azure.cloud.openknowledge.services
- prometheus.api-workshop-0.azure.cloud.openknowledge.services
- prometheus.api-workshop-1.azure.cloud.openknowledge.services
Expand All @@ -25,8 +26,9 @@ grafana:
adminPassword: admin
ingress:
enabled: true
ingressClassName: webapprouting.kubernetes.azure.com
ingressClassName: nginx # webapprouting.kubernetes.azure.com
hosts:
- grafana.localhost
- grafana.ok-cluster.azure.cloud.openknowledge.services
- grafana.api-workshop-0.azure.cloud.openknowledge.services
- grafana.api-workshop-1.azure.cloud.openknowledge.services
Expand Down
25 changes: 20 additions & 5 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ metadata:
name: workshop-service-management
build:
artifacts:
- image: workshopapimanagementacrapidesigncamp.azurecr.io/address-validation
- image: docker.host.internal:5000/address-validation
context: address-validation-service
docker:
dockerfile: Dockerfile
- image: workshopapimanagementacrapidesigncamp.azurecr.io/billing
- image: docker.host.internal:5000/billing
context: billing-service
docker:
dockerfile: Dockerfile
- image: workshopapimanagementacrapidesigncamp.azurecr.io/customer
- image: docker.host.internal:5000/customer
context: customer-service
docker:
dockerfile: Dockerfile
- image: workshopapimanagementacrapidesigncamp.azurecr.io/delivery
- image: docker.host.internal:5000/delivery
context: delivery-service
docker:
dockerfile: Dockerfile
- image: workshopapimanagementacrapidesigncamp.azurecr.io/backstage
- image: docker.host.internal:5000/backstage
context: backstage
docker:
dockerfile: Dockerfile
Expand All @@ -35,45 +35,52 @@ deploy:
- name: kube-prometheus-stack
repo: https://prometheus-community.github.io/helm-charts
remoteChart: kube-prometheus-stack
version: 58.7.2
namespace: observability
createNamespace: true
valuesFiles:
- ./kube-prometheus-stack-values.yaml
- name: cert-manager
repo: https://charts.jetstack.io
remoteChart: cert-manager
version: 1.14.5
namespace: cert-manager
createNamespace: true
setValues:
installCRDs: true
- name: jaeger-operator
repo: https://jaegertracing.github.io/helm-charts
remoteChart: jaeger-operator
version: 2.53.0
namespace: observability
createNamespace: true
- name: opentelemetry-operator
repo: https://open-telemetry.github.io/opentelemetry-helm-charts
remoteChart: opentelemetry-operator
version: 0.60.0
namespace: observability
createNamespace: true
valuesFiles:
- ./otel-operator-values.yaml
- name: loki
repo: https://grafana.github.io/helm-charts
remoteChart: loki
version: 6.6.1
namespace: observability
createNamespace: true
valuesFiles:
- ./loki-values.yaml
- name: promtail
repo: https://grafana.github.io/helm-charts
remoteChart: promtail
version: 6.15.5
namespace: observability
createNamespace: true
valuesFiles:
- ./promtail-values.yaml
statusCheckDeadlineSeconds: 300
tolerateFailuresUntilDeadline: true

kubectl: {}

manifests:
Expand All @@ -82,6 +89,14 @@ manifests:
- deployment/base

profiles:
- name: local-kind-cluster
activation:
- kubeContext: kind-workshop-service-mngmt-cluster-2
patches:
- op: replace
path: /manifests/kustomize/paths
value:
- deployment/local-kind-cluster/workshop-service-mngmt-cluster
- name: adc-1
activation:
- kubeContext: workshop-cluster-apidesigncamp-1
Expand Down

0 comments on commit 26c88f8

Please sign in to comment.