Skip to content

Commit 62eecc6

Browse files
authored
Merge pull request #186 from containerum/refinery
Refinery
2 parents 9aa2000 + c340246 commit 62eecc6

124 files changed

Lines changed: 2948 additions & 1579 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ARG BUILD_CONTAINERUM_API=https://api.containerum.io
66
ENV CONTAINERUM_API=$BUILD_CONTAINERUM_API
77

88
COPY . .
9+
RUN go get -u -v github.com/UnnoTed/fileb0x
910
RUN make build
1011

1112
FROM alpine:3.7

Gopkg.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ genkey: $(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE)
4545

4646
# go has build artifacts caching so soruce tracking not needed
4747
build: $(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE)
48+
go generate ./help
4849
@echo "Building chkit for current OS/architecture, without signing"
4950
go build -v -ldflags="$(RELEASE_LDFLAGS)" -o $(BUILDS_DIR)/$(EXECUTABLE) ./$(CMD_DIR)
5051

@@ -101,6 +102,7 @@ single_release: $(SIGNING_KEY_DIR)/$(PRIVATE_KEY_FILE)
101102
dev:
102103
$(eval VERSION=$(LATEST_TAG:v%=%)+dev)
103104
@echo building $(VERSION)
105+
go generate ./help
104106
go build -v -race --tags="dev" --ldflags="$(DEV_LDFLAGS)" ./$(CMD_DIR)
105107

106108
mock:

cmd/chkit/chkit.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,19 @@ import (
55
"os"
66

77
"github.com/containerum/chkit/pkg/cli"
8+
"github.com/containerum/chkit/pkg/context"
9+
"github.com/containerum/chkit/pkg/util/angel"
810
)
911

1012
func main() {
13+
defer func() {
14+
switch panicInfo := recover().(type) {
15+
case nil:
16+
// pass
17+
default:
18+
angel.Angel(&context.Context{Version: cli.VERSION}, panicInfo)
19+
}
20+
}()
1121
if err := cli.Root(); err != nil {
1222
fmt.Printf("%v\n", err)
1323
os.Exit(1)

doc/create.md

Lines changed: 110 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Create resource (deployment, service...)
3232

3333
* **[create configmap](#create_configmap)**
3434
* **[create deployment](#create_deployment)** create deployment
35+
* **[create deployment-container](#create_deployment-container)** create deployment container.
3536
* **[create ingress](#create_ingress)** create ingress
3637
* **[create service](#create_service)** create service
3738

@@ -53,9 +54,9 @@ Create service for the specified pod in the specified namespace.
5354
| | --deploy | service deployment, required | |
5455
| -f | --file | file with service data | - |
5556
| | --force | create service without confirmation | false |
56-
| | --name | service name, optional | flavescent-anaximander |
57+
| | --name | service name, optional | quartz-mckay |
5758
| | --port | service port, optional | 0 |
58-
| | --port-name | service port name, optional | massalia-penny |
59+
| | --port-name | service port name, optional | danzl-bistre |
5960
| | --proto | service protocol, optional | TCP |
6061
| | --target-port | service target port, optional | 80 |
6162

@@ -91,11 +92,115 @@ chkit create ingress [--force] [--filename ingress.json] [-n prettyNamespace]
9192

9293

9394

95+
#### <a name="create_deployment-container">create deployment-container</a>
96+
97+
**Description**:
98+
99+
Add container to deployment container set. Available methods to build deployment:
100+
- from flags
101+
- with interactive commandline wizard
102+
- from yaml ot json file
103+
104+
Use --force flag to create container without interactive wizard.
105+
If the --container-name flag is not specified then wizard generates name RANDOM_COLOR-IMAGE.
106+
107+
**Example**:
108+
109+
110+
111+
**Flags**:
112+
113+
| Short | Name | Usage | Default value |
114+
| ----- | ---- | ----- | ------------- |
115+
| | --configmap | container configmap mount, CONFIG:MOUNT_PATH or CONFIG (then MOUNTPATH is /etc/CONFIG) | |
116+
| | --container-name | container name, required on --force | |
117+
| | --cpu | container CPU limit, mCPU | 0 |
118+
| | --deployment | deployment name, required on --force | |
119+
| | --env | container environment variables, NAME:VALUE, 'NAME:$HOST_ENV' or '$HOST_ENV' (to user host env). WARNING: single quotes are required to prevent env from interpolation | |
120+
| -f | --force | suppress confirmation | false |
121+
| | --image | container image | |
122+
| | --memory | container memory limit, Mb | 0 |
123+
| | --volume | container volume mounts, VOLUME:MOUNT_PATH or VOLUME (then MOUNT_PATH is /mnt/VOLUME) | |
124+
125+
126+
**Subcommands**:
127+
128+
129+
94130
#### <a name="create_deployment">create deployment</a>
95131

96132
**Description**:
97133

98-
Create a new deployment. Runs in one-line mode, suitable for integration with other tools, and in interactive wizard mode.
134+
Create deployment with containers and replicas.
135+
Available methods to build deployment:
136+
- from flags
137+
- with interactive commandline wizard
138+
- from yaml ot json file
139+
140+
Use --force flag to create container without interactive wizard.
141+
142+
There are several ways to specify the names of containers with flags:
143+
- --container-name flag
144+
- the prefix CONTAINER_NAME@ in the flags --image, --memory, --cpu, --env, --volume
145+
146+
If the --container-name flag is not specified and prefix is not used in any of the flags, then wizard searches for the --image flags without a prefix and generates name RANDOM_COLOR-IMAGE.
147+
148+
**Examples:**
149+
150+
---
151+
**Single container with --container-name**
152+
153+
```bash
154+
> ./ckit create depl \
155+
--container-name doot \
156+
--image nginx
157+
```
158+
159+
| LABEL | VERSION | STATUS | CONTAINERS | AGE |
160+
| ------------------- | --------| -------- | ------------ | --------- |
161+
| akiraabe-heisenberg | 1.0.0 | inactive | doot [nginx] | undefined |
162+
163+
---
164+
**Single container without --container-name**
165+
166+
```bash
167+
> ./ckit create depl \
168+
--image nginx
169+
```
170+
171+
| LABEL | VERSION | STATUS | CONTAINERS | AGE |
172+
| ------------------- | --------| -------- | ------------------------ | --------- |
173+
| spiraea-kaufman | 1.0.0 | inactive | aquamarine-nginx [nginx] | undefined |
174+
175+
---
176+
**Multiple containers with --container-name**
177+
178+
179+
```bash
180+
> ./ckit create depl \
181+
--container-name gateway \
182+
--image nginx \
183+
--image blog@wordpress
184+
```
185+
186+
| LABEL | VERSION | STATUS | CONTAINERS | AGE |
187+
| ------------------- | --------| -------- | ------------------------ | --------- |
188+
| ruckers-fischer | 1.0.0 | inactive | gateway [nginx] | undefined |
189+
| | | | blog [wordpress] | |
190+
191+
---
192+
**Multiple containers without --container-name**
193+
```bash
194+
> ./ckit create depl \
195+
--image nginx \
196+
--image blog@wordpress
197+
```
198+
199+
| LABEL | VERSION | STATUS | CONTAINERS | AGE |
200+
| ------------------- | ------- | -------- | ------------------------ | --------- |
201+
| thisbe-neumann | 1.0.0 | inactive | blog [wordpress] | undefined |
202+
| | | | garnet-nginx [nginx] | |
203+
99204

100205
**Example**:
101206

@@ -106,6 +211,7 @@ Create a new deployment. Runs in one-line mode, suitable for integration with ot
106211
| Short | Name | Usage | Default value |
107212
| ----- | ---- | ----- | ------------- |
108213
| | --configmap | container configmap, CONTAINER_NAME@CONFIGMAP_NAME@MOUNTPATH in case of multiple containers or CONFIGMAP_NAME@MOUNTPATH or CONFIGMAP_NAME in case of one container. If MOUNTPATH is omitted, then use /etc/CONFIGMAP_NAME as mountpath | |
214+
| | --container-name | container name in case of single container | |
109215
| | --cpu | container memory limit, mCPU, CONTAINER_NAME@CPU in case of multiple containers or CPU in case of one container | |
110216
| | --env | container environment variable, CONTAINER_NAME@KEY:VALUE in case of multiple containers or KEY:VALUE in case of one container | |
111217
| | --file | file with configmap data, .json, .yaml, .yml, optional | |
@@ -139,7 +245,7 @@ Create a new deployment. Runs in one-line mode, suitable for integration with ot
139245
| -f | --force | suppress confirmation | false |
140246
| | --item-file | configmap file, KEY:FILE_PATH or FILE_PATH | |
141247
| | --item-string | configmap item, KEY:VALUE string pair | |
142-
| | --name | configmap name | eunomia-knoll |
248+
| | --name | configmap name | michela-zollner |
143249

144250

145251
**Subcommands**:

doc/delete.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ Delete resource
3232

3333
* **[delete configmap](#delete_configmap)** delete configmap
3434
* **[delete deployment](#delete_deployment)** delete deployment in specific namespace
35+
* **[delete deployment-container](#delete_deployment-container)** delete container
3536
* **[delete ingress](#delete_ingress)** delete ingress
3637
* **[delete namespace](#delete_namespace)** delete namespace
3738
* **[delete pod](#delete_pod)** delete pod in specific namespace
3839
* **[delete service](#delete_service)** delete service in specific namespace
40+
* **[delete solution](#delete_solution)** Delete running solution
3941
* **[delete volume](#delete_volume)** delete volume
4042

4143

@@ -60,6 +62,27 @@ chkit delete volume [--force]
6062

6163

6264

65+
#### <a name="delete_solution">delete solution</a>
66+
67+
**Description**:
68+
69+
Delete running solution
70+
71+
**Example**:
72+
73+
chkit delete solution [--force]
74+
75+
**Flags**:
76+
77+
| Short | Name | Usage | Default value |
78+
| ----- | ---- | ----- | ------------- |
79+
| -f | --force | delete solution without confirmation | false |
80+
81+
82+
**Subcommands**:
83+
84+
85+
6386
#### <a name="delete_service">delete service</a>
6487

6588
**Description**:
@@ -144,11 +167,35 @@ chkit delete ingress $INGRESS [-n $NAMESPACE] [--force]
144167

145168

146169

170+
#### <a name="delete_deployment-container">delete deployment-container</a>
171+
172+
**Description**:
173+
174+
Delete deployment container.
175+
176+
**Example**:
177+
178+
179+
180+
**Flags**:
181+
182+
| Short | Name | Usage | Default value |
183+
| ----- | ---- | ----- | ------------- |
184+
| | --container | container name, required on --force | |
185+
| | --deployment | deployment name, required on --force | |
186+
| | --force | suppress confirmation | false |
187+
188+
189+
**Subcommands**:
190+
191+
192+
147193
#### <a name="delete_deployment">delete deployment</a>
148194

149195
**Description**:
150196

151-
Delete deployment in specific namespace. Use --force flag to suppress confirmation.
197+
Delete deployment in specific namespace.
198+
Use --force flag to suppress confirmation.
152199

153200
**Example**:
154201

0 commit comments

Comments
 (0)