Hey For this deploy:kind: Buildtype: containernam...
# 🤖|ask-kapa
m
Please stand by @swift-spring-8620 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
---------------------- Based on the information provided in the extracts, it seems like you are correctly passing the annotations in the
ingresses
section of your configuration. The annotations should be an object and are not required by default. Here is an example from the Garden documentation ():
Copy code
yaml
services:
- ingresses:
  - path: /api
    port: http
  - annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: '0'
However, the error message you're seeing suggests that the issue might be with the
port
key in the
ingresses
section. The error message states that
.ingresses[1][port]
is required, which suggests that the
port
key is missing from the second ingress in your configuration. Please ensure that each ingress in your configuration includes a
port
key. For example:
Copy code
yaml
ingresses:
- path: /?(.*)
  hostname: ${var.baseHostname}
  port: http
If you continue to experience issues, it might be helpful to review the Garden documentation () or open an issue on the Garden GitHub page (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
Let me check the knowledge base for you. One moment! :books:
s
@microscopic-river-74022 Could you suggest how can I install this helm chart using garden io correctly? Add the ngrok Ingress Controller Helm chart: helm repo add ngrok https://ngrok.github.io/kubernetes-ingress-controller Then, install the latest version (setting the appropriate values for your environment): export NAMESPACE=[YOUR_K8S_NAMESPACE] export NGROK_AUTHTOKEN=[AUTHTOKEN] export NGROK_API_KEY=[API_KEY] helm install ngrok-ingress-controller ngrok/kubernetes-ingress-controller \ --namespace $NAMESPACE \ --create-namespace \ --set credentials.apiKey=$NGROK_API_KEY \ --set credentials.authtoken=$NGROK_AUTHTOKEN
m
---------------------- Based on the information provided in the extracts, you can install a Helm chart using Garden by defining a
Deploy
action in your Garden configuration. Here's an example of how you might do this:
Copy code
yaml
kind: Deploy
name: ngrok-ingress-controller
description: Install ngrok ingress controller helm chart
type: helm
spec:
  chart:
    name: ngrok/kubernetes-ingress-controller
    version: [VERSION] # specify the version you want to install
    repo: <https://ngrok.github.io/kubernetes-ingress-controller>
  values:
    credentials:
      apiKey: [API_KEY]
      authtoken: [AUTHTOKEN]
Please replace
[VERSION]
,
[API_KEY]
, and
[AUTHTOKEN]
with the appropriate values for your environment. This configuration will tell Garden to install the
ngrok/kubernetes-ingress-controller
Helm chart from the specified repository. The
values
field is used to provide the
apiKey
and
authtoken
required by the chart. Please note that this is a general example and might need to be adjusted based on your specific use case and environment. For more detailed information, please refer to the Garden documentation (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
s
@microscopic-river-74022 if i wanted to convert this manifest and make it useable in garden, how would i do so? apiVersion: v1 kind: Service metadata: name: game-2048 namespace: ngrok-ingress-controller spec: ports: - name: http port: 80 targetPort: 80 selector: app: game-2048 --- apiVersion: apps/v1 kind: Deployment metadata: name: game-2048 namespace: ngrok-ingress-controller spec: replicas: 1 selector: matchLabels: app: game-2048 template: metadata: labels: app: game-2048 spec: containers: - name: backend image: alexwhen/docker-2048 ports: - name: http containerPort: 80 --- # ngrok Ingress Controller Configuration apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: game-2048-ingress namespace: ngrok-ingress-controller spec: ingressClassName: ngrok rules: - host: NGROK_DOMAIN http: paths: - path: / pathType: Prefix backend: service: name: game-2048 port: number: 80
m
Let me check the knowledge base for you. One moment! :books:
---------------------- To use this Kubernetes manifest in Garden, you would need to create a
garden.yml
configuration file and specify the manifests as part of the configuration. Here's an example of how you might do this:
Copy code
yaml
kind: Module
type: kubernetes
name: game-2048
manifests:
- apiVersion: v1
  kind: Service
  metadata:
    name: game-2048
    namespace: ngrok-ingress-controller
  spec:
    ports:
      - name: http
        port: 80
        targetPort: 80
    selector:
      app: game-2048
- apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: game-2048
    namespace: ngrok-ingress-controller
  spec:
    replicas: 1
    selector:
      matchLabels:
        app: game-2048
    template:
      metadata:
        labels:
          app: game-2048
      spec:
        containers:
          - name: backend
            image: alexwhen/docker-2048
            ports:
              - name: http
                containerPort: 80
- apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    name: game-2048-ingress
    namespace: ngrok-ingress-controller
  spec:
    ingressClassName: ngrok
    rules:
      - host: NGROK_DOMAIN
        http:
          paths:
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: game-2048
                  port:
                    number: 80
This configuration tells Garden to apply the specified Kubernetes manifests. Note that you might need to replace
NGROK_DOMAIN
with the actual domain you want to use. For more detailed information, please refer to the Garden documentation (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
s
@microscopic-river-74022 What are the full steps of correctly configuring an external ingress controller in garden?
m
Let me check the knowledge base for you. One moment! :books:
---------------------- Based on the information provided in the extracts, here are the steps to configure an external ingress controller in Garden: 1. **Set up the Ingress Controller**: By default, Garden will not install an ingress controller for remote environments. This can be toggled by setting the
setupIngressController
flag to
nginx
. Alternatively, you can set up your own ingress controller, e.g. using Traefik, Ambassador, or Istio. You can find an example for using Garden with Istio in the examples directory ().
Copy code
yaml
providers:
- name: kubernetes
  setupIngressController: nginx
2. **Configure DNS and TLS**: You'll also need to point one or more DNS entries to your cluster, and configure a TLS certificate for the hostnames you will expose for ingress. Templating the ingress to the application enables you to have DNS entries for every developer's namespace. First, you will make DNS CNAME entry that points to the load balancer in front of your cluster. We recommend setting a wildcard in front of the proper record, e.g. *...com. If you would like to manage TLS for development environments, we recommend using your cloud provider's certificate management service in combination with a load balancer. 3. **Configure the Ingress Class**: If you have multiple ingress controllers in your cluster, you can specify the ingress class or ingressClassName to use on configured Ingresses (via the
kubernetes.io/ingress.class
annotation or
spec.ingressClassName
field depending on the kubernetes version) when deploying
container
services.
Copy code
yaml
providers:
- name: kubernetes
  ingressClass: nginx
4. **Configure the Ingress Ports**: You can also specify the external HTTP and HTTPS ports of the cluster's ingress controller using the
ingressHttpPort
and
ingressHttpsPort
configuration keys.
Copy code
yaml
providers:
- name: kubernetes
  ingressHttpPort: 80
  ingressHttpsPort: 443
Please note that these are general steps and might need to be adjusted based on your specific use case and environment. For more detailed information, please refer to the Garden documentation (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
s
Hey @microscopic-river-74022 how do I bring down the default nginx ingress controller that is running?
m
Let me check the knowledge base for you. One moment! :books:
---------------------- To uninstall the default Nginx Ingress Controller that Garden sets up, you can use the
uninstall-garden-services
command from the Garden Kubernetes plugin. Here's how you can do it:
Copy code
bash
garden plugins kubernetes uninstall-garden-services
This command will uninstall all Garden system services, including the Nginx Ingress Controller. Please note that this will also uninstall other system services like the build sync service, so you should only run this if you're sure you want to remove all Garden system services. For more detailed information, please refer to the Garden troubleshooting documentation (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
s
@microscopic-river-74022 do I need to bring down the default nginx ingress controller when using an external ingress controller?
m
Let me check the knowledge base for you. One moment! :books:
@swift-spring-8620 That's a great question, but unfortunately I am only capable of responding to a maximum of three questions per thread. Don't hesitate to create a new thread for any further questions you have though. I'm here to help!