Skip to content

Commit 1dbd5cf

Browse files
committed
[helm] feat: add helm code.
1 parent 597b98b commit 1dbd5cf

12 files changed

Lines changed: 38 additions & 40 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
2-
name: helm-hello
3-
description: A Helm chart for Kubernetes
2+
name: hello-helm
3+
description: A helm tutorial in https://github.com/guangzhengli/kubernetes_workshop
44

55
# A chart can be either an 'application' or a 'library' chart.
66
#

helm-hello/templates/hellok8s-configmaps.yaml renamed to hello-helm/templates/hellok8s-configmaps.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ kind: ConfigMap
33
metadata:
44
name: hellok8s-config
55
data:
6-
MESSAGE: {{ .Values.hellok8s.message }}
6+
DB_URL: "http://DB_ADDRESS_DEV"
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: hellok8s
4+
name: hellok8s-deployment
55
spec:
6-
replicas: 2
6+
replicas: 3
77
selector:
88
matchLabels:
99
app: hellok8s
@@ -12,16 +12,12 @@ spec:
1212
labels:
1313
app: hellok8s
1414
spec:
15-
volumes:
16-
- name: config
17-
configMap:
18-
name: hellok8s-config
1915
containers:
2016
- image: guangzhengli/hellok8s:v4
2117
name: hellok8s-container
2218
env:
23-
- name: MESSAGE
19+
- name: DB_URL
2420
valueFrom:
2521
configMapKeyRef:
2622
name: hellok8s-config
27-
key: MESSAGE
23+
key: DB_URL
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: service-hellok8s-clusterip
5+
spec:
6+
type: ClusterIP
7+
selector:
8+
app: hellok8s
9+
ports:
10+
- port: 3000
11+
targetPort: 3000
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ spec:
1010
rules:
1111
- http:
1212
paths:
13-
- path: /
13+
- path: /hello
1414
pathType: Prefix
1515
backend:
1616
service:
17-
name: nginx-svc
17+
name: service-hellok8s-clusterip
1818
port:
19-
number: 1234
20-
- path: /hello
19+
number: 3000
20+
- path: /
2121
pathType: Prefix
2222
backend:
2323
service:
24-
name: hellok8s-svc
24+
name: service-nginx-clusterip
2525
port:
26-
number: 4567
26+
number: 4000

helm-hello/templates/nginx-deployment.yaml renamed to hello-helm/templates/nginx-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: nginx
4+
name: nginx-deployment
55
spec:
66
replicas: 2
77
selector:
@@ -13,5 +13,5 @@ spec:
1313
app: nginx
1414
spec:
1515
containers:
16-
- image: nginx
17-
name: nginx-container
16+
- image: nginx
17+
name: nginx-container
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: service-nginx-clusterip
5+
spec:
6+
type: ClusterIP
7+
selector:
8+
app: nginx
9+
ports:
10+
- port: 4000
11+
targetPort: 80

0 commit comments

Comments
 (0)