Install Litmus ChaosCenter with Ingress
#
PrerequisitesBefore setting up endpoint with Ingress make sure the Litmus ChaosCenter is installed in either one of these scopes
#
Install ChaosCenter with IngressWith Litmus-2.0.0, ChaosCenter can be installed with ingress. In the following doc, we will use the Nginx ingress controller for ingress setup.
- By default, the service type is
NodePort
. For Ingress, we need to change the service type toClusterIP
in the following services.
litmusportal-frontend-service
litmusportal-server-service
- Install Nginx Ingress Controller along with Kubernetes RBAC roles and bindings, please refer here
- Set the environment variable INGRESS as true in the litmusportal-server deployment.
Example:
kubectl set env deployment/litmusportal-server -n litmus --containers="graphql-server" INGRESS="true"
- If you're changing ingress name from litmus-ingress to a different name, make sure to update the INGRESS_NAME environment variable in the litmusportal-server deployment
Example:
kubectl set env deployment/litmusportal-server -n litmus --containers="graphql-server" INGRESS_NAME="litmus-ingress"
#
With HTTPSample litmus ingress manifest With HTTP
apiVersion: extensions/v1beta1kind: Ingressmetadata: annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: /$1 name: litmus-ingressspec: rules: - host: '<HOST-NAME>' http: paths: - backend: serviceName: litmusportal-frontend-service servicePort: 9091 path: /(.*) pathType: ImplementationSpecific - backend: serviceName: litmusportal-server-service servicePort: 9002 path: /backend/(.*) pathType: ImplementationSpecific
kubectl apply -f <litmus_ingress_manifest> -n <PORTAL_NAMESPACE>
#
With HTTPS- Install CertManager
kubectl create namespace cert-managerhelm repo add jetstack https://charts.jetstack.iohelm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.3.0 --set installCRDs=true
- Install LetsEncrypt Cluster Issuer
apiVersion: cert-manager.io/v1alpha2kind: ClusterIssuermetadata: name: letsencryptspec: acme: server: https://acme-v02.api.letsencrypt.org/directory email: "your@mail.com" privateKeySecretRef: name: letsencrypt solvers: - http01: ingress: class: nginx
- Sample Litmus Portal Ingress Manifest with HTTPS
apiVersion: extensions/v1beta1kind: Ingressmetadata: annotations: cert-manager.io/cluster-issuer: letsencrypt kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: /$1 labels: component: litmusportal-frontend name: litmusportal-ingress namespace: litmusspec: rules: - host: '<HOST-NAME>' http: paths: - backend: serviceName: litmusportal-frontend-service servicePort: 9091 path: /(.*) pathType: ImplementationSpecific - backend: serviceName: litmusportal-server-service servicePort: 9002 path: /backend/(.*) pathType: ImplementationSpecific tls: - hosts: - '<HOST-NAME>' secretName: litmuspreview-tls-secret
kubectl apply -f <litmus_ingress_manifest> -n <PORTAL_NAMESPACE>