From 36f32b9282d0740a353e3c1e1576e0a3e35ab4b4 Mon Sep 17 00:00:00 2001 From: hejianpeng Date: Thu, 27 Jan 2022 10:20:55 +0800 Subject: [PATCH] WasmPlugin add VmConfig --- extensions/v1alpha1/wasm.gen.json | 60 ++ extensions/v1alpha1/wasm.pb.go | 962 +++++++++++++++++- extensions/v1alpha1/wasm.pb.html | 149 ++- extensions/v1alpha1/wasm.proto | 49 + extensions/v1alpha1/wasm_deepcopy.gen.go | 42 + extensions/v1alpha1/wasm_json.gen.go | 22 + kubernetes/customresourcedefinitions.gen.yaml | 40 + .../istio_api/extensions/v1alpha1/wasm_pb2.py | 198 +++- 8 files changed, 1475 insertions(+), 47 deletions(-) diff --git a/extensions/v1alpha1/wasm.gen.json b/extensions/v1alpha1/wasm.gen.json index dca8259415e..6ee77370f41 100644 --- a/extensions/v1alpha1/wasm.gen.json +++ b/extensions/v1alpha1/wasm.gen.json @@ -6,6 +6,25 @@ }, "components": { "schemas": { + "istio.extensions.v1alpha1.EnvironmentVariables": { + "type": "object", + "properties": { + "hostEnvKeys": { + "description": "The keys of *Envoy's* environment variables exposed to this VM. In other words, if a key exists in Envoy's environment variables, then that key-value pair will be injected. Note that if a key does not exist, it will be ignored.", + "type": "array", + "items": { + "type": "string" + } + }, + "keyValues": { + "description": "Explicitly given key-value pairs to be injected to this VM in the form of \"KEY=VALUE\".", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, "istio.extensions.v1alpha1.PluginPhase": { "description": "The phase in the filter chain where the plugin will be injected.", "type": "string", @@ -25,6 +44,44 @@ "Always" ] }, + "istio.extensions.v1alpha1.VmConfig": { + "description": "Configuration for a Wasm VM.", + "type": "object", + "properties": { + "vmId": { + "description": "An ID which will be used along with a hash of the wasm code (or the name of the registered Null VM plugin) to determine which VM will be used for the plugin. All plugins which use the same *vm_id* and code will use the same VM. May be left blank. Sharing a VM between plugins can reduce memory utilization and make sharing of data easier which may have security implications.", + "type": "string" + }, + "runtime": { + "description": "The Wasm runtime type (either \"v8\" or \"null\" for code compiled into Envoy). Default valut: `envoy.wasm.runtime.v8`", + "type": "string" + }, + "configuration": { + "description": "The Wasm configuration used in initialization of a new VM (proxy_on_start). `google.protobuf.Struct` is serialized as JSON before passing it to the plugin. `google.protobuf.BytesValue` and `google.protobuf.StringValue` are passed directly without the wrapper.", + "type": "object", + "required": [ + "@type" + ], + "properties": { + "@type": { + "description": "A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one \"/\" character. The last segment of the URL's path must represent the fully qualified name of the type (as in `type.googleapis.com/google.protobuf.Duration`). The name should be in a canonical form (e.g., leading \".\" is not accepted). The remaining fields of this object correspond to fields of the proto messsage. If the embedded message is well-known and has a custom JSON representation, that representation is assigned to the 'value' field.", + "type": "string" + } + } + }, + "allowPrecompiled": { + "description": "Allow the wasm file to include pre-compiled code on VMs which support it. Warning: this should only be enable for trusted sources as the precompiled code is not verified.", + "type": "boolean" + }, + "nackOnCodeCacheMiss": { + "description": "If true and the code needs to be remotely fetched and it is not in the cache then NACK the configuration update and do a background fetch to fill the cache, otherwise fetch the code asynchronously and enter warming state.", + "type": "boolean" + }, + "environmentVariables": { + "$ref": "#/components/schemas/istio.extensions.v1alpha1.EnvironmentVariables" + } + } + }, "istio.extensions.v1alpha1.WasmPlugin": { "description": "WasmPlugins provides a mechanism to extend the functionality provided by the Istio proxy through WebAssembly filters.", "type": "object", @@ -66,6 +123,9 @@ "description": "Determines ordering of `WasmPlugins` in the same `phase`. When multiple `WasmPlugins` are applied to the same workload in the same `phase`, they will be applied by priority, in descending order. If `priority` is not set, or two `WasmPlugins` exist with the same value, the ordering will be deterministically derived from name and namespace of the `WasmPlugins`. Defaults to `0`.", "type": "integer", "nullable": true + }, + "vmConfig": { + "$ref": "#/components/schemas/istio.extensions.v1alpha1.VmConfig" } } }, diff --git a/extensions/v1alpha1/wasm.pb.go b/extensions/v1alpha1/wasm.pb.go index cdb7a5d4e8a..76bf45fe2bf 100644 --- a/extensions/v1alpha1/wasm.pb.go +++ b/extensions/v1alpha1/wasm.pb.go @@ -307,10 +307,12 @@ type WasmPlugin struct { // If `priority` is not set, or two `WasmPlugins` exist with the same // value, the ordering will be deterministically derived from name and // namespace of the `WasmPlugins`. Defaults to `0`. - Priority *types.Int64Value `protobuf:"bytes,10,opt,name=priority,proto3" json:"priority,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Priority *types.Int64Value `protobuf:"bytes,10,opt,name=priority,proto3" json:"priority,omitempty"` + // Configuration for finding or starting VM. + VmConfig *VmConfig `protobuf:"bytes,11,opt,name=vm_config,json=vmConfig,proto3" json:"vm_config,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *WasmPlugin) Reset() { *m = WasmPlugin{} } @@ -416,49 +418,244 @@ func (m *WasmPlugin) GetPriority() *types.Int64Value { return nil } +func (m *WasmPlugin) GetVmConfig() *VmConfig { + if m != nil { + return m.VmConfig + } + return nil +} + +// Configuration for a Wasm VM. +type VmConfig struct { + // An ID which will be used along with a hash of the wasm code (or the name of the registered Null + // VM plugin) to determine which VM will be used for the plugin. All plugins which use the same + // *vm_id* and code will use the same VM. May be left blank. Sharing a VM between plugins can + // reduce memory utilization and make sharing of data easier which may have security implications. + VmId string `protobuf:"bytes,1,opt,name=vm_id,json=vmId,proto3" json:"vm_id,omitempty"` + // The Wasm runtime type (either "v8" or "null" for code compiled into Envoy). + // Default valut: `envoy.wasm.runtime.v8` + Runtime string `protobuf:"bytes,2,opt,name=runtime,proto3" json:"runtime,omitempty"` + // The Wasm configuration used in initialization of a new VM + // (proxy_on_start). `google.protobuf.Struct` is serialized as JSON before + // passing it to the plugin. `google.protobuf.BytesValue` and + // `google.protobuf.StringValue` are passed directly without the wrapper. + Configuration *types.Any `protobuf:"bytes,3,opt,name=configuration,proto3" json:"configuration,omitempty"` + // Allow the wasm file to include pre-compiled code on VMs which support it. + // Warning: this should only be enable for trusted sources as the precompiled code is not + // verified. + AllowPrecompiled bool `protobuf:"varint,4,opt,name=allow_precompiled,json=allowPrecompiled,proto3" json:"allow_precompiled,omitempty"` + // If true and the code needs to be remotely fetched and it is not in the cache then NACK the configuration + // update and do a background fetch to fill the cache, otherwise fetch the code asynchronously and enter + // warming state. + NackOnCodeCacheMiss bool `protobuf:"varint,5,opt,name=nack_on_code_cache_miss,json=nackOnCodeCacheMiss,proto3" json:"nack_on_code_cache_miss,omitempty"` + // Specifies environment variables to be injected to this VM which will be available through + // WASI's ``environ_get`` and ``environ_get_sizes`` system calls. Note that these functions are mostly implicitly + // called in your language's standard library, so you do not need to call them directly and you can access to env + // vars just like when you do on native platforms. + // Warning: Envoy rejects the configuration if there's conflict of key space. + EnvironmentVariables *EnvironmentVariables `protobuf:"bytes,6,opt,name=environment_variables,json=environmentVariables,proto3" json:"environment_variables,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VmConfig) Reset() { *m = VmConfig{} } +func (m *VmConfig) String() string { return proto.CompactTextString(m) } +func (*VmConfig) ProtoMessage() {} +func (*VmConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_4d60b240916c4e18, []int{1} +} +func (m *VmConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VmConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VmConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VmConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_VmConfig.Merge(m, src) +} +func (m *VmConfig) XXX_Size() int { + return m.Size() +} +func (m *VmConfig) XXX_DiscardUnknown() { + xxx_messageInfo_VmConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_VmConfig proto.InternalMessageInfo + +func (m *VmConfig) GetVmId() string { + if m != nil { + return m.VmId + } + return "" +} + +func (m *VmConfig) GetRuntime() string { + if m != nil { + return m.Runtime + } + return "" +} + +func (m *VmConfig) GetConfiguration() *types.Any { + if m != nil { + return m.Configuration + } + return nil +} + +func (m *VmConfig) GetAllowPrecompiled() bool { + if m != nil { + return m.AllowPrecompiled + } + return false +} + +func (m *VmConfig) GetNackOnCodeCacheMiss() bool { + if m != nil { + return m.NackOnCodeCacheMiss + } + return false +} + +func (m *VmConfig) GetEnvironmentVariables() *EnvironmentVariables { + if m != nil { + return m.EnvironmentVariables + } + return nil +} + +type EnvironmentVariables struct { + // The keys of *Envoy's* environment variables exposed to this VM. In other words, if a key exists in Envoy's environment + // variables, then that key-value pair will be injected. Note that if a key does not exist, it will be ignored. + HostEnvKeys []string `protobuf:"bytes,1,rep,name=host_env_keys,json=hostEnvKeys,proto3" json:"host_env_keys,omitempty"` + // Explicitly given key-value pairs to be injected to this VM in the form of "KEY=VALUE". + KeyValues map[string]string `protobuf:"bytes,2,rep,name=key_values,json=keyValues,proto3" json:"key_values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvironmentVariables) Reset() { *m = EnvironmentVariables{} } +func (m *EnvironmentVariables) String() string { return proto.CompactTextString(m) } +func (*EnvironmentVariables) ProtoMessage() {} +func (*EnvironmentVariables) Descriptor() ([]byte, []int) { + return fileDescriptor_4d60b240916c4e18, []int{2} +} +func (m *EnvironmentVariables) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvironmentVariables) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvironmentVariables.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvironmentVariables) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvironmentVariables.Merge(m, src) +} +func (m *EnvironmentVariables) XXX_Size() int { + return m.Size() +} +func (m *EnvironmentVariables) XXX_DiscardUnknown() { + xxx_messageInfo_EnvironmentVariables.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvironmentVariables proto.InternalMessageInfo + +func (m *EnvironmentVariables) GetHostEnvKeys() []string { + if m != nil { + return m.HostEnvKeys + } + return nil +} + +func (m *EnvironmentVariables) GetKeyValues() map[string]string { + if m != nil { + return m.KeyValues + } + return nil +} + func init() { proto.RegisterEnum("istio.extensions.v1alpha1.PluginPhase", PluginPhase_name, PluginPhase_value) proto.RegisterEnum("istio.extensions.v1alpha1.PullPolicy", PullPolicy_name, PullPolicy_value) proto.RegisterType((*WasmPlugin)(nil), "istio.extensions.v1alpha1.WasmPlugin") + proto.RegisterType((*VmConfig)(nil), "istio.extensions.v1alpha1.VmConfig") + proto.RegisterType((*EnvironmentVariables)(nil), "istio.extensions.v1alpha1.EnvironmentVariables") + proto.RegisterMapType((map[string]string)(nil), "istio.extensions.v1alpha1.EnvironmentVariables.KeyValuesEntry") } func init() { proto.RegisterFile("extensions/v1alpha1/wasm.proto", fileDescriptor_4d60b240916c4e18) } var fileDescriptor_4d60b240916c4e18 = []byte{ - // 520 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xdf, 0x6e, 0x12, 0x41, - 0x14, 0xc6, 0xbb, 0xc5, 0x22, 0x1c, 0xaa, 0x6e, 0x27, 0xb1, 0xae, 0xad, 0x41, 0x62, 0xd4, 0x20, - 0x17, 0xb3, 0x01, 0xb5, 0xde, 0xf4, 0x42, 0x8a, 0x98, 0x12, 0x0d, 0xae, 0xbb, 0xd4, 0xc6, 0xde, - 0x90, 0x61, 0x1d, 0x60, 0xd2, 0x61, 0x67, 0x33, 0x33, 0x0b, 0xee, 0x1b, 0x7a, 0xe9, 0x23, 0x18, - 0x9e, 0xc2, 0x4b, 0xc3, 0x2c, 0x14, 0xea, 0xbf, 0xbb, 0xc3, 0x39, 0xbf, 0xef, 0x9b, 0x73, 0x3e, - 0xb2, 0x50, 0xa6, 0x5f, 0x35, 0x8d, 0x14, 0x13, 0x91, 0x72, 0xa7, 0x75, 0xc2, 0xe3, 0x31, 0xa9, - 0xbb, 0x33, 0xa2, 0x26, 0x38, 0x96, 0x42, 0x0b, 0x74, 0x9f, 0x29, 0xcd, 0x04, 0x5e, 0x53, 0x78, - 0x45, 0x1d, 0x94, 0x47, 0x42, 0x8c, 0x38, 0x75, 0x0d, 0x38, 0x48, 0x86, 0xee, 0x4c, 0x92, 0x38, - 0xa6, 0x52, 0x65, 0xd2, 0x83, 0x07, 0xbf, 0xcf, 0x95, 0x96, 0x49, 0xa8, 0x97, 0xd3, 0x43, 0x9d, - 0xc6, 0xd4, 0x9d, 0xd6, 0x07, 0x54, 0x93, 0xba, 0xab, 0x28, 0xa7, 0xa1, 0x16, 0x32, 0x1b, 0x3e, - 0xfa, 0x99, 0x03, 0x38, 0x27, 0x6a, 0xe2, 0xf1, 0x64, 0xc4, 0x22, 0xf4, 0x1a, 0x0a, 0x2b, 0xc0, - 0xb1, 0x2a, 0x56, 0xb5, 0xd4, 0x78, 0x8c, 0xb3, 0xbd, 0x16, 0x26, 0x78, 0x69, 0x82, 0xcf, 0x85, - 0xbc, 0xe4, 0x82, 0x7c, 0x09, 0x96, 0xac, 0x7f, 0xa5, 0x42, 0x36, 0xe4, 0x12, 0xc9, 0x9d, 0xed, - 0x8a, 0x55, 0x2d, 0xfa, 0x8b, 0x12, 0xed, 0x43, 0x5e, 0x8d, 0x49, 0xe3, 0xe5, 0x91, 0x93, 0x33, - 0xcd, 0xe5, 0x2f, 0xf4, 0x11, 0xf6, 0xd8, 0x84, 0x8c, 0x68, 0x3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 0xdb, 0xde, 0x42, 0x45, 0xd8, 0x69, 0x9e, 0xf5, 0x4e, 0xbb, 0xb6, 0xb5, 0x2a, 0x2f, 0xec, 0xed, - 0x45, 0x19, 0xf4, 0x9a, 0xbd, 0xc0, 0xce, 0xd5, 0x4e, 0x00, 0x36, 0xfe, 0x81, 0x7d, 0x40, 0xd7, - 0x5c, 0x3e, 0xbc, 0xef, 0xb4, 0x3e, 0xdb, 0x5b, 0xc8, 0x86, 0xdd, 0xce, 0xb0, 0x2b, 0xb4, 0x27, - 0xa9, 0xa2, 0x91, 0xb6, 0x2d, 0x04, 0x90, 0x6f, 0xf2, 0x19, 0x49, 0x95, 0xbd, 0x7d, 0x82, 0xbf, - 0xcd, 0xcb, 0xd6, 0xf7, 0x79, 0xd9, 0xfa, 0x31, 0x2f, 0x5b, 0x17, 0x95, 0xec, 0x7e, 0x26, 0x5c, - 0x12, 0x33, 0xf7, 0x2f, 0x9f, 0xcd, 0x20, 0x6f, 0x2e, 0x7b, 0xfe, 0x2b, 0x00, 0x00, 0xff, 0xff, - 0x4c, 0xa9, 0xbd, 0xec, 0x54, 0x03, 0x00, 0x00, + // 804 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x5d, 0x6f, 0xdb, 0x36, + 0x14, 0xad, 0xec, 0x38, 0xb5, 0xaf, 0x9b, 0x4e, 0x61, 0xd3, 0x56, 0x4d, 0x07, 0xcf, 0xc8, 0x3e, + 0xe0, 0x65, 0x80, 0x84, 0x78, 0x5d, 0x37, 0x14, 0xc1, 0x50, 0xd7, 0xf3, 0x50, 0x23, 0x5b, 0xea, + 0xc9, 0x69, 0x8a, 0x15, 0x18, 0x04, 0x46, 0x66, 0x6c, 0xc2, 0x14, 0x29, 0x90, 0x94, 0x32, 0xfd, + 0xb5, 0x3d, 0xec, 0x79, 0x8f, 0x7b, 0xdb, 0xeb, 0x90, 0x5f, 0x32, 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0x00, 0x00, } func (m *WasmPlugin) Marshal() (dAtA []byte, err error) { @@ -485,6 +682,18 @@ func (m *WasmPlugin) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.VmConfig != nil { + { + size, err := m.VmConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWasm(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } if m.Priority != nil { { size, err := m.Priority.MarshalToSizedBuffer(dAtA[:i]) @@ -569,6 +778,146 @@ func (m *WasmPlugin) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *VmConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VmConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VmConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.EnvironmentVariables != nil { + { + size, err := m.EnvironmentVariables.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWasm(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.NackOnCodeCacheMiss { + i-- + if m.NackOnCodeCacheMiss { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.AllowPrecompiled { + i-- + if m.AllowPrecompiled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Configuration != nil { + { + size, err := m.Configuration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintWasm(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Runtime) > 0 { + i -= len(m.Runtime) + copy(dAtA[i:], m.Runtime) + i = encodeVarintWasm(dAtA, i, uint64(len(m.Runtime))) + i-- + dAtA[i] = 0x12 + } + if len(m.VmId) > 0 { + i -= len(m.VmId) + copy(dAtA[i:], m.VmId) + i = encodeVarintWasm(dAtA, i, uint64(len(m.VmId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EnvironmentVariables) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvironmentVariables) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvironmentVariables) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.KeyValues) > 0 { + for k := range m.KeyValues { + v := m.KeyValues[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintWasm(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintWasm(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintWasm(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.HostEnvKeys) > 0 { + for iNdEx := len(m.HostEnvKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.HostEnvKeys[iNdEx]) + copy(dAtA[i:], m.HostEnvKeys[iNdEx]) + i = encodeVarintWasm(dAtA, i, uint64(len(m.HostEnvKeys[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintWasm(dAtA []byte, offset int, v uint64) int { offset -= sovWasm(v) base := offset @@ -624,6 +973,70 @@ func (m *WasmPlugin) Size() (n int) { l = m.Priority.Size() n += 1 + l + sovWasm(uint64(l)) } + if m.VmConfig != nil { + l = m.VmConfig.Size() + n += 1 + l + sovWasm(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *VmConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.VmId) + if l > 0 { + n += 1 + l + sovWasm(uint64(l)) + } + l = len(m.Runtime) + if l > 0 { + n += 1 + l + sovWasm(uint64(l)) + } + if m.Configuration != nil { + l = m.Configuration.Size() + n += 1 + l + sovWasm(uint64(l)) + } + if m.AllowPrecompiled { + n += 2 + } + if m.NackOnCodeCacheMiss { + n += 2 + } + if m.EnvironmentVariables != nil { + l = m.EnvironmentVariables.Size() + n += 1 + l + sovWasm(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvironmentVariables) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.HostEnvKeys) > 0 { + for _, s := range m.HostEnvKeys { + l = len(s) + n += 1 + l + sovWasm(uint64(l)) + } + } + if len(m.KeyValues) > 0 { + for k, v := range m.KeyValues { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovWasm(uint64(len(k))) + 1 + len(v) + sovWasm(uint64(len(v))) + n += mapEntrySize + 1 + sovWasm(uint64(mapEntrySize)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -971,6 +1384,479 @@ func (m *WasmPlugin) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VmConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWasm + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWasm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VmConfig == nil { + m.VmConfig = &VmConfig{} + } + if err := m.VmConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWasm(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWasm + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VmConfig) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VmConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VmConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VmId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWasm + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWasm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VmId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Runtime", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWasm + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWasm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Runtime = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWasm + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWasm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Configuration == nil { + m.Configuration = &types.Any{} + } + if err := m.Configuration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowPrecompiled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowPrecompiled = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NackOnCodeCacheMiss", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NackOnCodeCacheMiss = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnvironmentVariables", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWasm + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWasm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EnvironmentVariables == nil { + m.EnvironmentVariables = &EnvironmentVariables{} + } + if err := m.EnvironmentVariables.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWasm(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWasm + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvironmentVariables) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EnvironmentVariables: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EnvironmentVariables: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostEnvKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWasm + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWasm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostEnvKeys = append(m.HostEnvKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyValues", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWasm + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWasm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KeyValues == nil { + m.KeyValues = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthWasm + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthWasm + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWasm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthWasm + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthWasm + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipWasm(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthWasm + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.KeyValues[mapkey] = mapvalue + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipWasm(dAtA[iNdEx:]) diff --git a/extensions/v1alpha1/wasm.pb.html b/extensions/v1alpha1/wasm.pb.html index b06220b9868..55eb83e3733 100644 --- a/extensions/v1alpha1/wasm.pb.html +++ b/extensions/v1alpha1/wasm.pb.html @@ -6,7 +6,7 @@ generator: protoc-gen-docs schema: istio.extensions.v1alpha1.WasmPlugin aliases: [/docs/reference/config/extensions/v1alpha1/wasm-plugin] -number_of_entries: 3 +number_of_entries: 5 ---

WasmPlugins provides a mechanism to extend the functionality provided by the Istio proxy through WebAssembly filters.

@@ -281,6 +281,153 @@

WasmPlugin

value, the ordering will be deterministically derived from name and namespace of the WasmPlugins. Defaults to 0.

+ + +No + + + +vmConfig +VmConfig + +

Configuration for finding or starting VM.

+ + + +No + + + + + +

VmConfig

+
+

Configuration for a Wasm VM.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
vmIdstring +

An ID which will be used along with a hash of the wasm code (or the name of the registered Null +VM plugin) to determine which VM will be used for the plugin. All plugins which use the same +vm_id and code will use the same VM. May be left blank. Sharing a VM between plugins can +reduce memory utilization and make sharing of data easier which may have security implications.

+ +
+No +
runtimestring +

The Wasm runtime type (either “v8” or “null” for code compiled into Envoy). +Default valut: envoy.wasm.runtime.v8

+ +
+No +
configurationAny +

The Wasm configuration used in initialization of a new VM +(proxyonstart). google.protobuf.Struct is serialized as JSON before +passing it to the plugin. google.protobuf.BytesValue and +google.protobuf.StringValue are passed directly without the wrapper.

+ +
+No +
allowPrecompiledbool +

Allow the wasm file to include pre-compiled code on VMs which support it. +Warning: this should only be enable for trusted sources as the precompiled code is not +verified.

+ +
+No +
nackOnCodeCacheMissbool +

If true and the code needs to be remotely fetched and it is not in the cache then NACK the configuration +update and do a background fetch to fill the cache, otherwise fetch the code asynchronously and enter +warming state.

+ +
+No +
environmentVariablesEnvironmentVariables +

Specifies environment variables to be injected to this VM which will be available through +WASI’s environ_get and environ_get_sizes system calls. Note that these functions are mostly implicitly +called in your language’s standard library, so you do not need to call them directly and you can access to env +vars just like when you do on native platforms. +Warning: Envoy rejects the configuration if there’s conflict of key space.

+ +
+No +
+
+

EnvironmentVariables

+
+ + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
hostEnvKeysstring[] +

The keys of Envoy’s environment variables exposed to this VM. In other words, if a key exists in Envoy’s environment +variables, then that key-value pair will be injected. Note that if a key does not exist, it will be ignored.

+ +
+No +
keyValuesmap<string, string> +

Explicitly given key-value pairs to be injected to this VM in the form of “KEY=VALUE”.

+
No diff --git a/extensions/v1alpha1/wasm.proto b/extensions/v1alpha1/wasm.proto index fe1ca7d19a6..2793bc7cab1 100644 --- a/extensions/v1alpha1/wasm.proto +++ b/extensions/v1alpha1/wasm.proto @@ -14,6 +14,7 @@ syntax = "proto3"; +import "google/protobuf/any.proto"; import "google/protobuf/wrappers.proto"; import "google/protobuf/struct.proto"; import "type/v1beta1/selector.proto"; @@ -241,6 +242,9 @@ message WasmPlugin { // value, the ordering will be deterministically derived from name and // namespace of the `WasmPlugins`. Defaults to `0`. google.protobuf.Int64Value priority = 10; + + // Configuration for finding or starting VM. + VmConfig vm_config = 11; } // The phase in the filter chain where the plugin will be injected. @@ -280,3 +284,48 @@ enum PullPolicy { // this plugin. Always = 2; } + +// Configuration for a Wasm VM. +message VmConfig { + // An ID which will be used along with a hash of the wasm code (or the name of the registered Null + // VM plugin) to determine which VM will be used for the plugin. All plugins which use the same + // *vm_id* and code will use the same VM. May be left blank. Sharing a VM between plugins can + // reduce memory utilization and make sharing of data easier which may have security implications. + string vm_id = 1; + + // The Wasm runtime type (either "v8" or "null" for code compiled into Envoy). + // Default valut: `envoy.wasm.runtime.v8` + string runtime = 2; + + // The Wasm configuration used in initialization of a new VM + // (proxy_on_start). `google.protobuf.Struct` is serialized as JSON before + // passing it to the plugin. `google.protobuf.BytesValue` and + // `google.protobuf.StringValue` are passed directly without the wrapper. + google.protobuf.Any configuration = 3; + + // Allow the wasm file to include pre-compiled code on VMs which support it. + // Warning: this should only be enable for trusted sources as the precompiled code is not + // verified. + bool allow_precompiled = 4; + + // If true and the code needs to be remotely fetched and it is not in the cache then NACK the configuration + // update and do a background fetch to fill the cache, otherwise fetch the code asynchronously and enter + // warming state. + bool nack_on_code_cache_miss = 5; + + // Specifies environment variables to be injected to this VM which will be available through + // WASI's ``environ_get`` and ``environ_get_sizes`` system calls. Note that these functions are mostly implicitly + // called in your language's standard library, so you do not need to call them directly and you can access to env + // vars just like when you do on native platforms. + // Warning: Envoy rejects the configuration if there's conflict of key space. + EnvironmentVariables environment_variables = 6; +} + +message EnvironmentVariables { + // The keys of *Envoy's* environment variables exposed to this VM. In other words, if a key exists in Envoy's environment + // variables, then that key-value pair will be injected. Note that if a key does not exist, it will be ignored. + repeated string host_env_keys = 1; + + // Explicitly given key-value pairs to be injected to this VM in the form of "KEY=VALUE". + map key_values = 2; +} \ No newline at end of file diff --git a/extensions/v1alpha1/wasm_deepcopy.gen.go b/extensions/v1alpha1/wasm_deepcopy.gen.go index ec5bd7371fc..1a665cef375 100644 --- a/extensions/v1alpha1/wasm_deepcopy.gen.go +++ b/extensions/v1alpha1/wasm_deepcopy.gen.go @@ -165,3 +165,45 @@ func (in *WasmPlugin) DeepCopy() *WasmPlugin { func (in *WasmPlugin) DeepCopyInterface() interface{} { return in.DeepCopy() } + +// DeepCopyInto supports using VmConfig within kubernetes types, where deepcopy-gen is used. +func (in *VmConfig) DeepCopyInto(out *VmConfig) { + p := proto.Clone(in).(*VmConfig) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VmConfig. Required by controller-gen. +func (in *VmConfig) DeepCopy() *VmConfig { + if in == nil { + return nil + } + out := new(VmConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new VmConfig. Required by controller-gen. +func (in *VmConfig) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using EnvironmentVariables within kubernetes types, where deepcopy-gen is used. +func (in *EnvironmentVariables) DeepCopyInto(out *EnvironmentVariables) { + p := proto.Clone(in).(*EnvironmentVariables) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentVariables. Required by controller-gen. +func (in *EnvironmentVariables) DeepCopy() *EnvironmentVariables { + if in == nil { + return nil + } + out := new(EnvironmentVariables) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentVariables. Required by controller-gen. +func (in *EnvironmentVariables) DeepCopyInterface() interface{} { + return in.DeepCopy() +} diff --git a/extensions/v1alpha1/wasm_json.gen.go b/extensions/v1alpha1/wasm_json.gen.go index 7a019e63430..95b7dc1df9a 100644 --- a/extensions/v1alpha1/wasm_json.gen.go +++ b/extensions/v1alpha1/wasm_json.gen.go @@ -158,6 +158,28 @@ func (this *WasmPlugin) UnmarshalJSON(b []byte) error { return WasmUnmarshaler.Unmarshal(bytes.NewReader(b), this) } +// MarshalJSON is a custom marshaler for VmConfig +func (this *VmConfig) MarshalJSON() ([]byte, error) { + str, err := WasmMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for VmConfig +func (this *VmConfig) UnmarshalJSON(b []byte) error { + return WasmUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvironmentVariables +func (this *EnvironmentVariables) MarshalJSON() ([]byte, error) { + str, err := WasmMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvironmentVariables +func (this *EnvironmentVariables) UnmarshalJSON(b []byte) error { + return WasmUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + var ( WasmMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} WasmUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{AllowUnknownFields: true} diff --git a/kubernetes/customresourcedefinitions.gen.yaml b/kubernetes/customresourcedefinitions.gen.yaml index 7dab5252f1b..deca58a841a 100644 --- a/kubernetes/customresourcedefinitions.gen.yaml +++ b/kubernetes/customresourcedefinitions.gen.yaml @@ -85,6 +85,46 @@ spec: type: string verificationKey: type: string + vmConfig: + description: Configuration for finding or starting VM. + properties: + allowPrecompiled: + description: Allow the wasm file to include pre-compiled code + on VMs which support it. + type: boolean + configuration: + properties: + '@type': + description: A URL/resource name that uniquely identifies + the type of the serialized protocol buffer message. + type: string + required: + - '@type' + type: object + environmentVariables: + properties: + hostEnvKeys: + description: The keys of *Envoy's* environment variables exposed + to this VM. + items: + type: string + type: array + keyValues: + additionalProperties: + type: string + description: Explicitly given key-value pairs to be injected + to this VM in the form of "KEY=VALUE". + type: object + type: object + nackOnCodeCacheMiss: + type: boolean + runtime: + description: The Wasm runtime type (either "v8" or "null" for + code compiled into Envoy). + type: string + vmId: + type: string + type: object type: object status: type: object diff --git a/python/istio_api/extensions/v1alpha1/wasm_pb2.py b/python/istio_api/extensions/v1alpha1/wasm_pb2.py index c587dc3efc3..5604fae0dad 100644 --- a/python/istio_api/extensions/v1alpha1/wasm_pb2.py +++ b/python/istio_api/extensions/v1alpha1/wasm_pb2.py @@ -12,6 +12,7 @@ _sym_db = _symbol_database.Default() +from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 from type.v1beta1 import selector_pb2 as type_dot_v1beta1_dot_selector__pb2 @@ -23,9 +24,9 @@ syntax='proto3', serialized_options=b'Z istio.io/api/extensions/v1alpha1', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1e\x65xtensions/v1alpha1/wasm.proto\x12\x19istio.extensions.v1alpha1\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1btype/v1beta1/selector.proto\"\xf8\x03\n\nWasmPlugin\x12@\n\x08selector\x18\x01 \x01(\x0b\x32$.istio.type.v1beta1.WorkloadSelectorR\x08selector\x12\x10\n\x03url\x18\x02 \x01(\tR\x03url\x12\x16\n\x06sha256\x18\x03 \x01(\tR\x06sha256\x12Q\n\x11image_pull_policy\x18\x04 \x01(\x0e\x32%.istio.extensions.v1alpha1.PullPolicyR\x0fimagePullPolicy\x12*\n\x11image_pull_secret\x18\x05 \x01(\tR\x0fimagePullSecret\x12)\n\x10verification_key\x18\x06 \x01(\tR\x0fverificationKey\x12<\n\rplugin_config\x18\x07 \x01(\x0b\x32\x17.google.protobuf.StructR\x0cpluginConfig\x12\x1f\n\x0bplugin_name\x18\x08 \x01(\tR\npluginName\x12<\n\x05phase\x18\t \x01(\x0e\x32&.istio.extensions.v1alpha1.PluginPhaseR\x05phase\x12\x37\n\x08priority\x18\n \x01(\x0b\x32\x1b.google.protobuf.Int64ValueR\x08priority*E\n\x0bPluginPhase\x12\x15\n\x11UNSPECIFIED_PHASE\x10\x00\x12\t\n\x05\x41UTHN\x10\x01\x12\t\n\x05\x41UTHZ\x10\x02\x12\t\n\x05STATS\x10\x03*B\n\nPullPolicy\x12\x16\n\x12UNSPECIFIED_POLICY\x10\x00\x12\x10\n\x0cIfNotPresent\x10\x01\x12\n\n\x06\x41lways\x10\x02\x42\"Z istio.io/api/extensions/v1alpha1b\x06proto3' + serialized_pb=b'\n\x1e\x65xtensions/v1alpha1/wasm.proto\x12\x19istio.extensions.v1alpha1\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1btype/v1beta1/selector.proto\"\xba\x04\n\nWasmPlugin\x12@\n\x08selector\x18\x01 \x01(\x0b\x32$.istio.type.v1beta1.WorkloadSelectorR\x08selector\x12\x10\n\x03url\x18\x02 \x01(\tR\x03url\x12\x16\n\x06sha256\x18\x03 \x01(\tR\x06sha256\x12Q\n\x11image_pull_policy\x18\x04 \x01(\x0e\x32%.istio.extensions.v1alpha1.PullPolicyR\x0fimagePullPolicy\x12*\n\x11image_pull_secret\x18\x05 \x01(\tR\x0fimagePullSecret\x12)\n\x10verification_key\x18\x06 \x01(\tR\x0fverificationKey\x12<\n\rplugin_config\x18\x07 \x01(\x0b\x32\x17.google.protobuf.StructR\x0cpluginConfig\x12\x1f\n\x0bplugin_name\x18\x08 \x01(\tR\npluginName\x12<\n\x05phase\x18\t \x01(\x0e\x32&.istio.extensions.v1alpha1.PluginPhaseR\x05phase\x12\x37\n\x08priority\x18\n \x01(\x0b\x32\x1b.google.protobuf.Int64ValueR\x08priority\x12@\n\tvm_config\x18\x0b \x01(\x0b\x32#.istio.extensions.v1alpha1.VmConfigR\x08vmConfig\"\xbe\x02\n\x08VmConfig\x12\x13\n\x05vm_id\x18\x01 \x01(\tR\x04vmId\x12\x18\n\x07runtime\x18\x02 \x01(\tR\x07runtime\x12:\n\rconfiguration\x18\x03 \x01(\x0b\x32\x14.google.protobuf.AnyR\rconfiguration\x12+\n\x11\x61llow_precompiled\x18\x04 \x01(\x08R\x10\x61llowPrecompiled\x12\x34\n\x17nack_on_code_cache_miss\x18\x05 \x01(\x08R\x13nackOnCodeCacheMiss\x12\x64\n\x15\x65nvironment_variables\x18\x06 \x01(\x0b\x32/.istio.extensions.v1alpha1.EnvironmentVariablesR\x14\x65nvironmentVariables\"\xd7\x01\n\x14\x45nvironmentVariables\x12\"\n\rhost_env_keys\x18\x01 \x03(\tR\x0bhostEnvKeys\x12]\n\nkey_values\x18\x02 \x03(\x0b\x32>.istio.extensions.v1alpha1.EnvironmentVariables.KeyValuesEntryR\tkeyValues\x1a<\n\x0eKeyValuesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01*E\n\x0bPluginPhase\x12\x15\n\x11UNSPECIFIED_PHASE\x10\x00\x12\t\n\x05\x41UTHN\x10\x01\x12\t\n\x05\x41UTHZ\x10\x02\x12\t\n\x05STATS\x10\x03*B\n\nPullPolicy\x12\x16\n\x12UNSPECIFIED_POLICY\x10\x00\x12\x10\n\x0cIfNotPresent\x10\x01\x12\n\n\x06\x41lways\x10\x02\x42\"Z istio.io/api/extensions/v1alpha1b\x06proto3' , - dependencies=[google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,type_dot_v1beta1_dot_selector__pb2.DESCRIPTOR,]) + dependencies=[google_dot_protobuf_dot_any__pb2.DESCRIPTOR,google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,type_dot_v1beta1_dot_selector__pb2.DESCRIPTOR,]) _PLUGINPHASE = _descriptor.EnumDescriptor( name='PluginPhase', @@ -57,8 +58,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=659, - serialized_end=728, + serialized_start=1291, + serialized_end=1360, ) _sym_db.RegisterEnumDescriptor(_PLUGINPHASE) @@ -88,8 +89,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=730, - serialized_end=796, + serialized_start=1362, + serialized_end=1428, ) _sym_db.RegisterEnumDescriptor(_PULLPOLICY) @@ -182,6 +183,80 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, json_name='priority', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='vm_config', full_name='istio.extensions.v1alpha1.WasmPlugin.vm_config', index=10, + number=11, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='vmConfig', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=180, + serialized_end=750, +) + + +_VMCONFIG = _descriptor.Descriptor( + name='VmConfig', + full_name='istio.extensions.v1alpha1.VmConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='vm_id', full_name='istio.extensions.v1alpha1.VmConfig.vm_id', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='vmId', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='runtime', full_name='istio.extensions.v1alpha1.VmConfig.runtime', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='runtime', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='configuration', full_name='istio.extensions.v1alpha1.VmConfig.configuration', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='configuration', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='allow_precompiled', full_name='istio.extensions.v1alpha1.VmConfig.allow_precompiled', index=3, + number=4, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='allowPrecompiled', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='nack_on_code_cache_miss', full_name='istio.extensions.v1alpha1.VmConfig.nack_on_code_cache_miss', index=4, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='nackOnCodeCacheMiss', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='environment_variables', full_name='istio.extensions.v1alpha1.VmConfig.environment_variables', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='environmentVariables', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -194,8 +269,85 @@ extension_ranges=[], oneofs=[ ], - serialized_start=153, - serialized_end=657, + serialized_start=753, + serialized_end=1071, +) + + +_ENVIRONMENTVARIABLES_KEYVALUESENTRY = _descriptor.Descriptor( + name='KeyValuesEntry', + full_name='istio.extensions.v1alpha1.EnvironmentVariables.KeyValuesEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='istio.extensions.v1alpha1.EnvironmentVariables.KeyValuesEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='key', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='value', full_name='istio.extensions.v1alpha1.EnvironmentVariables.KeyValuesEntry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='value', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=b'8\001', + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1229, + serialized_end=1289, +) + +_ENVIRONMENTVARIABLES = _descriptor.Descriptor( + name='EnvironmentVariables', + full_name='istio.extensions.v1alpha1.EnvironmentVariables', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='host_env_keys', full_name='istio.extensions.v1alpha1.EnvironmentVariables.host_env_keys', index=0, + number=1, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='hostEnvKeys', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='key_values', full_name='istio.extensions.v1alpha1.EnvironmentVariables.key_values', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, json_name='keyValues', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_ENVIRONMENTVARIABLES_KEYVALUESENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1074, + serialized_end=1289, ) _WASMPLUGIN.fields_by_name['selector'].message_type = type_dot_v1beta1_dot_selector__pb2._WORKLOADSELECTOR @@ -203,7 +355,14 @@ _WASMPLUGIN.fields_by_name['plugin_config'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT _WASMPLUGIN.fields_by_name['phase'].enum_type = _PLUGINPHASE _WASMPLUGIN.fields_by_name['priority'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT64VALUE +_WASMPLUGIN.fields_by_name['vm_config'].message_type = _VMCONFIG +_VMCONFIG.fields_by_name['configuration'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_VMCONFIG.fields_by_name['environment_variables'].message_type = _ENVIRONMENTVARIABLES +_ENVIRONMENTVARIABLES_KEYVALUESENTRY.containing_type = _ENVIRONMENTVARIABLES +_ENVIRONMENTVARIABLES.fields_by_name['key_values'].message_type = _ENVIRONMENTVARIABLES_KEYVALUESENTRY DESCRIPTOR.message_types_by_name['WasmPlugin'] = _WASMPLUGIN +DESCRIPTOR.message_types_by_name['VmConfig'] = _VMCONFIG +DESCRIPTOR.message_types_by_name['EnvironmentVariables'] = _ENVIRONMENTVARIABLES DESCRIPTOR.enum_types_by_name['PluginPhase'] = _PLUGINPHASE DESCRIPTOR.enum_types_by_name['PullPolicy'] = _PULLPOLICY _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -215,6 +374,29 @@ }) _sym_db.RegisterMessage(WasmPlugin) +VmConfig = _reflection.GeneratedProtocolMessageType('VmConfig', (_message.Message,), { + 'DESCRIPTOR' : _VMCONFIG, + '__module__' : 'extensions.v1alpha1.wasm_pb2' + # @@protoc_insertion_point(class_scope:istio.extensions.v1alpha1.VmConfig) + }) +_sym_db.RegisterMessage(VmConfig) + +EnvironmentVariables = _reflection.GeneratedProtocolMessageType('EnvironmentVariables', (_message.Message,), { + + 'KeyValuesEntry' : _reflection.GeneratedProtocolMessageType('KeyValuesEntry', (_message.Message,), { + 'DESCRIPTOR' : _ENVIRONMENTVARIABLES_KEYVALUESENTRY, + '__module__' : 'extensions.v1alpha1.wasm_pb2' + # @@protoc_insertion_point(class_scope:istio.extensions.v1alpha1.EnvironmentVariables.KeyValuesEntry) + }) + , + 'DESCRIPTOR' : _ENVIRONMENTVARIABLES, + '__module__' : 'extensions.v1alpha1.wasm_pb2' + # @@protoc_insertion_point(class_scope:istio.extensions.v1alpha1.EnvironmentVariables) + }) +_sym_db.RegisterMessage(EnvironmentVariables) +_sym_db.RegisterMessage(EnvironmentVariables.KeyValuesEntry) + DESCRIPTOR._options = None +_ENVIRONMENTVARIABLES_KEYVALUESENTRY._options = None # @@protoc_insertion_point(module_scope)