Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
294 changes: 294 additions & 0 deletions pkg/splunk/common/testdata/fixtures/apply_app_listing_config_map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
{
"kind": "StatefulSet",
"apiVersion": "apps/v1",
"metadata": {
"name": "splunk-example-cluster-master",
"namespace": "test",
"creationTimestamp": null,
"ownerReferences": [
{
"apiVersion": "",
"kind": "ClusterMaster",
"name": "example",
"uid": "",
"controller": true
}
]
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"app.kubernetes.io/component": "indexer",
"app.kubernetes.io/instance": "splunk-example-cluster-master",
"app.kubernetes.io/managed-by": "splunk-operator",
"app.kubernetes.io/name": "cluster-master",
"app.kubernetes.io/part-of": "splunk-example-indexer"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app.kubernetes.io/component": "indexer",
"app.kubernetes.io/instance": "splunk-example-cluster-master",
"app.kubernetes.io/managed-by": "splunk-operator",
"app.kubernetes.io/name": "cluster-master",
"app.kubernetes.io/part-of": "splunk-example-indexer"
},
"annotations": {
"appListingRev": "",
"traffic.sidecar.istio.io/excludeOutboundPorts": "8089,8191,9997",
"traffic.sidecar.istio.io/includeInboundPorts": "8000"
}
},
"spec": {
"volumes": [
{
"name": "mnt-splunk-secrets",
"secret": {
"secretName": "splunk-example-cluster-master-secret-v1",
"defaultMode": 420
}
},
{
"name": "mnt-app-listing",
"configMap": {
"name": "splunk-example-clustermaster-app-list",
"items": [
{
"key": "app-list-cluster-with-pre-config.yaml",
"path": "app-list-cluster-with-pre-config.yaml",
"mode": 420
},
{
"key": "app-list-cluster.yaml",
"path": "app-list-cluster.yaml",
"mode": 420
},
{
"key": "app-list-local.yaml",
"path": "app-list-local.yaml",
"mode": 420
},
{
"key": "appsUpdateToken",
"path": "appsUpdateToken",
"mode": 420
}
],
"defaultMode": 420
}
},
{
"name": "init-apps",
"emptyDir": {}
}
],
"containers": [
{
"name": "splunk",
"image": "splunk/splunk",
"ports": [
{
"name": "http-splunkweb",
"containerPort": 8000,
"protocol": "TCP"
},
{
"name": "https-splunkd",
"containerPort": 8089,
"protocol": "TCP"
}
],
"env": [
{
"name": "SPLUNK_CLUSTER_MASTER_URL",
"value": "localhost"
},
{
"name": "SPLUNK_HOME",
"value": "/opt/splunk"
},
{
"name": "SPLUNK_START_ARGS",
"value": "--accept-license"
},
{
"name": "SPLUNK_DEFAULTS_URL",
"value": "/mnt/app-listing/app-list-local.yaml,/mnt/app-listing/app-list-cluster.yaml,/mnt/app-listing/app-list-cluster-with-pre-config.yaml,/mnt/splunk-secrets/default.yml"
},
{
"name": "SPLUNK_HOME_OWNERSHIP_ENFORCEMENT",
"value": "false"
},
{
"name": "SPLUNK_ROLE",
"value": "splunk_cluster_master"
},
{
"name": "SPLUNK_DECLARATIVE_ADMIN_PASSWORD",
"value": "true"
}
],
"resources": {
"limits": {
"cpu": "4",
"memory": "8Gi"
},
"requests": {
"cpu": "100m",
"memory": "512Mi"
}
},
"volumeMounts": [
{
"name": "pvc-etc",
"mountPath": "/opt/splunk/etc"
},
{
"name": "pvc-var",
"mountPath": "/opt/splunk/var"
},
{
"name": "mnt-splunk-secrets",
"mountPath": "/mnt/splunk-secrets"
},
{
"name": "mnt-app-listing",
"mountPath": "/mnt/app-listing/"
},
{
"name": "init-apps",
"mountPath": "/init-apps/"
}
],
"livenessProbe": {
"exec": {
"command": [
"/mnt/probes/livenessProbe.sh"
]
},
"initialDelaySeconds": 1800,
"timeoutSeconds": 30,
"periodSeconds": 30
},
"readinessProbe": {
"exec": {
"command": [
"/mnt/probes/readinessProbe.sh"
]
},
"initialDelaySeconds": 10,
"timeoutSeconds": 5,
"periodSeconds": 5
},
"startupProbe": {
"exec": {
"command": [
"/mnt/probes/startupProbe.sh"
]
},
"initialDelaySeconds": 10,
"timeoutSeconds": 5,
"periodSeconds": 5,
"failureThreshold": 16
},
"imagePullPolicy": "IfNotPresent"
}
],
"securityContext": {
"runAsUser": 41812,
"runAsNonRoot": true,
"fsGroup": 41812,
"fsGroupChangePolicy": "OnRootMismatch"
},
"affinity": {
"podAntiAffinity": {
"preferredDuringSchedulingIgnoredDuringExecution": [
{
"weight": 100,
"podAffinityTerm": {
"labelSelector": {
"matchExpressions": [
{
"key": "app.kubernetes.io/instance",
"operator": "In",
"values": [
"splunk-example-cluster-master"
]
}
]
},
"topologyKey": "kubernetes.io/hostname"
}
}
]
}
},
"schedulerName": "default-scheduler"
}
},
"volumeClaimTemplates": [
{
"metadata": {
"name": "pvc-etc",
"namespace": "test",
"creationTimestamp": null,
"labels": {
"app.kubernetes.io/component": "indexer",
"app.kubernetes.io/instance": "splunk-example-cluster-master",
"app.kubernetes.io/managed-by": "splunk-operator",
"app.kubernetes.io/name": "cluster-master",
"app.kubernetes.io/part-of": "splunk-example-indexer"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "10Gi"
}
}
},
"status": {}
},
{
"metadata": {
"name": "pvc-var",
"namespace": "test",
"creationTimestamp": null,
"labels": {
"app.kubernetes.io/component": "indexer",
"app.kubernetes.io/instance": "splunk-example-cluster-master",
"app.kubernetes.io/managed-by": "splunk-operator",
"app.kubernetes.io/name": "cluster-master",
"app.kubernetes.io/part-of": "splunk-example-indexer"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Gi"
}
}
},
"status": {}
}
],
"serviceName": "splunk-example-cluster-master-headless",
"podManagementPolicy": "Parallel",
"updateStrategy": {
"type": "OnDelete"
}
},
"status": {
"availableReplicas": 0,
"replicas": 0
}
}
98 changes: 98 additions & 0 deletions pkg/splunk/common/testdata/fixtures/get_cluster_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"links": {},
"origin": "https://localhost:8089/services/server/info",
"updated": "2020-09-24T06:38:53+00:00",
"generator": {
"build": "a1a6394cc5ae",
"version": "8.0.5"
},
"entry": [
{
"name": "server-info",
"id": "https://localhost:8089/services/server/info/server-info",
"updated": "1970-01-01T00:00:00+00:00",
"links": {
"alternate": "/services/server/info/server-info",
"list": "/services/server/info/server-info"
},
"author": "system",
"acl": {
"app": "",
"can_list": true,
"can_write": true,
"modifiable": false,
"owner": "system",
"perms": {
"read": [
"*"
],
"write": []
},
"removable": false,
"sharing": "system"
},
"fields": {
"required": [],
"optional": [],
"wildcard": []
},
"content": {
"activeLicenseGroup": "Trial",
"activeLicenseSubgroup": "Production",
"build": "a1a6394cc5ae",
"cluster_label": [
"idxc_label"
],
"cpu_arch": "x86_64",
"eai:acl": null,
"fips_mode": false,
"guid": "0F93F33C-4BDA-4A74-AD9F-3FCE26C6AFF0",
"health_info": "green",
"health_version": 1,
"host": "splunk-default-monitoring-console-86bc9b7c8c-d96x2",
"host_fqdn": "splunk-default-monitoring-console-86bc9b7c8c-d96x2",
"host_resolved": "splunk-default-monitoring-console-86bc9b7c8c-d96x2",
"isForwarding": true,
"isFree": false,
"isTrial": true,
"kvStoreStatus": "ready",
"licenseKeys": [
"5C52DA5145AD67B8188604C49962D12F2C3B2CF1B82A6878E46F68CA2812807B"
],
"licenseSignature": "139bf73ec92c84121c79a9b8307a6724",
"licenseState": "OK",
"license_labels": [
"Splunk Enterprise Splunk Analytics for Hadoop Download Trial"
],
"master_guid": "0F93F33C-4BDA-4A74-AD9F-3FCE26C6AFF0",
"master_uri": "self",
"max_users": 4294967295,
"mode": "normal",
"numberOfCores": 1,
"numberOfVirtualCores": 2,
"os_build": "#1 SMP Thu Sep 3 19:04:44 UTC 2020",
"os_name": "Linux",
"os_name_extended": "Linux",
"os_version": "4.14.193-149.317.amzn2.x86_64",
"physicalMemoryMB": 7764,
"product_type": "enterprise",
"rtsearch_enabled": true,
"serverName": "splunk-default-monitoring-console-86bc9b7c8c-d96x2",
"server_roles": [
"license_master",
"cluster_search_head",
"search_head"
],
"startup_time": 1600928786,
"staticAssetId": "CFE3D41EE2CCD1465E8C8453F83E4ECFFF540780B4490E84458DD4A3694CE4D1",
"version": "8.0.5"
}
}
],
"paging": {
"total": 1,
"perPage": 30,
"offset": 0
},
"messages": []
}
Loading
Loading