File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Dockerfile
2+ FROM golang:1.16-buster AS builder
3+ RUN mkdir /src
4+ ADD . /src
5+ WORKDIR /src
6+
7+ RUN go env -w GO111MODULE=auto
8+ RUN go build -o main .
9+
10+ FROM gcr.io/distroless/base-debian10
11+
12+ WORKDIR /
13+
14+ COPY --from=builder /src/main /main
15+ EXPOSE 3000
16+ ENTRYPOINT ["/main" ]
Original file line number Diff line number Diff line change 11apiVersion : v1
22kind : ConfigMap
33metadata :
4- name : hellok8s -config
4+ name : {{ .Values.application.name }} -config
55data :
6- DB_URL : " http://DB_ADDRESS_DEV "
6+ DB_URL : {{ .Values.application.hellok8s.database.url }}
Original file line number Diff line number Diff line change 11apiVersion : apps/v1
22kind : Deployment
33metadata :
4- name : hellok8s -deployment
4+ name : {{ .Values.application.name }} -deployment
55spec :
6- replicas : 3
6+ replicas : {{ .Values.application.hellok8s.replicas }}
77 selector :
88 matchLabels :
99 app : hellok8s
@@ -13,11 +13,20 @@ spec:
1313 app : hellok8s
1414 spec :
1515 containers :
16- - image : guangzhengli/ hellok8s:v4
16+ - image : {{ .Values.application. hellok8s.image }}
1717 name : hellok8s-container
1818 env :
1919 - name : DB_URL
2020 valueFrom :
2121 configMapKeyRef :
22- name : hellok8s-config
23- key : DB_URL
22+ name : {{ .Values.application.name }}-config
23+ key : DB_URL
24+ - name : DB_PASSWORD
25+ valueFrom :
26+ secretKeyRef :
27+ name : {{ .Values.application.name }}-secret
28+ key : DB_PASSWORD
29+ - name : NAMESPACE
30+ value : {{ .Release.Namespace }}
31+ - name : MESSAGE
32+ value : {{ .Values.application.hellok8s.message }}
Original file line number Diff line number Diff line change 1+ # hellok8s-secret.yaml
2+ apiVersion : v1
3+ kind : Secret
4+ metadata :
5+ name : {{ .Values.application.name }}-secret
6+ data :
7+ DB_PASSWORD : {{ .Values.application.hellok8s.database.password | b64enc }}
Original file line number Diff line number Diff line change 11apiVersion : networking.k8s.io/v1
22kind : Ingress
33metadata :
4- name : hello -ingress
4+ name : {{ .Values.application.name }} -ingress
55 annotations :
66 # We are defining this annotation to prevent nginx
77 # from redirecting requests to `https` for now
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ kind: Deployment
33metadata :
44 name : nginx-deployment
55spec :
6- replicas : 2
6+ replicas : {{ .Values.application.nginx.replicas }}
77 selector :
88 matchLabels :
99 app : nginx
1313 app : nginx
1414 spec :
1515 containers :
16- - image : nginx
16+ - image : {{ .Values.application. nginx.image }}
1717 name : nginx-container
You can’t perform that action at this time.
0 commit comments