Skip to content

Commit

Permalink
Add kruise game 0.8 (#103)
Browse files Browse the repository at this point in the history
* copy from kruise-game v0.7.0 and add v0.8.0

* modify kruise-game v0.8.0

---------

Co-authored-by: 李志朋 <lizhipeng.629@bytedance.com>
  • Loading branch information
lizhipeng629 and 李志朋 committed Apr 28, 2024
1 parent 73f28b5 commit 5011dcc
Show file tree
Hide file tree
Showing 15 changed files with 2,594 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kruise-game
23 changes: 23 additions & 0 deletions versions/kruise-game/0.8/.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/
11 changes: 11 additions & 0 deletions versions/kruise-game/0.8/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
name: kruise-game
description: Helm chart for kruise-game components
version: 0.8.0
appVersion: 0.8.0
kubeVersion: ">= 1.16.0-0"
sources:
- https://github.com/openkruise/kruise-game
annotations:
artifacthub.io/changes: |
- "[Changed]: https://github.com/openkruise/kruise-game/blob/master/CHANGELOG.md"
45 changes: 45 additions & 0 deletions versions/kruise-game/0.8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Kruise Game v0.8.0

## Configuration

The following table lists the configurable parameters of the kruise-game chart and their default values.

| Parameter | Description | Default |
|----------------------------------|-----------------------------------------------------------------------------|----------------------------------|
| `installation.namespace` | Namespace for kruise-game operation installation | `kruise-game-system` |
| `installation.createNamespace` | Whether to create the installation.namespace | `true` |
| `kruiseGame.fullname` | Nick name for kruise-game deployment and other configurations | `kruise-game-controller-manager` |
| `kruiseGame.healthBindPort` | Port for checking health of kruise-game container | `8082` |
| `kruiseGame.webhook.port` | Port of webhook served by kruise-game container | `443` |
| `kruiseGame.webhook.targetPort` | ObjectSelector for workloads in MutatingWebhookConfigurations | `9876` |
| `kruiseGame.apiServerQps` | Indicates the maximum QPS to the master from kruise-game-controller-manager | `5` |
| `kruiseGame.apiServerQpsBurst` | Maximum burst for throttle of kruise-game-controller-manager | `10` |
| `replicaCount` | Replicas of kruise-game deployment | `1` |
| `image.repository` | Repository for kruise-game image | `openkruise/kruise-game-manager` |
| `image.tag` | Tag for kruise-game image | `v0.8.0` |
| `image.pullPolicy` | ImagePullPolicy for kruise-game container | `Always` |
| `serviceAccount.annotations` | The annotations for serviceAccount of kruise-game | ` ` |
| `service.port` | Port of kruise-game service | `8443` |
| `resources.limits.cpu` | CPU resource limit of kruise-game container | `500m` |
| `resources.limits.memory` | Memory resource limit of kruise-game container | `1Gi` |
| `resources.requests.cpu` | CPU resource request of kruise-game container | `10m` |
| `resources.requests.memory` | Memory resource request of kruise-game container | `64Mi` |
| `prometheus.enabled` | Whether to bind metric endpoint | `true` |
| `prometheus.monitorService.port` | Port of the monitorservice bind to | `8080` |
| `scale.service.port` | Port of the external scaler server binds to | `6000` |
| `scale.service.targetPort` | TargetPort of the external scaler server binds to | `6000` |
| `network.totalWaitTime` | Maximum time to wait for network ready, the unit is seconds | `60` |
| `network.probeIntervalTime` | Time interval for detecting network status, the unit is seconds | `5` |
| `cloudProvider.installCRD` | Whether to install CloudProvider CRD | `true` |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

### Optional: the local image for China

If you are in China and have problem to pull image from official DockerHub, you can use the registry hosted on Alibaba Cloud:

```bash
$ helm install kruise-game https://... --set image.repository=registry.cn-hangzhou.aliyuncs.com/acs/kruise-game-manager
...
```
62 changes: 62 additions & 0 deletions versions/kruise-game/0.8/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "kruise-game.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "kruise-game.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "kruise-game.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "kruise-game.labels" -}}
helm.sh/chart: {{ include "kruise-game.chart" . }}
{{ include "kruise-game.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "kruise-game.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kruise-game.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "kruise-game.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "kruise-game.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
99 changes: 99 additions & 0 deletions versions/kruise-game/0.8/templates/alibabacloud.com_poddnats.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{{- if .Values.cloudProvider.installCRD }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: poddnats.alibabacloud.com
spec:
group: alibabacloud.com
names:
kind: PodDNAT
listKind: PodDNATList
plural: poddnats
singular: poddnat
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: PodDNAT is the Schema for the poddnats API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: PodDNATSpec defines the desired state of PodDNAT
properties:
eni:
type: string
entryId:
type: string
externalIP:
type: string
externalPort:
type: string
internalIP:
type: string
internalPort:
type: string
portMapping:
items:
properties:
externalPort:
type: string
internalPort:
type: string
type: object
type: array
protocol:
type: string
tableId:
type: string
vswitch:
type: string
zoneID:
type: string
type: object
status:
description: PodDNATStatus defines the observed state of PodDNAT
properties:
created:
description: created create status
type: string
entries:
description: entries
items:
description: Entry record for forwardEntry
properties:
externalIP:
type: string
externalPort:
type: string
forwardEntryId:
type: string
internalIP:
type: string
internalPort:
type: string
ipProtocol:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
{{- end }}
51 changes: 51 additions & 0 deletions versions/kruise-game/0.8/templates/controller_manager_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: kruise-game-manager-config
namespace: {{ .Values.installation.namespace }}
data:
config.toml: |
[kubernetes]
enable = true
[kubernetes.hostPort]
max_port = 9000
min_port = 8000
[alibabacloud]
enable = true
[alibabacloud.slb]
max_port = 700
min_port = 500
[alibabacloud.nlb]
max_port = 1500
min_port = 1000
[volcengine]
enable = true
[volcengine.clb]
max_port = 700
min_port = 500
controller_manager_config.yaml: |
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
kind: ControllerManagerConfig
health:
healthProbeBindAddress: :8081
metrics:
bindAddress: 127.0.0.1:8080
webhook:
port: 9443
leaderElection:
leaderElect: true
resourceName: c637bb1e.my.domain
# leaderElectionReleaseOnCancel defines if the leader should step down volume
# when the Manager ends. This requires the binary to immediately end when the
# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
# speeds up voluntary leader transitions as the new leader don't have to wait
# LeaseDuration time first.
# In the default scaffold provided, the program ends immediately after
# the manager stops, so would be fine to enable this option. However,
# if you are doing or is intended to do any operation such as perform cleanups
# after the manager stops then its usage might be unsafe.
# leaderElectionReleaseOnCancel: true


Loading

0 comments on commit 5011dcc

Please sign in to comment.