Пример #1
0
    public MyStack()
    {
        var kube_systemCorednsConfigMap = new Kubernetes.Core.V1.ConfigMap("kube_systemCorednsConfigMap", new Kubernetes.Types.Inputs.Core.V1.ConfigMapArgs
        {
            ApiVersion = "v1",
            Kind       = "ConfigMap",
            Metadata   = new Kubernetes.Types.Inputs.Meta.V1.ObjectMetaArgs
            {
                Name      = "coredns",
                Namespace = "kube-system",
            },
            Data =
            {
                { "Corefile", @".:53 {
        errors
        health {
          lameduck 5s
        }
        ready
        kubernetes CLUSTER_DOMAIN REVERSE_CIDRS {
          fallthrough in-addr.arpa ip6.arpa
        }
        prometheus :9153
        forward . UPSTREAMNAMESERVER {
          max_concurrent 1000
        }
        cache 30
        loop
        reload
        loadbalance
    }STUBDOMAINS
" },
            },
        });
    }
Пример #2
0
    static Task <int> Main(string[] args)
    {
        return(Pulumi.Deployment.RunAsync(() =>
        {
            var config = new Pulumi.Config();
            var pw = config.RequireSecret("message");
            var rawPw = config.Require("message");

            var cmData = new CoreV1.ConfigMap("cmdata", new ConfigMapArgs
            {
                Data = new InputMap <string>
                {
                    { "password", pw },
                }
            });

            var cmBinaryData = new CoreV1.ConfigMap("cmbinarydata", new ConfigMapArgs
            {
                BinaryData = new InputMap <string>
                {
                    { "password", pw.Apply(v => Base64Encode(v)) },
                }
            });

            var sStringData = new CoreV1.Secret("sstringdata", new SecretArgs
            {
                StringData = new InputMap <string>
                {
                    { "password", rawPw }
                }
            });

            var sData = new CoreV1.Secret("sdata", new SecretArgs
            {
                Data = new InputMap <string>
                {
                    { "password", Base64Encode(rawPw) }
                }
            });

            var name = $"test-{RandomString()}";
            var secretYAML = $@"
apiVersion: v1
kind: Secret
metadata:
  name: {name}
stringData:
  password: {rawPw}
";
            var cg = new Yaml.ConfigGroup("example", new Yaml.ConfigGroupArgs
            {
                Yaml = secretYAML
            });
            var cgSecret = cg.GetResource <CoreV1.Secret>(name);

            return new Dictionary <string, object>
            {
                { "cmData", cmData.Data },
                { "cmBinaryData", cmData.BinaryData },
                { "sStringData", sStringData.StringData },
                { "sData", sStringData.Data },
                { "cgData", cgSecret.Apply(v => v.Data) },
            };
        }));
    }