Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Ingress resource to LangKit Helm chart #3

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

AnchorArray
Copy link
Contributor

@AnchorArray AnchorArray commented Jan 23, 2024

Changes

  • Add ingress resource to LangKit helm chart
  • Update documentation for clarity on OCI compliant helm repos vs more traditional repos
  • Added changelog

Testing

Adding ingress-nginx to Azure cluster for testing

helm upgrade --install ingress-nginx ingress-nginx \
  --set 'controller.tolerations[0].key=kubernetes.azure.com/scalesetpriority' \
  --set 'controller.tolerations[0].operator=Exists' \
  --set 'controller.tolerations[0].effect=NoSchedule' \
  --set 'defaultBackend.tolerations[0].key=kubernetes.azure.com/scalesetpriority' \
  --set 'defaultBackend.tolerations[0].operator=Exists' \
  --set 'defaultBackend.tolerations[0].effect=NoSchedule' \
  --set 'controller.admissionWebhooks.patch.tolerations[0].key=kubernetes.azure.com/scalesetpriority' \
  --set 'controller.admissionWebhooks.patch.tolerations[0].operator=Exists' \
  --set 'controller.admissionWebhooks.patch.tolerations[0].effect=NoSchedule' \
  --set 'controller.admissionWebhooks.install.tolerations[0].key=kubernetes.azure.com/scalesetpriority' \
  --set 'controller.admissionWebhooks.install.tolerations[0].operator=Exists' \
  --set 'controller.admissionWebhooks.install.tolerations[0].effect=NoSchedule' \
  --set 'defaultBackend.enabled=true" \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx --create-namespace

# Uninstall
helm uninstall -n ingress-nginx ingress-nginx

Upgrade langkit Helm chart

# Download latest version of the chart
helm pull \
  oci://ghcr.io/whylabs/langkit \
  --version "0.3.0"

# Confirm changes prior to upgrade
helm diff upgrade \
  --set namespace.create=false \
  --set ingress.enabled=true \
  --set ingress.className=nginx \
  --set 'ingress.hosts[0].paths[0].path=/langkit' \
  --set 'ingress.hosts[0].paths[0].pathType=ImplementationSpecific' \
  --set 'ingress.hosts[0].paths[0].backend.service.name=langkit' \
  --set 'ingress.hosts[0].paths[0].backend.service.port.number=80' \
  --namespace langkit \
  langkit langkit-0.3.0.tgz

# Perform the upgrade
helm upgrade --install \
  --set namespace.create=false \
  --set ingress.enabled=true \
  --set ingress.className=nginx \
  --set 'ingress.hosts[0].paths[0].path=/langkit' \
  --set 'ingress.hosts[0].paths[0].pathType=ImplementationSpecific' \
  --set 'ingress.hosts[0].paths[0].backend.service.name=langkit' \
  --set 'ingress.hosts[0].paths[0].backend.service.port.number=80' \
  --namespace langkit \
  langkit langkit-0.3.0.tgz

The langkit helm chart 0.3.0 upgrade produces this ingress resource:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    meta.helm.sh/release-name: langkit
    meta.helm.sh/release-namespace: langkit
  labels:
    app.kubernetes.io/instance: langkit
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: langkit
    app.kubernetes.io/version: 0.0.28
    helm.sh/chart: langkit-0.3.0
  name: langkit
  namespace: langkit
spec:
  ingressClassName: nginx
  rules:
  - http:
      paths:
      - backend:
          service:
            name: langkit
            port:
              number: 80
        path: /langkit
        pathType: ImplementationSpecific
status:
  loadBalancer:
    ingress:
    - ip: 20.29.145.44

Test the Ingress

kubectl port-forward service/ingress-nginx-controller -n ingress-nginx 8080:80 &
curl http://localhost:8080/langkit

Logs from nginx

127.0.0.1 - - [23/Jan/2024:20:55:11 +0000] "GET /langkit HTTP/1.1" 404 22 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" 694 0.002 [langkit-langkit-80] [] 10.224.0.226:8000 22 0.003 404 0e1fa326f3f9efbcf42d27cf89b42257

Logs from langkit

INFO:     10.224.0.105:32786 - "GET /langkit HTTP/1.1" 404 Not Found

@AnchorArray AnchorArray self-assigned this Jan 23, 2024
@AnchorArray AnchorArray requested a review from andyndang January 23, 2024 21:02
@AnchorArray AnchorArray marked this pull request as ready for review January 23, 2024 21:02
Copy link
Contributor

@andyndang andyndang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

@andyndang andyndang merged commit fdc3f53 into mainline Jan 23, 2024
1 check passed
@andyndang andyndang deleted the dev/aberg/add-ingress-resource branch January 23, 2024 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants