Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initial version with charts taken from https://charts.opencord.org
  • Loading branch information
lafonj committed Feb 27, 2019
1 parent 2bbdc71 commit c65095b
Show file tree
Hide file tree
Showing 338 changed files with 29,406 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cord-platform/Chart.yaml
@@ -0,0 +1,5 @@
appVersion: 6.1.0
description: A Helm chart to install the CORD platform
icon: https://guide.opencord.org/logos/cord.svg
name: cord-platform
version: 6.1.0
21 changes: 21 additions & 0 deletions cord-platform/charts/etcd-operator/.helmignore
@@ -0,0 +1,21 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
16 changes: 16 additions & 0 deletions cord-platform/charts/etcd-operator/Chart.yaml
@@ -0,0 +1,16 @@
apiVersion: v1
appVersion: 0.9.2
description: CoreOS etcd-operator Helm chart for Kubernetes
home: https://github.com/coreos/etcd-operator
icon: https://raw.githubusercontent.com/coreos/etcd/master/logos/etcd-horizontal-color.png
maintainers:
- email: chance.zibolski@coreos.com
name: chancez
- email: lachlan@deis.com
name: lachie83
- email: jaescobar.cell@gmail.com
name: alejandroEsc
name: etcd-operator
sources:
- https://github.com/coreos/etcd-operator
version: 0.8.0
8 changes: 8 additions & 0 deletions cord-platform/charts/etcd-operator/OWNERS
@@ -0,0 +1,8 @@
approvers:
- lachie83
- chancez
- alejandroEsc
reviewers:
- lachie83
- chancez
- alejandroEsc
158 changes: 158 additions & 0 deletions cord-platform/charts/etcd-operator/README.md
@@ -0,0 +1,158 @@
# CoreOS etcd-operator

[etcd-operator](https://coreos.com/blog/introducing-the-etcd-operator.html) Simplify etcd cluster
configuration and management.

__DISCLAIMER:__ While this chart has been well-tested, the etcd-operator is still currently in beta.
Current project status is available [here](https://github.com/coreos/etcd-operator).

## Introduction

This chart bootstraps an etcd-operator and allows the deployment of etcd-cluster(s).

## Official Documentation

Official project documentation found [here](https://github.com/coreos/etcd-operator)

## Prerequisites

- Kubernetes 1.4+ with Beta APIs enabled
- __Suggested:__ PV provisioner support in the underlying infrastructure to support backups

## Installing the Chart

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

```bash
$ helm install stable/etcd-operator --name my-release
```

__Note__: If you set `cluster.enabled` on install, it will have no effect.
Before you create an etcd cluster, the TPR must be installed by the operator, so this option is ignored during helm installs, but can be used in upgrades.

## Uninstalling the Chart

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

```bash
$ helm delete my-release
```

The command removes all the Kubernetes components EXCEPT the persistent volume.

## Updating
Updating the TPR resource will not result in the cluster being update until `kubectl apply` for
TPRs is fixed see [kubernetes/issues/29542](https://github.com/kubernetes/kubernetes/issues/29542)
Work around options are documented [here](https://github.com/coreos/etcd-operator#resize-an-etcd-cluster)

## Configuration

The following table lists the configurable parameters of the etcd-operator chart and their default values.

| Parameter | Description | Default |
| ------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------- |
| `rbac.create` | install required RBAC service account, roles and rolebindings | `true` |
| `rbac.apiVersion` | RBAC api version `v1alpha1|v1beta1` | `v1beta1` |
| `rbac.etcdOperatorServiceAccountName` | Name of the service account resource when RBAC is enabled | `etcd-operator-sa` |
| `rbac.backupOperatorServiceAccountName` | Name of the service account resource when RBAC is enabled | `etcd-backup-operator-sa` |
| `rbac.restoreOperatorServiceAccountName` | Name of the service account resource when RBAC is enabled | `etcd-restore-operator-sa` |
| `deployments.etcdOperator` | Deploy the etcd cluster operator | `true` |
| `deployments.backupOperator` | Deploy the etcd backup operator | `true` |
| `deployments.restoreOperator` | Deploy the etcd restore operator | `true` |
| `customResources.createEtcdClusterCRD` | Create a custom resource: EtcdCluster | `false` |
| `customResources.createBackupCRD` | Create an a custom resource: EtcdBackup | `false` |
| `customResources.createRestoreCRD` | Create an a custom resource: EtcdRestore | `false` |
| `etcdOperator.name` | Etcd Operator name | `etcd-operator` |
| `etcdOperator.replicaCount` | Number of operator replicas to create (only 1 is supported) | `1` |
| `etcdOperator.image.repository` | etcd-operator container image | `quay.io/coreos/etcd-operator` |
| `etcdOperator.image.tag` | etcd-operator container image tag | `v0.7.0` |
| `etcdOperator.image.pullpolicy` | etcd-operator container image pull policy | `Always` |
| `etcdOperator.resources.cpu` | CPU limit per etcd-operator pod | `100m` |
| `etcdOperator.resources.memory` | Memory limit per etcd-operator pod | `128Mi` |
| `etcdOperator.nodeSelector` | Node labels for etcd operator pod assignment | `{}` |
| `etcdOperator.commandArgs` | Additional command arguments | `{}` |
| `backupOperator.name` | Backup operator name | `etcd-backup-operator` |
| `backupOperator.replicaCount` | Number of operator replicas to create (only 1 is supported) | `1` |
| `backupOperator.image.repository` | Operator container image | `quay.io/coreos/etcd-operator` |
| `backupOperator.image.tag` | Operator container image tag | `v0.7.0` |
| `backupOperator.image.pullpolicy` | Operator container image pull policy | `Always` |
| `backupOperator.resources.cpu` | CPU limit per etcd-operator pod | `100m` |
| `backupOperator.resources.memory` | Memory limit per etcd-operator pod | `128Mi` |
| `backupOperator.spec.storageType` | Storage to use for backup file, currently only S3 supported | `S3` |
| `backupOperator.spec.s3.s3Bucket` | Bucket in S3 to store backup file | |
| `backupOperator.spec.s3.awsSecret` | Name of kubernetes secret containing aws credentials | |
| `backupOperator.nodeSelector` | Node labels for etcd operator pod assignment | `{}` |
| `backupOperator.commandArgs` | Additional command arguments | `{}` |
| `restoreOperator.name` | Restore operator name | `etcd-backup-operator` |
| `restoreOperator.replicaCount` | Number of operator replicas to create (only 1 is supported) | `1` |
| `restoreOperator.image.repository` | Operator container image | `quay.io/coreos/etcd-operator` |
| `restoreOperator.image.tag` | Operator container image tag | `v0.7.0` |
| `restoreOperator.image.pullpolicy` | Operator container image pull policy | `Always` |
| `restoreOperator.resources.cpu` | CPU limit per etcd-operator pod | `100m` |
| `restoreOperator.resources.memory` | Memory limit per etcd-operator pod | `128Mi` |
| `restoreOperator.spec.s3.path` | Path in S3 bucket containing the backup file | |
| `restoreOperator.spec.s3.awsSecret` | Name of kubernetes secret containing aws credentials | |
| `restoreOperator.nodeSelector` | Node labels for etcd operator pod assignment | `{}` |
| `restoreOperator.commandArgs` | Additional command arguments | `{}` |
| `etcdCluster.name` | etcd cluster name | `etcd-cluster` |
| `etcdCluster.size` | etcd cluster size | `3` |
| `etcdCluster.version` | etcd cluster version | `3.2.10` |
| `etcdCluster.image.repository` | etcd container image | `quay.io/coreos/etcd-operator` |
| `etcdCluster.image.tag` | etcd container image tag | `v3.2.10` |
| `etcdCluster.image.pullPolicy` | etcd container image pull policy | `Always` |
| `etcdCluster.enableTLS` | Enable use of TLS | `false` |
| `etcdCluster.tls.static.member.peerSecret` | Kubernetes secret containing TLS peer certs | `etcd-peer-tls` |
| `etcdCluster.tls.static.member.serverSecret` | Kubernetes secret containing TLS server certs | `etcd-server-tls` |
| `etcdCluster.tls.static.operatorSecret` | Kubernetes secret containing TLS client certs | `etcd-client-tls` |
| `etcdCluster.pod.antiAffinity` | Whether etcd cluster pods should have an antiAffinity | `false` |
| `etcdCluster.pod.resources.limits.cpu` | CPU limit per etcd cluster pod | `100m` |
| `etcdCluster.pod.resources.limits.memory` | Memory limit per etcd cluster pod | `128Mi` |
| `etcdCluster.pod.resources.requests.cpu` | CPU request per etcd cluster pod | `100m` |
| `etcdCluster.pod.resources.requests.memory` | Memory request per etcd cluster pod | `128Mi` |
| `etcdCluster.pod.nodeSelector` | node labels for etcd cluster pod assignment | `{}` |

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

```bash
$ helm install --name my-release --set image.tag=v0.2.1 stable/etcd-operator
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while
installing the chart. For example:

```bash
$ helm install --name my-release --values values.yaml stable/etcd-operator
```

## RBAC
By default the chart will install the recommended RBAC roles and rolebindings.

To determine if your cluster supports this running the following:

```console
$ kubectl api-versions | grep rbac
```

You also need to have the following parameter on the api server. See the following document for how to enable [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/)

```
--authorization-mode=RBAC
```

If the output contains "beta" or both "alpha" and "beta" you can may install rbac by default, if not, you may turn RBAC off as described below.

### RBAC role/rolebinding creation

RBAC resources are enabled by default. To disable RBAC do the following:

```console
$ helm install --name my-release stable/etcd-operator --set rbac.create=false
```

### Changing RBAC manifest apiVersion

By default the RBAC resources are generated with the "v1beta1" apiVersion. To use "v1alpha1" do the following:

```console
$ helm install --name my-release stable/etcd-operator --set rbac.install=true,rbac.apiVersion=v1alpha1
```
33 changes: 33 additions & 0 deletions cord-platform/charts/etcd-operator/templates/NOTES.txt
@@ -0,0 +1,33 @@
{{- $clusterEnabled := (and (not .Release.IsInstall) .Values.customResources.createEtcdClusterCRD) -}}
{{- if and .Release.IsInstall .Values.customResources.createEtcdClusterCRD -}}
Not enabling cluster, the ThirdPartResource must be installed before you can create a Cluster. Continuing rest of normal deployment.

{{ end -}}

{{- if $clusterEnabled -}}
1. Watch etcd cluster start
kubectl get pods -l etcd_cluster={{ .Values.etcdCluster.name }} --namespace {{ .Release.Namespace }} -w

2. Confirm etcd cluster is healthy
$ kubectl run --rm -i --tty --env="ETCDCTL_API=3" --env="ETCDCTL_ENDPOINTS=http://{{ .Values.etcdCluster.name }}-client:2379" --namespace {{ .Release.Namespace }} etcd-test --image quay.io/coreos/etcd --restart=Never -- /bin/sh -c 'watch -n1 "etcdctl member list"'

3. Interact with the cluster!
$ kubectl run --rm -i --tty --env ETCDCTL_API=3 --namespace {{ .Release.Namespace }} etcd-test --image quay.io/coreos/etcd --restart=Never -- /bin/sh
/ # etcdctl --endpoints http://{{ .Values.etcdCluster.name }}-client:2379 put foo bar
/ # etcdctl --endpoints http://{{ .Values.etcdCluster.name }}-client:2379 get foo
OK
(ctrl-D to exit)

4. Optional
Check the etcd-operator logs
export POD=$(kubectl get pods -l app={{ template "etcd-operator.fullname" . }} --namespace {{ .Release.Namespace }} --output name)
kubectl logs $POD --namespace={{ .Release.Namespace }}

{{- else -}}
1. etcd-operator deployed.
If you would like to deploy an etcd-cluster set cluster.enabled to true in values.yaml
Check the etcd-operator logs
export POD=$(kubectl get pods -l app={{ template "etcd-operator.fullname" . }} --namespace {{ .Release.Namespace }} --output name)
kubectl logs $POD --namespace={{ .Release.Namespace }}

{{- end -}}
75 changes: 75 additions & 0 deletions cord-platform/charts/etcd-operator/templates/_helpers.tpl
@@ -0,0 +1,75 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "etcd-operator.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).
*/}}
{{- define "etcd-operator.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.etcdOperator.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "etcd-backup-operator.name" -}}
{{- default .Chart.Name .Values.backupOperator.name | 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).
*/}}
{{- define "etcd-backup-operator.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.backupOperator.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "etcd-restore-operator.name" -}}
{{- default .Chart.Name .Values.restoreOperator.name | 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).
*/}}
{{- define "etcd-restore-operator.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.restoreOperator.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the etcd-operator service account to use
*/}}
{{- define "etcd-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.etcdOperatorServiceAccount.create -}}
{{ default (include "etcd-operator.fullname" .) .Values.serviceAccount.etcdOperatorServiceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.etcdOperatorServiceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Create the name of the backup-operator service account to use
*/}}
{{- define "etcd-backup-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.backupOperatorServiceAccount.create -}}
{{ default (include "etcd-backup-operator.fullname" .) .Values.serviceAccount.backupOperatorServiceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.backupOperatorServiceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Create the name of the restore-operator service account to use
*/}}
{{- define "etcd-restore-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.restoreOperatorServiceAccount.create -}}
{{ default (include "etcd-restore-operator.fullname" .) .Values.serviceAccount.restoreOperatorServiceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.restoreOperatorServiceAccount.name }}
{{- end -}}
{{- end -}}

0 comments on commit c65095b

Please sign in to comment.