Skip to content

Commit

Permalink
DEVOPS-224 - add example
Browse files Browse the repository at this point in the history
  • Loading branch information
kalinon committed Jun 10, 2021
1 parent 3c2a58e commit 03367fb
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 48 deletions.
8 changes: 4 additions & 4 deletions examples/cert-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ ndustrial:
name: cert-manager-example
organization: ndustrial
contxt: {}

ports:
- containerPort: 80
name: http
service:
type: ClusterIP

ingress:
enabled: true
certManager: true
Expand All @@ -17,7 +18,6 @@ ingress:
more_set_headers "X-Robots-Tag: noindex";
tls: true
hostname: cert-manager-example.staging.pizzandustrial.com

image:
registry: docker.ops.ndustrial.io
repository: nginx
repository: library/nginx
6 changes: 3 additions & 3 deletions ndustrial/cronjob/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: https://ndustrialio.github.io/charts
version: 0.1.2
digest: sha256:92b4e3f30f4040f62b6b640eeeebfc4f29f2d16c8d3e42b3cf0919d0673363ab
generated: "2021-06-10T16:47:27.3350857Z"
version: 0.1.3
digest: sha256:c32a37fc1cf1dd6709a75a632371acdf5b85d2e5127d9d043f3de2f73657dfb6
generated: "2021-06-10T17:05:45.0432468Z"
2 changes: 1 addition & 1 deletion ndustrial/cronjob/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type: application
dependencies:
- name: common
repository: https://ndustrialio.github.io/charts
version: 0.1.2
version: 0.1.3
tags:
- ndustrial-common
sources:
Expand Down
6 changes: 3 additions & 3 deletions ndustrial/deployment/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: https://ndustrialio.github.io/charts
version: 0.1.2
digest: sha256:92b4e3f30f4040f62b6b640eeeebfc4f29f2d16c8d3e42b3cf0919d0673363ab
generated: "2021-06-10T16:47:28.4922979Z"
version: 0.1.3
digest: sha256:c32a37fc1cf1dd6709a75a632371acdf5b85d2e5127d9d043f3de2f73657dfb6
generated: "2021-06-10T17:05:46.3252639Z"
2 changes: 1 addition & 1 deletion ndustrial/deployment/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type: application
dependencies:
- name: common
repository: https://ndustrialio.github.io/charts
version: 0.1.2
version: 0.1.3
tags:
- ndustrial-common
maintainers:
Expand Down
36 changes: 24 additions & 12 deletions ndustrial/deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
| Name | Description | Value |
| ------------------------------------ | ------------------------------------------------------------- | --------------- |
| `replicaCount` | Number of Controller replicas | `1` |
| `startupProbe.enabled` | Enable startupProbe | `false` |
| `startupProbe.path` | Path for startupProbe | `/` |
| `startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `60` |
| `startupProbe.periodSeconds` | Period seconds for startupProbe | `10` |
| `startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `1` |
| `startupProbe.failureThreshold` | Failure threshold for startupProbe | `3` |
| `startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
| `livenessProbe.enabled` | Enable livenessProbe | `true` |
| `livenessProbe.path` | Path for livenessProbe | `/` |
| `livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `60` |
Expand All @@ -50,18 +57,18 @@

### Service parameters

| Name | Description | Value |
| ---------------------------------- | ---------------------------------------------------- | -------------- |
| `service.type` | Deployment service type | `LoadBalancer` |
| `service.port` | Deployment service HTTP port | `80` |
| `service.httpsPort` | Deployment service HTTPS port | `443` |
| `service.nodePorts.http` | Node port for HTTP | `nil` |
| `service.nodePorts.https` | Node port for HTTPS | `nil` |
| `service.clusterIP` | Deployment service Cluster IP | `nil` |
| `service.loadBalancerIP` | Deployment service Load Balancer IP | `nil` |
| `service.loadBalancerSourceRanges` | Deployment service Load Balancer sources | `[]` |
| `service.externalTrafficPolicy` | Deployment service external traffic policy | `Cluster` |
| `service.annotations` | Additional custom annotations for Deployment service | `{}` |
| Name | Description | Value |
| ---------------------------------- | ---------------------------------------------------- | ----------- |
| `service.type` | Deployment service type | `ClusterIP` |
| `service.port` | Deployment service HTTP port | `80` |
| `service.httpsPort` | Deployment service HTTPS port | `443` |
| `service.nodePorts.http` | Node port for HTTP | `nil` |
| `service.nodePorts.https` | Node port for HTTPS | `nil` |
| `service.clusterIP` | Deployment service Cluster IP | `nil` |
| `service.loadBalancerIP` | Deployment service Load Balancer IP | `nil` |
| `service.loadBalancerSourceRanges` | Deployment service Load Balancer sources | `[]` |
| `service.externalTrafficPolicy` | Deployment service external traffic policy | `Cluster` |
| `service.annotations` | Additional custom annotations for Deployment service | `{}` |


### Ingress parameters
Expand Down Expand Up @@ -109,6 +116,11 @@

| Name | Description | Value |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `ports[0].containerPort` | Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. | `80` |
| `ports[0].name` | If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. | `http` |
| `ports[0].hostIp` | What host IP to bind the external port to. | `nil` |
| `ports[0].hostPort` | Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. | `nil` |
| `ports[0].protocol` | Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". | `TCP` |
| `command` | Override Deployment default command | `[]` |
| `args` | Override Deployment default args | `[]` |
| `priorityClassName` | Deployment pod priority class name | `nil` |
Expand Down
13 changes: 13 additions & 0 deletions ndustrial/deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,19 @@ image:

## @section Pod parameters

# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#containerport-v1-core
## @param ports[0].containerPort Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.
## @param ports[0].name If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.
## @param ports[0].hostIp What host IP to bind the external port to.
## @param ports[0].hostPort Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.
## @param ports[0].protocol Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP".
ports:
- containerPort: 80
name: http
hostIp:
hostPort:
protocol: TCP

## @param command Override Deployment default command
##
command: []
Expand Down
6 changes: 3 additions & 3 deletions ndustrial/statefulset/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: https://ndustrialio.github.io/charts
version: 0.1.2
digest: sha256:92b4e3f30f4040f62b6b640eeeebfc4f29f2d16c8d3e42b3cf0919d0673363ab
generated: "2021-06-10T16:47:29.6052881Z"
version: 0.1.3
digest: sha256:c32a37fc1cf1dd6709a75a632371acdf5b85d2e5127d9d043f3de2f73657dfb6
generated: "2021-06-10T17:05:47.4802702Z"
2 changes: 1 addition & 1 deletion ndustrial/statefulset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type: application
dependencies:
- name: common
repository: https://ndustrialio.github.io/charts
version: 0.1.2
version: 0.1.3
tags:
- ndustrial-common
maintainers:
Expand Down
43 changes: 24 additions & 19 deletions ndustrial/statefulset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@

### Service parameters

| Name | Description | Value |
| ---------------------------------- | ----------------------------------------------------- | -------------- |
| `service.type` | StatefulSet service type | `LoadBalancer` |
| `service.port` | StatefulSet service HTTP port | `80` |
| `service.httpsPort` | StatefulSet service HTTPS port | `443` |
| `service.nodePorts.http` | Node port for HTTP | `nil` |
| `service.nodePorts.https` | Node port for HTTPS | `nil` |
| `service.clusterIP` | StatefulSet service Cluster IP | `nil` |
| `service.loadBalancerIP` | StatefulSet service Load Balancer IP | `nil` |
| `service.loadBalancerSourceRanges` | StatefulSet service Load Balancer sources | `[]` |
| `service.externalTrafficPolicy` | StatefulSet service external traffic policy | `Cluster` |
| `service.annotations` | Additional custom annotations for StatefulSet service | `{}` |
| Name | Description | Value |
| ---------------------------------- | ----------------------------------------------------- | ----------- |
| `service.type` | StatefulSet service type | `ClusterIP` |
| `service.port` | StatefulSet service HTTP port | `80` |
| `service.httpsPort` | StatefulSet service HTTPS port | `443` |
| `service.nodePorts.http` | Node port for HTTP | `nil` |
| `service.nodePorts.https` | Node port for HTTPS | `nil` |
| `service.clusterIP` | StatefulSet service Cluster IP | `nil` |
| `service.loadBalancerIP` | StatefulSet service Load Balancer IP | `nil` |
| `service.loadBalancerSourceRanges` | StatefulSet service Load Balancer sources | `[]` |
| `service.externalTrafficPolicy` | StatefulSet service external traffic policy | `Cluster` |
| `service.annotations` | Additional custom annotations for StatefulSet service | `{}` |


### Ingress parameters
Expand All @@ -85,13 +85,18 @@

### Pod Image parameters

| Name | Description | Value |
| ------------------- | ----------------------------------------------------- | -------------- |
| `image.registry` | StatefulSet image registry | `docker.io` |
| `image.repository` | StatefulSet image repository | `busybox` |
| `image.tag` | StatefulSet image tag (immutabe tags are recommended) | `latest` |
| `image.pullPolicy` | StatefulSet image pull policy | `IfNotPresent` |
| `image.pullSecrets` | StatefulSet image pull secrets | `[]` |
| Name | Description | Value |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `ports[0].containerPort` | Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. | `80` |
| `ports[0].name` | If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. | `http` |
| `ports[0].hostIp` | What host IP to bind the external port to. | `nil` |
| `ports[0].hostPort` | Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. | `nil` |
| `ports[0].protocol` | Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". | `TCP` |
| `image.registry` | StatefulSet image registry | `docker.io` |
| `image.repository` | StatefulSet image repository | `busybox` |
| `image.tag` | StatefulSet image tag (immutabe tags are recommended) | `latest` |
| `image.pullPolicy` | StatefulSet image pull policy | `IfNotPresent` |
| `image.pullSecrets` | StatefulSet image pull secrets | `[]` |


### Pod parameters
Expand Down
13 changes: 13 additions & 0 deletions ndustrial/statefulset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,19 @@ ingress:

## @section Pod Image parameters

# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#containerport-v1-core
## @param ports[0].containerPort Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.
## @param ports[0].name If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.
## @param ports[0].hostIp What host IP to bind the external port to.
## @param ports[0].hostPort Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.
## @param ports[0].protocol Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP".
ports:
- containerPort: 80
name: http
hostIp:
hostPort:
protocol: TCP

image:
## @skip image.debug
debug: false
Expand Down
59 changes: 58 additions & 1 deletion scripts/examples.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,58 @@
helm install -n chart-examples cert-manager-example ./ndustrial/deployment -f ./examples/cert-manager.yml --create-namespace
#!/bin/bash
set -e

NAMESPACE="chart-examples"
WORKDIR=$(pwd)
TASK=$1
EXAMPLE_NAME=$2

if [ -z ${TASK} ]; then
echo "must provide a task mode:"
echo " install"
echo " delete"
echo " upgrade"
echo " list"
exit
fi

if [ "${TASK}" == "list" ]; then
helm list -n ${NAMESPACE}
exit
fi

if [[ -z ${EXAMPLE_NAME} && -e ${WORKDIR}/examples/${EXAMPLE_NAME} ]]; then
echo "must provide one of the examples:"
ls ${WORKDIR}/examples/
exit
fi

install() {
local _file=$1
local path=${WORKDIR}/examples/${_file}
local name=${_file%".yml"}
helm install -n ${NAMESPACE} ${name} ./ndustrial/deployment -f ${path} --create-namespace
}

delete() {
local _file=$1
local path=${WORKDIR}/examples/${_file}
local name=${_file%".yml"}
helm delete -n ${NAMESPACE} ${name}
}

upgrade() {
local _file=$1
local path=${WORKDIR}/examples/${_file}
local name=${_file%".yml"}
helm upgrade -n ${NAMESPACE} ${name} ./ndustrial/deployment -f ${path}
}

if [ "${TASK}" == "install" ]; then
install ${EXAMPLE_NAME}
elif [ "${TASK}" == "delete" ]; then
delete ${EXAMPLE_NAME}
elif [ "${TASK}" == "upgrade" ]; then
upgrade ${EXAMPLE_NAME}
else
echo "unknown task: ${TASK}"
fi

0 comments on commit 03367fb

Please sign in to comment.