Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

What are the things needed for Helm Chart deployment using GKE?

Hi there, 

I am working on three tier architecture by IBM and I want to do GKE deployment with GCLB by using Helm Charts from Kubernetes. I have a series of questions:

1-Is it sufficient to not add gclb.yaml and does Charts.yaml, ingress.yaml and values.yaml suffice?

2-If gclb.yaml is needed, can you look at the errors and how they can be solved in this code?

Link: https://github.com/Killpit/three-tier-architecture-demo/blob/master/GKE/helm/gclb.yaml

Code:

```

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ .Release.Name }}-gclb
annotations:
kubernetes.io/ingress.backend: "{{ .Values.service.name }}"
kubernetes.io/ingress.class: gce
spec:
backend:
serviceName: "{{ .Values.service.name }}"
servicePort: {{ .Values.service.port }}
```
 
Errors:
 
Unexpected scalar at node end
bad indentation of a mapping entry
can not read a block mapping entry; a multiline key may not be an implicit key
1 1 361
1 REPLY 1

Hi @tekeliata ,


@tekeliata wrote:

1-Is it sufficient to not add gclb.yaml and does Charts.yaml, ingress.yaml and values.yaml suffice?


First things first, if you want to create a GCLB for your GKE deployment, you need to include the gclb.yamlfile. It is not sufficient to only have Charts.yaml, ingress.yaml, and values.yaml. The gclb.yaml file defines the GCLB configuration for your application, which is necessary to route external traffic to your application running on GKE. The errors you are encountering in the gclb.yaml file can be resolved by fixing the indentation and removing the unexpected scalar at the node end.


@tekeliata wrote:

2-If gclb.yaml is needed, can you look at the errors and how they can be solved in this code?


You can check and try this corrected version of the gclb.yaml file:

apiVersion: networking.gke.io/v1
kind: GlobalForwardingRule
metadata:
name: {{ .Release.Name }}-gclb
spec:
portRange: {{ .Values.port }}
target: "global-forwarding-rule-target"
ipVersion: IPV4

---
apiVersion: networking.gke.io/v1
kind: GlobalForwardingRuleTarget
metadata:
name: global-forwarding-rule-target
spec:
service:
port: {{ .Values.port }}
name: {{ .Values.service.name }}
namespace: {{ .Release.Namespace }}

Let me know if this helps.

 

Top Labels in this Space