Tuesday, November 12, 2019

Azure Deploy Ingress Controller For Micro Fontend

Install helm chart
https://docs.microsoft.com/bs-cyrl-ba/azure/aks/kubernetes-helm

Create a file named helm-rbac.yaml and copy in the following YAML:
apiVersion: v1 kind: ServiceAccount metadata: name: tiller namespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: tiller roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: tiller namespace: kube-system

Create the service account and role binding with the kubectl apply command:
kubectl apply -f helm-rbac.yaml



Configure Helm
helm init --history-max 200 --service-account tiller --node-selectors "beta.kubernetes.io/os=linux"

Create ingress controller
https://docs.microsoft.com/bs-cyrl-ba/azure/aks/ingress-basic

# Create a namespace for your ingress resources kubectl create namespace ingress-basic

# Use Helm to deploy an NGINX ingress controller helm install stable/nginx-ingress \ # --namespace ingress-basic \ --set controller.replicaCount=1 \ --set controller.nodeSelector."beta\.kubernetes\.io/os"=linux \ --set defaultBackend.nodeSelector."beta\.kubernetes\.io/os"=linux

Create an ingress route
Create yaml file devday-ingress.yaml
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: devday-ingress # namespace: ingress-basic annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/ssl-redirect: "false" nginx.ingress.kubernetes.io/rewrite-target: /$1 spec: rules: - http: paths: - backend: serviceName: react-book-summary-tile-service servicePort: 80 path: /react-book-summary-tile/(.*) - backend: serviceName: angular-book-summary-tile-service servicePort: 80 path: /angular-book-summary-tile/(.*) - backend: serviceName: book-library-service servicePort: 80 path: /(.*)

Create the ingress resource using the kubectl apply -f devday-ingress.yaml command.

No comments:

Post a Comment