-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from sl1pm4t/fix-emptydir-runasuser
Fix runAsUser=0 and empty_dir missing
- Loading branch information
Showing
8 changed files
with
110 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package tfkschema | ||
|
||
// IncludedOnZero checks the attribute name against a lookup table to determine if it can be included | ||
// when it is zero / empty. | ||
func IncludedOnZero(attrName string) bool { | ||
switch attrName { | ||
case "EmptyDir": | ||
return true | ||
case "RunAsUser": | ||
return true | ||
} | ||
return false | ||
} |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
resource "kubernetes_replication_controller" "es" { | ||
metadata { | ||
name = "es" | ||
labels = { component = "elasticsearch" } | ||
} | ||
spec { | ||
replicas = 1 | ||
template { | ||
metadata { | ||
labels = { component = "elasticsearch" } | ||
} | ||
spec { | ||
volume { | ||
name = "storage" | ||
empty_dir { | ||
} | ||
} | ||
init_container { | ||
name = "init-sysctl" | ||
image = "busybox" | ||
command = ["sysctl", "-w", "vm.max_map_count=262144"] | ||
image_pull_policy = "IfNotPresent" | ||
security_context { | ||
privileged = true | ||
} | ||
} | ||
container { | ||
name = "es" | ||
image = "quay.io/pires/docker-elasticsearch-kubernetes:5.6.2" | ||
port { | ||
name = "http" | ||
container_port = 9200 | ||
protocol = "TCP" | ||
} | ||
port { | ||
name = "transport" | ||
container_port = 9300 | ||
protocol = "TCP" | ||
} | ||
env { | ||
name = "KUBERNETES_CA_CERTIFICATE_FILE" | ||
value = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" | ||
} | ||
env { | ||
name = "NAMESPACE" | ||
value_from { | ||
field_ref { | ||
field_path = "metadata.namespace" | ||
} | ||
} | ||
} | ||
env { | ||
name = "CLUSTER_NAME" | ||
value = "myesdb" | ||
} | ||
env { | ||
name = "DISCOVERY_SERVICE" | ||
value = "elasticsearch" | ||
} | ||
env { | ||
name = "NODE_MASTER" | ||
value = "true" | ||
} | ||
env { | ||
name = "NODE_DATA" | ||
value = "true" | ||
} | ||
env { | ||
name = "HTTP_ENABLE" | ||
value = "true" | ||
} | ||
volume_mount { | ||
name = "storage" | ||
mount_path = "/data" | ||
} | ||
security_context { | ||
capabilities { | ||
add = ["IPC_LOCK"] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.