Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit 798d4a7

Browse files
authored
Merge pull request #5 from hybrid-cloud-patterns/add-example-chart
Adding http example chart
2 parents ca4a98a + d5be704 commit 798d4a7

File tree

7 files changed

+175
-0
lines changed

7 files changed

+175
-0
lines changed

charts/helm-http-example/Chart.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
description: Http Helm Chart
3+
keywords:
4+
- pattern
5+
name: helm-http-example
6+
version: 0.0.1
7+
maintainers:
8+
- name: claudiol
9+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: configmap-http
5+
namespace: helm-http-example
6+
labels:
7+
app.kubernetes.io/instance: helm-example
8+
data:
9+
"index.html": |-
10+
<!DOCTYPE html>
11+
<html lang="en">
12+
<head>
13+
<meta charset="utf-8">
14+
<title>Config Demo</title>
15+
</head>
16+
<body>
17+
<center>
18+
<h1>
19+
Welcome to the Helm example!<br>
20+
Pod is running on Local Cluster Domain [ {{ .Values.global.localClusterDomain }} ] <br>
21+
</h1>
22+
</center>
23+
</body>
24+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#---
2+
#apiVersion: v1
3+
#kind: PersistentVolumeClaim
4+
#metadata:
5+
# name: httpd-pv-claim
6+
# labels:
7+
# app: httpd-frontend
8+
#spec:
9+
# accessModes:
10+
# - ReadWriteOnce
11+
# resources:
12+
# requests:
13+
# storage: 10Gi
14+
---
15+
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
16+
kind: Deployment
17+
metadata:
18+
name: httpd-frontend
19+
namespace: helm-http-example
20+
labels:
21+
app: httpd-frontend
22+
spec:
23+
replicas: 1
24+
selector:
25+
matchLabels:
26+
app: httpd-frontend
27+
# strategy:
28+
# type: RollingUpdate
29+
# rollingParams:
30+
# updatePeriodSeconds: 1
31+
# intervalSeconds: 1
32+
# timeoutSeconds: 120
33+
# maxSurge: "20%"
34+
# maxUnavailable: "10%"
35+
# pre: {}
36+
# post: {}
37+
template:
38+
metadata:
39+
labels:
40+
app: httpd-frontend
41+
spec:
42+
43+
containers:
44+
- image: registry.redhat.io/rhel8/httpd-24
45+
imagePullPolicy: Always
46+
name: httpd-rhel7
47+
ports:
48+
- containerPort: 8080
49+
name: http-port
50+
- containerPort: 8443
51+
name: https-port
52+
volumeMounts:
53+
- mountPath: /var/www/html
54+
name: configmap-http
55+
livenessProbe:
56+
httpGet:
57+
path: /index.html
58+
port: 8080
59+
scheme: HTTP
60+
initialDelaySeconds: 5
61+
timeoutSeconds: 1
62+
periodSeconds: 10
63+
successThreshold: 1
64+
failureThreshold: 3
65+
readinessProbe:
66+
httpGet:
67+
path: /index.html
68+
port: 8080
69+
scheme: HTTP
70+
initialDelaySeconds: 5
71+
timeoutSeconds: 1
72+
periodSeconds: 10
73+
successThreshold: 1
74+
failureThreshold: 3
75+
securityContext:
76+
allowPrivilegeEscalation: false
77+
runAsNonRoot: true
78+
seccompProfile:
79+
type: "RuntimeDefault"
80+
capabilities:
81+
drop:
82+
- ALL
83+
#### ontainer "httpd-rhel7" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "httpd-rhel7" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "httpd-rhel7" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "httpd-rhel7" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost"
84+
volumes:
85+
- name: configmap-http
86+
configMap:
87+
defaultMode: 438
88+
name: configmap-http
89+
# volumeMounts:
90+
# - name: httpd-persistent-storage
91+
# mountPath: /home/httpd-server
92+
# volumes:
93+
# - name: httpd-persistent-storage
94+
# persistentVolumeClaim:
95+
# claimName: httpd-pv-claim
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: route.openshift.io/v1
3+
kind: Route
4+
metadata:
5+
labels:
6+
app: httpd-frontend
7+
managedFields:
8+
name: http-port
9+
spec:
10+
port:
11+
targetPort: http-port
12+
to:
13+
kind: Service
14+
name: http-port
15+
weight: 100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: http-port
6+
labels:
7+
app: httpd-frontend
8+
spec:
9+
ports:
10+
- port: 8080
11+
name: http-port
12+
protocol: TCP
13+
targetPort: 8080
14+
selector:
15+
app: httpd-frontend
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: https-port
6+
labels:
7+
app: httpd-frontend
8+
spec:
9+
ports:
10+
- port: 8443
11+
name: https-port
12+
protocol: TCP
13+
targetPort: 8443
14+
selector:
15+
app: httpd-frontend

charts/helm-http-example/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
global:
2+
localClusterDomain: blueprints.rhecoeng.com

0 commit comments

Comments
 (0)