Skip to content

Commit

Permalink
feat: Secret volume support (#211) (#268)
Browse files Browse the repository at this point in the history
Co-authored-by: Amit Prakash Ambasta <ambasta@users.noreply.github.com>
  • Loading branch information
Chriscbr and ambasta committed Jan 14, 2022
1 parent 00990a3 commit 53d8fcd
Show file tree
Hide file tree
Showing 5 changed files with 572 additions and 15 deletions.
107 changes: 107 additions & 0 deletions docs/java.md
Expand Up @@ -4321,6 +4321,88 @@ The secret.

---

### SecretVolumeOptions <a name="org.cdk8s.plus21.SecretVolumeOptions"></a>

Options for the Secret-based volume.

#### Initializer <a name="[object Object].Initializer"></a>

```java
import org.cdk8s.plus21.SecretVolumeOptions;

SecretVolumeOptions.builder()
// .defaultMode(java.lang.Number)
// .items(java.util.Map<java.lang.String, PathMapping>)
// .name(java.lang.String)
// .optional(java.lang.Boolean)
.build();
```

##### `defaultMode`<sup>Optional</sup> <a name="org.cdk8s.plus21.SecretVolumeOptions.property.defaultMode"></a>

```java
public java.lang.Number getDefaultMode();
```

- *Type:* `java.lang.Number`
- *Default:* 0644. Directories within the path are not affected by this
setting. This might be in conflict with other options that affect the file
mode, like fsGroup, and the result can be other mode bits set.

Mode bits to use on created files by default.

Must be a value between 0 and
0777. Defaults to 0644. Directories within the path are not affected by
this setting. This might be in conflict with other options that affect the
file mode, like fsGroup, and the result can be other mode bits set.

---

##### `items`<sup>Optional</sup> <a name="org.cdk8s.plus21.SecretVolumeOptions.property.items"></a>

```java
public java.util.Map<java.lang.String, PathMapping> getItems();
```

- *Type:* java.util.Map<java.lang.String, [`org.cdk8s.plus21.PathMapping`](#org.cdk8s.plus21.PathMapping)>
- *Default:* no mapping

If unspecified, each key-value pair in the Data field of the referenced secret will be projected into the volume as a file whose name is the key and content is the value.

If specified, the listed keys will be projected
into the specified paths, and unlisted keys will not be present. If a key
is specified which is not present in the secret, the volume setup will
error unless it is marked optional. Paths must be relative and may not
contain the '..' path or start with '..'.

---

##### `name`<sup>Optional</sup> <a name="org.cdk8s.plus21.SecretVolumeOptions.property.name"></a>

```java
public java.lang.String getName();
```

- *Type:* `java.lang.String`
- *Default:* auto-generated

The volume name.

---

##### `optional`<sup>Optional</sup> <a name="org.cdk8s.plus21.SecretVolumeOptions.property.optional"></a>

```java
public java.lang.Boolean getOptional();
```

- *Type:* `java.lang.Boolean`
- *Default:* undocumented

Specify whether the secret or its keys must be defined.

---

### ServiceAccountProps <a name="org.cdk8s.plus21.ServiceAccountProps"></a>

Properties for initialization of `ServiceAccount`.
Expand Down Expand Up @@ -5906,6 +5988,31 @@ Additional options.

---

##### `fromSecret` <a name="org.cdk8s.plus21.Volume.fromSecret"></a>

```java
import org.cdk8s.plus21.Volume;

Volume.fromSecret(ISecret secret)
Volume.fromSecret(ISecret secret, SecretVolumeOptions options)
```

###### `secret`<sup>Required</sup> <a name="org.cdk8s.plus21.Volume.parameter.secret"></a>

- *Type:* [`org.cdk8s.plus21.ISecret`](#org.cdk8s.plus21.ISecret)

The secret to use to populate the volume.

---

###### `options`<sup>Optional</sup> <a name="org.cdk8s.plus21.Volume.parameter.options"></a>

- *Type:* [`org.cdk8s.plus21.SecretVolumeOptions`](#org.cdk8s.plus21.SecretVolumeOptions)

Options.

---

#### Properties <a name="Properties"></a>

##### `name`<sup>Required</sup> <a name="org.cdk8s.plus21.Volume.property.name"></a>
Expand Down
153 changes: 153 additions & 0 deletions docs/python.md
Expand Up @@ -5216,6 +5216,88 @@ The secret.

---

### SecretVolumeOptions <a name="cdk8s_plus_21.SecretVolumeOptions"></a>

Options for the Secret-based volume.

#### Initializer <a name="[object Object].Initializer"></a>

```python
import cdk8s_plus_21

cdk8s_plus_21.SecretVolumeOptions(
default_mode: typing.Union[int, float] = None,
items: typing.Mapping[PathMapping] = None,
name: str = None,
optional: bool = None
)
```

##### `default_mode`<sup>Optional</sup> <a name="cdk8s_plus_21.SecretVolumeOptions.property.default_mode"></a>

```python
default_mode: typing.Union[int, float]
```

- *Type:* `typing.Union[int, float]`
- *Default:* 0644. Directories within the path are not affected by this
setting. This might be in conflict with other options that affect the file
mode, like fsGroup, and the result can be other mode bits set.

Mode bits to use on created files by default.

Must be a value between 0 and
0777. Defaults to 0644. Directories within the path are not affected by
this setting. This might be in conflict with other options that affect the
file mode, like fsGroup, and the result can be other mode bits set.

---

##### `items`<sup>Optional</sup> <a name="cdk8s_plus_21.SecretVolumeOptions.property.items"></a>

```python
items: typing.Mapping[PathMapping]
```

- *Type:* typing.Mapping[[`cdk8s_plus_21.PathMapping`](#cdk8s_plus_21.PathMapping)]
- *Default:* no mapping

If unspecified, each key-value pair in the Data field of the referenced secret will be projected into the volume as a file whose name is the key and content is the value.

If specified, the listed keys will be projected
into the specified paths, and unlisted keys will not be present. If a key
is specified which is not present in the secret, the volume setup will
error unless it is marked optional. Paths must be relative and may not
contain the '..' path or start with '..'.

---

##### `name`<sup>Optional</sup> <a name="cdk8s_plus_21.SecretVolumeOptions.property.name"></a>

```python
name: str
```

- *Type:* `str`
- *Default:* auto-generated

The volume name.

---

##### `optional`<sup>Optional</sup> <a name="cdk8s_plus_21.SecretVolumeOptions.property.optional"></a>

```python
optional: bool
```

- *Type:* `bool`
- *Default:* undocumented

Specify whether the secret or its keys must be defined.

---

### ServiceAccountProps <a name="cdk8s_plus_21.ServiceAccountProps"></a>

Properties for initialization of `ServiceAccount`.
Expand Down Expand Up @@ -7227,6 +7309,77 @@ here and the sum of memory limits of all containers in a pod.

---

##### `from_secret` <a name="cdk8s_plus_21.Volume.from_secret"></a>

```python
import cdk8s_plus_21

cdk8s_plus_21.Volume.from_secret(
secret: ISecret,
default_mode: typing.Union[int, float] = None,
items: typing.Mapping[PathMapping] = None,
name: str = None,
optional: bool = None
)
```

###### `secret`<sup>Required</sup> <a name="cdk8s_plus_21.Volume.parameter.secret"></a>

- *Type:* [`cdk8s_plus_21.ISecret`](#cdk8s_plus_21.ISecret)

The secret to use to populate the volume.

---

###### `default_mode`<sup>Optional</sup> <a name="cdk8s_plus_21.SecretVolumeOptions.parameter.default_mode"></a>

- *Type:* `typing.Union[int, float]`
- *Default:* 0644. Directories within the path are not affected by this
setting. This might be in conflict with other options that affect the file
mode, like fsGroup, and the result can be other mode bits set.

Mode bits to use on created files by default.

Must be a value between 0 and
0777. Defaults to 0644. Directories within the path are not affected by
this setting. This might be in conflict with other options that affect the
file mode, like fsGroup, and the result can be other mode bits set.

---

###### `items`<sup>Optional</sup> <a name="cdk8s_plus_21.SecretVolumeOptions.parameter.items"></a>

- *Type:* typing.Mapping[[`cdk8s_plus_21.PathMapping`](#cdk8s_plus_21.PathMapping)]
- *Default:* no mapping

If unspecified, each key-value pair in the Data field of the referenced secret will be projected into the volume as a file whose name is the key and content is the value.

If specified, the listed keys will be projected
into the specified paths, and unlisted keys will not be present. If a key
is specified which is not present in the secret, the volume setup will
error unless it is marked optional. Paths must be relative and may not
contain the '..' path or start with '..'.

---

###### `name`<sup>Optional</sup> <a name="cdk8s_plus_21.SecretVolumeOptions.parameter.name"></a>

- *Type:* `str`
- *Default:* auto-generated

The volume name.

---

###### `optional`<sup>Optional</sup> <a name="cdk8s_plus_21.SecretVolumeOptions.parameter.optional"></a>

- *Type:* `bool`
- *Default:* undocumented

Specify whether the secret or its keys must be defined.

---

#### Properties <a name="Properties"></a>

##### `name`<sup>Required</sup> <a name="cdk8s_plus_21.Volume.property.name"></a>
Expand Down

0 comments on commit 53d8fcd

Please sign in to comment.