-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
2,045 additions
and
1,403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,48 @@ | ||
package skuber | ||
|
||
/** | ||
* @author David O'Riordan | ||
*/ | ||
* @author David O'Riordan | ||
*/ | ||
|
||
import Security._ | ||
|
||
case class SecurityContext( | ||
allowPrivilegeEscalation: Option[Boolean] = None, | ||
capabilities: Option[Capabilities] = None, | ||
privileged: Option[Boolean] = None, | ||
readOnlyRootFilesystem: Option[Boolean] = None, | ||
runAsGroup: Option[Int] = None, | ||
runAsNonRoot: Option[Boolean] = None, | ||
runAsUser: Option[Int] = None, | ||
seLinuxOptions: Option[SELinuxOptions] = None | ||
) | ||
|
||
case class PodSecurityContext( | ||
fsGroup: Option[Int] = None, | ||
runAsGroup: Option[Int] = None, | ||
runAsNonRoot: Option[Boolean] = None, | ||
runAsUser: Option[Int] = None, | ||
seLinuxOptions: Option[SELinuxOptions] = None, | ||
supplementalGroups: List[Int] = Nil, | ||
sysctls: List[Sysctl] = Nil | ||
) | ||
|
||
object Security { | ||
// Note: Context can be set at pod and/or container level but certain attributes are level-specific | ||
case class Context( | ||
capabilities: Option[Capabilities] = None, | ||
privileged: Option[Boolean] = None, | ||
seLinuxOptions: Option[SELinuxOptions] = None, | ||
runAsUser: Option[Int] = None, | ||
runAsGroup: Option[Int] = None, | ||
runAsNonRoot: Option[Boolean] = None, | ||
fsGroup: Option[Int] = None, | ||
allowPrivilegeEscalation: Option[Boolean] = None | ||
) | ||
|
||
type Capability=String | ||
type Capability = String | ||
|
||
case class Capabilities( | ||
add: List[Capability] = Nil, | ||
drop: List[Capability] = Nil) | ||
add: List[Capability] = Nil, | ||
drop: List[Capability] = Nil) | ||
|
||
case class SELinuxOptions( | ||
user: String = "", | ||
role: String = "", | ||
_type: String = "", | ||
level: String = "") | ||
|
||
|
||
} | ||
user: String = "", | ||
role: String = "", | ||
_type: String = "", | ||
level: String = "") | ||
|
||
case class Sysctl( | ||
name: String, | ||
value: String | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package skuber.api.client | ||
|
||
/** | ||
* @author David O'Riordan | ||
* | ||
* Defines the details needed to communicate with the API server for a Kubernetes cluster | ||
*/ | ||
case class Cluster( | ||
apiVersion: String = "v1", | ||
server: String = defaultApiServerURL, | ||
insecureSkipTLSVerify: Boolean = false, | ||
certificateAuthority: Option[PathOrData] = None | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package skuber.api.client | ||
|
||
import skuber.Namespace | ||
|
||
/** | ||
* @author David O'Riordan | ||
* Define the Kubernetes API context for requests | ||
*/ | ||
case class Context( | ||
cluster: Cluster = Cluster(), | ||
authInfo: AuthInfo = NoAuth, | ||
namespace: Namespace = Namespace.default | ||
) |
Oops, something went wrong.