Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create game 2048 chart #34

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions charts/game-2048/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
10 changes: 10 additions & 0 deletions charts/game-2048/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
name: game-2048
description: Helm chart for Game 2048
type: application
version: 0.1.0
appVersion: "1.0.0"
maintainers:
- name: devpro
email: bertrand@devpro.fr
home: https://github.com/devpro/helm-charts/tree/main/charts/game-2048
25 changes: 25 additions & 0 deletions charts/game-2048/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Helm chart for game 2048

This Helm chart will install Game 2048 on a Kubernetes cluster.

## Usage

[Helm](https://helm.sh) must be installed to use the chart from the command line. Here is the flow to have the application running in your Kubernetes cluster:

```bash
# adds the repo (if not already done)
helm repo add devpro https://devpro.github.io/helm-charts

# retrieves recent information from added repos
helm repo update

# installs the chart (this command can be ran multiple times)
helm upgrade --install game-2048 devpro/game-2048 --create-namespace --namespace sample-apps
```

Once done, uninstall the chart and clean-up the cluster:

```bash
helm delete game-2048
kubectl delete ns sample-apps
```
Empty file.
Empty file.
31 changes: 31 additions & 0 deletions charts/game-2048/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- $name := $.Values.name -}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $name }}
labels:
app: {{ $name }}
app.kubernetes.io/name: {{ $name }}
spec:
replicas: {{ $.Values.replicaCount }}
selector:
matchLabels:
app: {{ $name }}
app.kubernetes.io/name: {{ $name }}
template:
metadata:
labels:
app: {{ $name }}
app.kubernetes.io/name: {{ $name }}
spec:
containers:
- name: webapp
image: "{{ $.Values.image }}:{{ $.Values.tag }}"
imagePullPolicy: Always
ports:
- name: http
containerPort: 80
resources:
{{- toYaml .Values.resources | nindent 12 }}

32 changes: 32 additions & 0 deletions charts/game-2048/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if $.Values.ingress.enabled -}}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $.Values.name }}-ing
{{- with $.Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if $.Values.ingress.className }}
ingressClassName: {{ $.Values.ingress.className }}
{{- end }}
rules:
- host: {{ $.Values.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $.Values.name }}-svc
port:
number: 80
{{- if $.Values.ingress.tls }}
tls:
- hosts:
- {{ $.Values.ingress.host | quote }}
secretName: {{ $.Values.ingress.tls.secretName }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/game-2048/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- $name := $.Values.name -}}
---
apiVersion: v1
kind: Service
metadata:
name: {{ $name }}-svc
labels:
app: {{ $name }}
app.kubernetes.io/name: {{ $name }}
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 80
selector:
app: {{ $name }}
app.kubernetes.io/name: {{ $name }}
19 changes: 19 additions & 0 deletions charts/game-2048/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: game-2048
image: alexwhen/docker-2048
tag: latest
replicaCount: 1
ingress:
enabled: false
className: "nginx"
host: "game-2048.dummy"
annotations: {}
# cert-manager.io/cluster-issuer: letsencrypt-prod
tls:
secretName: "game-2048-tls"
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 64Mi
Loading