diff --git a/examples/cert-manager.yml b/examples/cert-manager.yml index 337f5bc..2668f69 100644 --- a/examples/cert-manager.yml +++ b/examples/cert-manager.yml @@ -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 @@ -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 diff --git a/ndustrial/cronjob/Chart.lock b/ndustrial/cronjob/Chart.lock index 7851b66..6cad010 100644 --- a/ndustrial/cronjob/Chart.lock +++ b/ndustrial/cronjob/Chart.lock @@ -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" diff --git a/ndustrial/cronjob/Chart.yaml b/ndustrial/cronjob/Chart.yaml index ab227bc..b8d21bc 100644 --- a/ndustrial/cronjob/Chart.yaml +++ b/ndustrial/cronjob/Chart.yaml @@ -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: diff --git a/ndustrial/deployment/Chart.lock b/ndustrial/deployment/Chart.lock index 153f89b..c99f6b3 100644 --- a/ndustrial/deployment/Chart.lock +++ b/ndustrial/deployment/Chart.lock @@ -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" diff --git a/ndustrial/deployment/Chart.yaml b/ndustrial/deployment/Chart.yaml index 9fd44e2..de8383e 100644 --- a/ndustrial/deployment/Chart.yaml +++ b/ndustrial/deployment/Chart.yaml @@ -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: diff --git a/ndustrial/deployment/README.md b/ndustrial/deployment/README.md index 0e623a1..de9dbb4 100644 --- a/ndustrial/deployment/README.md +++ b/ndustrial/deployment/README.md @@ -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` | @@ -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 @@ -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` | diff --git a/ndustrial/deployment/values.yaml b/ndustrial/deployment/values.yaml index c08c024..ac63755 100644 --- a/ndustrial/deployment/values.yaml +++ b/ndustrial/deployment/values.yaml @@ -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: [] diff --git a/ndustrial/statefulset/Chart.lock b/ndustrial/statefulset/Chart.lock index c97fbd7..aa254cf 100644 --- a/ndustrial/statefulset/Chart.lock +++ b/ndustrial/statefulset/Chart.lock @@ -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" diff --git a/ndustrial/statefulset/Chart.yaml b/ndustrial/statefulset/Chart.yaml index 4c16865..0932482 100644 --- a/ndustrial/statefulset/Chart.yaml +++ b/ndustrial/statefulset/Chart.yaml @@ -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: diff --git a/ndustrial/statefulset/README.md b/ndustrial/statefulset/README.md index 2f41e33..2d4c7eb 100644 --- a/ndustrial/statefulset/README.md +++ b/ndustrial/statefulset/README.md @@ -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 @@ -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 diff --git a/ndustrial/statefulset/values.yaml b/ndustrial/statefulset/values.yaml index b5487b2..bf668c8 100644 --- a/ndustrial/statefulset/values.yaml +++ b/ndustrial/statefulset/values.yaml @@ -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 diff --git a/scripts/examples.sh b/scripts/examples.sh old mode 100644 new mode 100755 index 43296ea..54b93b0 --- a/scripts/examples.sh +++ b/scripts/examples.sh @@ -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