Skip to content

Commit

Permalink
Merge pull request #402 from yongchuanzhou/master
Browse files Browse the repository at this point in the history
Add Qingcloud-CSI/Qingcloud-CCM/Qingcloud-CNI Helm Charts.
  • Loading branch information
ks-ci-bot authored Aug 29, 2024
2 parents cc98b48 + 4f18073 commit 9a6acb0
Show file tree
Hide file tree
Showing 31 changed files with 2,475 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/stable/ccm-qingcloud/.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/
12 changes: 12 additions & 0 deletions src/stable/ccm-qingcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
appVersion: 1.4.12
home: https://github.com/yunify/qingcloud-cloud-controller-manager
keywords:
- qingcloud
- ccm
kubeVersion: '>=1.17.0-0'
name: ccm-qingcloud
description: A Helm chart for qingcloud cloud controller manager
sources:
- https://github.com/yunify/qingcloud-cloud-controller-manager
version: 0.1.0
50 changes: 50 additions & 0 deletions src/stable/ccm-qingcloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# ccm-qingcloud

## TL;DR;

```console
helm install stable/ccm-qingcloud
```

## Installing

To install the chart with the release name `my-release`:

```console
helm repo add stable https://charts.kubesphere.io/stable
helm repo update
helm install --name my-release stable/ccm-qingcloud --namespace kube-system
```

The command deploys the standalone ccm-qingcloud chart on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

## Uninstalling

To uninstall/delete the `my-release` deployment:

```console
helm delete ccm-qingcloud --namespace kube-system
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The following table lists the configurable parameters of the ccm-qingcloud chart and their default values.

Parameter | Description | Default
--- | --- | ---
`config.qy_access_key_id` | Access key id of QingCloud |
`config.qy_secret_access_key` | Access secret of QingCloud |
`config.zone` | Zone of QingCloud |
`config.host` | API host of QingCloud | `api.qingcloud.com`
`config.port` | API port of QingCloud | `443`
`config.protocol` | API protocol of QingCloud | `https`
`config.uri` | API URI of QingCloud | `/iaas`
`config.vxnet` | Cluster vxnet of QingCloud |
`config.clusterID` | Cluster ID of QingCloud |
`config.userID` | QingCloud UserId |
`config.clusterTag` | Cluster tag of QingCloud |
`config.image` | Image of CCM | `qingcloud/cloud-controller-manager:v1.4.12`
`config.connection_retries` | Retry count of API | `3`
`config.connection_timeout` | Retry time out of API | `30`
62 changes: 62 additions & 0 deletions src/stable/ccm-qingcloud/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "ccm-qingcloud.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 "ccm-qingcloud.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 "ccm-qingcloud.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "ccm-qingcloud.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "ccm-qingcloud.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
53 changes: 53 additions & 0 deletions src/stable/ccm-qingcloud/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright (C) 2021 Yunify, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the License.
# You may obtain a copy of the License in the LICENSE file, or at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: qingcloud-cloud-controller-manager
owner: yunify
ver: {{ .Chart.AppVersion }}
name: lbconfig
namespace: {{ .Release.Namespace }}
data:
qingcloud.yaml: |
zone: {{ .Values.config.zone }}
defaultVxNetForLB: {{ .Values.config.vxnet }}
clusterID: {{ .Values.config.clusterID }}
userID: {{ .Values.config.userID }}
isApp: true
tagIDs:
- {{ .Values.config.clusterTag }}
---
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: qingcloud-cloud-controller-manager
owner: yunify
ver: {{ .Chart.AppVersion }}
name: ccm-qingcloud
namespace: {{ .Release.Namespace }}
data:
config.yaml: |-
qy_access_key_id: {{ .Values.config.qy_access_key_id }}
qy_secret_access_key: {{ .Values.config.qy_secret_access_key}}
zone: {{ .Values.config.zone }}
host: {{ .Values.config.host }}
port: {{ .Values.config.port }}
protocol: {{ .Values.config.protocol }}
uri: {{ .Values.config.uri }}
connection_retries: {{ .Values.config.connection_retries }}
connection_timeout: {{ .Values.config.connection_timeout }}
171 changes: 171 additions & 0 deletions src/stable/ccm-qingcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: cloud-controller-manager
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
name: system:cloud-controller-manager
rules:
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- update
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- create
- update
- patch
- delete
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- '*'
- apiGroups:
- ""
resources:
- nodes/status
verbs:
- patch
- apiGroups:
- ""
resources:
- services
verbs:
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- services/status
verbs:
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- apiGroups:
- ""
resources:
- endpoints
verbs:
- create
- get
- list
- watch
- update
- apiGroups:
- ""
resources:
- endpoints
verbs:
- create
- get
- list
- watch
- update
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- list
- watch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: system:cloud-controller-manager
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:cloud-controller-manager
subjects:
- kind: ServiceAccount
name: cloud-controller-manager
namespace: {{ .Release.Namespace }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
component: cloud-controller-manager
tier: control-plane
name: cloud-controller-manager
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: yunify-cloud-controller-manager
template:
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
labels:
app: yunify-cloud-controller-manager
spec:
containers:
- command:
- /manager
- -v=3
- --cloud-provider=qingcloud
- --cloud-config=/etc/kubernetes/qingcloud.yaml
image: {{ .Values.config.image }}
imagePullPolicy: IfNotPresent
name: qingcloud-cloud-controller-manager
resources:
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 100m
memory: 50Mi
volumeMounts:
- mountPath: /etc/kubernetes
name: lbconfig
readOnly: true
- mountPath: /etc/qingcloud
name: qingcloud
readOnly: true
serviceAccountName: cloud-controller-manager
tolerations:
- effect: NoSchedule
key: node.cloudprovider.kubernetes.io/uninitialized
value: "true"
- key: CriticalAddonsOnly
operator: Exists
- effect: NoSchedule
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: lbconfig
name: lbconfig
- name: qingcloud
configMap:
name: ccm-qingcloud
Loading

0 comments on commit 9a6acb0

Please sign in to comment.